# Functional Delta: 005-postgres-database-replacement

> For the complete documentation index, see [llms.txt](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/llms.txt).

Parent state: `004-containerized-compose-runtime`

## Added

*   PostgreSQL runtime initialization pack (`postgres-init/initialSchema.sql`) for deterministic baseline schema and seed data.
*   Postgres-specific smoke checks (readiness + baseline data presence).

## Changed

*   Runtime database engine changes from H2 server process to PostgreSQL container.
*   Service datasource wiring for:
    *   `account-service`
    *   `position-service`
    *   `trade-processor`
*   Account sequence ID generation query changes to PostgreSQL sequence syntax.

## Removed

*   H2 web-console behavior from the runtime path (`/database` ingress route is no longer a supported interactive console flow in this state).

## Flow Impact

*   [`F1`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/end-to-end-flows.md#f1-load-accounts-on-initial-ui-load) load accounts on UI load: unchanged behavior, now backed by PostgreSQL reads.
*   [`F2`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/end-to-end-flows.md#f2-bootstrap-trade--position-blotters) bootstrap blotters: unchanged behavior, now backed by PostgreSQL reads.
*   [`F3`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/end-to-end-flows.md#f3-submit-trade-ticket) account administration: unchanged behavior, account creation uses PostgreSQL sequence.
*   [`F4`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/end-to-end-flows.md#f4-process-trade-events) realtime blotter updates: unchanged behavior, writes/reads occur against PostgreSQL.
