> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL

> Resources, examples, configuration and evidence for PostgreSQL.

Use the `@bijection/connectors/postgres` entrypoint to declare PostgreSQL resources.

## Availability

This page describes the pinned source package. Published availability is unestablished for this artifact. [Source build and package availability](https://docs.bijection.com/client/sdk-distribution.md).

## Resources and modes

| Resource | Mode | Description |
| - | - | - |
| Database | `cdc` | cdc |

Declare a resource in application code, then bind deployment-specific settings and credentials. See [typed resources](https://docs.bijection.com/integrations/resources.md), [connections](https://docs.bijection.com/integrations/connections.md) and [source inspection](https://docs.bijection.com/integrations/cli.md).

## Database

### cdc: cdc

The following example matches configuration `standard`.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { postgres } from "@bijection/connectors/postgres";
import { v } from "bijection/values";

export const resource = postgres.database.cdc({
  tables: {
    orders: { id: v.string(), total: v.number() },
    lines: { id: v.string(), order_id: v.string() },
  },
});
```

> **Inferred record types**
>
> ```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> orders: {
>   "id": string;
>   "total": number;
> }
>
> lines: {
>   "id": string;
>   "order_id": string;
> }
> ```

#### Configuration: standard

Case: `postgres/database/cdc/standard`.

Connection and resource configuration are declared by this exact case.

Credential kind: `postgres`. Keep credential material in the private credential inventory.

| Setting | Type | Required | Owner |
| - | - | - | - |
| `host` | string | Yes | Shared connection |
| `port` | number | Yes | Shared connection |
| `database` | string | Yes | Shared connection |
| `publication` | string | Yes | Resource binding |
| `relations` | record of object | Yes | Resource binding |

> **Complete configuration contract**
>
> ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "setup": [],
>   "resource": {
>     "access": {},
>     "defaults": {},
>     "connector": "postgres",
>     "output": {
>       "kind": "group",
>       "collections": [
>         "lines",
>         "orders"
>       ]
>     },
>     "credential_kind": "postgres",
>     "connection_fields": [
>       "host",
>       "port",
>       "database"
>     ]
>   },
>   "connection_setup": {
>     "type": "object",
>     "value": {
>       "host": {
>         "fieldType": {
>           "type": "string"
>         },
>         "optional": false
>       },
>       "port": {
>         "fieldType": {
>           "type": "number"
>         },
>         "optional": false
>       },
>       "database": {
>         "fieldType": {
>           "type": "string"
>         },
>         "optional": false
>       },
>       "publication": {
>         "fieldType": {
>           "type": "string"
>         },
>         "optional": false
>       },
>       "relations": {
>         "fieldType": {
>           "type": "record",
>           "keys": {
>             "type": "string"
>           },
>           "values": {
>             "fieldType": {
>               "type": "object",
>               "value": {
>                 "schema": {
>                   "fieldType": {
>                     "type": "string"
>                   },
>                   "optional": false
>                 },
>                 "table": {
>                   "fieldType": {
>                     "type": "string"
>                   },
>                   "optional": false
>                 }
>               }
>             },
>             "optional": false
>           }
>         },
>         "optional": false
>       }
>     }
>   },
>   "execution": null
> }
> ```

Native admission analysis is available for this exact declaration.

**Collection: lines**

| Contract | Meaning |
| - | - |
| Initial | Pinned snapshot |
| Changes | Complete change feed under the declared contract |
| Deletions | Explicit deletion evidence |
| Resume | Provider source position |
| Gap | Explicit repair required after a gap |
| Retention | Unspecified |

> **Complete native profile**
>
> ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "movement": {
>     "exchanges": {},
>     "nativeInputLimitBytes": "0",
>     "steps": [
>       {
>         "id": "acquire.1",
>         "inputs": [],
>         "action": {
>           "operation": "acquire",
>           "subject": "native input",
>           "limitBytes": "0"
>         }
>       },
>       {
>         "id": "retain.1",
>         "inputs": [
>           "acquire.1"
>         ],
>         "action": {
>           "operation": "retain",
>           "subject": "acquisition evidence",
>           "reason": "recovery",
>           "release": "acquisition_custody"
>         }
>       },
>       {
>         "id": "interpret.1",
>         "inputs": [
>           "retain.1"
>         ],
>         "action": {
>           "operation": "interpret",
>           "subject": "acquired input",
>           "produces": "records"
>         }
>       },
>       {
>         "id": "materialize.1",
>         "inputs": [
>           "interpret.1"
>         ],
>         "action": {
>           "operation": "materialize",
>           "subject": "source rows",
>           "reason": "serving",
>           "release": "replacement"
>         }
>       },
>       {
>         "id": "publish.1",
>         "inputs": [
>           "materialize.1"
>         ],
>         "action": {
>           "operation": "publish",
>           "subject": "source rows",
>           "visibility": "with_acquisition"
>         }
>       }
>     ]
>   },
>   "initial": "pinned_snapshot",
>   "changes": "complete_feed",
>   "deletions": "explicit_events",
>   "resume": "source_position",
>   "retentionMs": null,
>   "gap": "explicit_repair",
>   "limits": {
>     "columns_per_table": "256",
>     "complete_input_hard_bytes": "137438953472",
>     "exchange_evidence_bytes": "524288",
>     "prepared_hard_bytes": "137438953472",
>     "prepared_rows_hard": "1073741824",
>     "selected_tables": "100",
>     "transaction_wire_hard_bytes": "268435456"
>   },
>   "restrictions": [
>     "Input and preparation must fit operator-configured custody quotas; hard ceilings do not establish measured capacity",
>     "Serial pgoutput protocol 1; source schema changes require an explicit baseline and stable key identity"
>   ],
>   "commands": {}
> }
> ```

**Collection: orders**

| Contract | Meaning |
| - | - |
| Initial | Pinned snapshot |
| Changes | Complete change feed under the declared contract |
| Deletions | Explicit deletion evidence |
| Resume | Provider source position |
| Gap | Explicit repair required after a gap |
| Retention | Unspecified |

> **Complete native profile**
>
> ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "movement": {
>     "exchanges": {},
>     "nativeInputLimitBytes": "0",
>     "steps": [
>       {
>         "id": "acquire.1",
>         "inputs": [],
>         "action": {
>           "operation": "acquire",
>           "subject": "native input",
>           "limitBytes": "0"
>         }
>       },
>       {
>         "id": "retain.1",
>         "inputs": [
>           "acquire.1"
>         ],
>         "action": {
>           "operation": "retain",
>           "subject": "acquisition evidence",
>           "reason": "recovery",
>           "release": "acquisition_custody"
>         }
>       },
>       {
>         "id": "interpret.1",
>         "inputs": [
>           "retain.1"
>         ],
>         "action": {
>           "operation": "interpret",
>           "subject": "acquired input",
>           "produces": "records"
>         }
>       },
>       {
>         "id": "materialize.1",
>         "inputs": [
>           "interpret.1"
>         ],
>         "action": {
>           "operation": "materialize",
>           "subject": "source rows",
>           "reason": "serving",
>           "release": "replacement"
>         }
>       },
>       {
>         "id": "publish.1",
>         "inputs": [
>           "materialize.1"
>         ],
>         "action": {
>           "operation": "publish",
>           "subject": "source rows",
>           "visibility": "with_acquisition"
>         }
>       }
>     ]
>   },
>   "initial": "pinned_snapshot",
>   "changes": "complete_feed",
>   "deletions": "explicit_events",
>   "resume": "source_position",
>   "retentionMs": null,
>   "gap": "explicit_repair",
>   "limits": {
>     "columns_per_table": "256",
>     "complete_input_hard_bytes": "137438953472",
>     "exchange_evidence_bytes": "524288",
>     "prepared_hard_bytes": "137438953472",
>     "prepared_rows_hard": "1073741824",
>     "selected_tables": "100",
>     "transaction_wire_hard_bytes": "268435456"
>   },
>   "restrictions": [
>     "Input and preparation must fit operator-configured custody quotas; hard ceilings do not establish measured capacity",
>     "Serial pgoutput protocol 1; source schema changes require an explicit baseline and stable key identity"
>   ],
>   "commands": {}
> }
> ```

> **Commands, occurrences and artifacts**
>
> ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "records": {
>     "lines": {
>       "protocol": "transactional_feed",
>       "coverage": "committed_prefix",
>       "consistency": "snapshot",
>       "atomicity": "source_transaction",
>       "history": "complete_changes",
>       "recordRefresh": false,
>       "reconciliation": false,
>       "notifications": false,
>       "snapshotMaxRows": null,
>       "profile": {
>         "movement": {
>           "exchanges": {},
>           "nativeInputLimitBytes": "0",
>           "steps": [
>             {
>               "id": "acquire.1",
>               "inputs": [],
>               "action": {
>                 "operation": "acquire",
>                 "subject": "native input",
>                 "limitBytes": "0"
>               }
>             },
>             {
>               "id": "retain.1",
>               "inputs": [
>                 "acquire.1"
>               ],
>               "action": {
>                 "operation": "retain",
>                 "subject": "acquisition evidence",
>                 "reason": "recovery",
>                 "release": "acquisition_custody"
>               }
>             },
>             {
>               "id": "interpret.1",
>               "inputs": [
>                 "retain.1"
>               ],
>               "action": {
>                 "operation": "interpret",
>                 "subject": "acquired input",
>                 "produces": "records"
>               }
>             },
>             {
>               "id": "materialize.1",
>               "inputs": [
>                 "interpret.1"
>               ],
>               "action": {
>                 "operation": "materialize",
>                 "subject": "source rows",
>                 "reason": "serving",
>                 "release": "replacement"
>               }
>             },
>             {
>               "id": "publish.1",
>               "inputs": [
>                 "materialize.1"
>               ],
>               "action": {
>                 "operation": "publish",
>                 "subject": "source rows",
>                 "visibility": "with_acquisition"
>               }
>             }
>           ]
>         },
>         "initial": "pinned_snapshot",
>         "changes": "complete_feed",
>         "deletions": "explicit_events",
>         "resume": "source_position",
>         "retentionMs": null,
>         "gap": "explicit_repair",
>         "limits": {
>           "columns_per_table": "256",
>           "complete_input_hard_bytes": "137438953472",
>           "exchange_evidence_bytes": "524288",
>           "prepared_hard_bytes": "137438953472",
>           "prepared_rows_hard": "1073741824",
>           "selected_tables": "100",
>           "transaction_wire_hard_bytes": "268435456"
>         },
>         "restrictions": [
>           "Input and preparation must fit operator-configured custody quotas; hard ceilings do not establish measured capacity",
>           "Serial pgoutput protocol 1; source schema changes require an explicit baseline and stable key identity"
>         ],
>         "commands": {}
>       }
>     },
>     "orders": {
>       "protocol": "transactional_feed",
>       "coverage": "committed_prefix",
>       "consistency": "snapshot",
>       "atomicity": "source_transaction",
>       "history": "complete_changes",
>       "recordRefresh": false,
>       "reconciliation": false,
>       "notifications": false,
>       "snapshotMaxRows": null,
>       "profile": {
>         "movement": {
>           "exchanges": {},
>           "nativeInputLimitBytes": "0",
>           "steps": [
>             {
>               "id": "acquire.1",
>               "inputs": [],
>               "action": {
>                 "operation": "acquire",
>                 "subject": "native input",
>                 "limitBytes": "0"
>               }
>             },
>             {
>               "id": "retain.1",
>               "inputs": [
>                 "acquire.1"
>               ],
>               "action": {
>                 "operation": "retain",
>                 "subject": "acquisition evidence",
>                 "reason": "recovery",
>                 "release": "acquisition_custody"
>               }
>             },
>             {
>               "id": "interpret.1",
>               "inputs": [
>                 "retain.1"
>               ],
>               "action": {
>                 "operation": "interpret",
>                 "subject": "acquired input",
>                 "produces": "records"
>               }
>             },
>             {
>               "id": "materialize.1",
>               "inputs": [
>                 "interpret.1"
>               ],
>               "action": {
>                 "operation": "materialize",
>                 "subject": "source rows",
>                 "reason": "serving",
>                 "release": "replacement"
>               }
>             },
>             {
>               "id": "publish.1",
>               "inputs": [
>                 "materialize.1"
>               ],
>               "action": {
>                 "operation": "publish",
>                 "subject": "source rows",
>                 "visibility": "with_acquisition"
>               }
>             }
>           ]
>         },
>         "initial": "pinned_snapshot",
>         "changes": "complete_feed",
>         "deletions": "explicit_events",
>         "resume": "source_position",
>         "retentionMs": null,
>         "gap": "explicit_repair",
>         "limits": {
>           "columns_per_table": "256",
>           "complete_input_hard_bytes": "137438953472",
>           "exchange_evidence_bytes": "524288",
>           "prepared_hard_bytes": "137438953472",
>           "prepared_rows_hard": "1073741824",
>           "selected_tables": "100",
>           "transaction_wire_hard_bytes": "268435456"
>         },
>         "restrictions": [
>           "Input and preparation must fit operator-configured custody quotas; hard ceilings do not establish measured capacity",
>           "Serial pgoutput protocol 1; source schema changes require an explicit baseline and stable key identity"
>         ],
>         "commands": {}
>       }
>     }
>   },
>   "occurrences": null,
>   "artifacts": {
>     "raw_archive": false,
>     "native_file_transfer_limit_bytes": null,
>     "external_versions": false,
>     "files": {}
>   },
>   "commands": {}
> }
> ```

**Recorded checks**

| Requirement | Scope | Evidence | Result |
| - | - | - | - |
| change-history-gap | \{"kind":"collection","name":"lines"} | Native test: integrations/connectors/postgres\_health\_observes\_wal\_without\_releasing\_blocked\_acquisition (shared\_engine) | Execution result unavailable |
| page-publication-recovery | \{"kind":"collection","name":"lines"} | Native test: integrations/connectors/postgres\_publication\_survives\_source\_loss\_after\_capture (shared\_engine) | Execution result unavailable |
| change-history-gap | \{"kind":"collection","name":"orders"} | Native test: integrations/connectors/postgres\_health\_observes\_wal\_without\_releasing\_blocked\_acquisition (shared\_engine) | Execution result unavailable |
| page-publication-recovery | \{"kind":"collection","name":"orders"} | Native test: integrations/connectors/postgres\_publication\_survives\_source\_loss\_after\_capture (shared\_engine) | Execution result unavailable |
| group-publication-recovery | \{"kind":"group"} | No retained check covers this scoped postgres requirement. | Execution result unavailable |

Hosted qualification: **unestablished for this catalog configuration**. Installed connections report their own identity, authority and current status.

## Provider guidance

Compiled declaration examples and configuration details are published in the [connector reference](https://docs.bijection.com/integrations/connectors/index).

The connection owns `host`, `port` and `database`; the credential is a
`postgres` credential (`postgres.credential(name)`). The tables of one database
resource share one acquisition owner: one consistent initial snapshot, then
committed transactions from logical replication, published atomically across
the coupled tables. A lost replication history blocks acquisition rather than
silently resuming.

The PostgreSQL protocol is native; this connector declares tables and setup,
and the engine owns replication, snapshot handoff and recovery.

## Provider references

Provider references and prerequisites are maintained in the connector guidance above. No separate provider-documentation review date is recorded.

## Source and evidence

[Canonical connector source](https://github.com/bijectionhq/component-support/blob/b632604330ce9cbcfe17a5a680ef4fbe80f6f672/packages/connectors/src/connectors/postgres/README.md), [native analysis](https://github.com/bijectionhq/component-support/blob/b632604330ce9cbcfe17a5a680ef4fbe80f6f672/packages/connectors/contract-analysis.json) and [check receipts](https://github.com/bijectionhq/component-support/blob/b632604330ce9cbcfe17a5a680ef4fbe80f6f672/packages/connectors/evidence.json).

Connector artifact: `905888ea276a2a28e36981a79e8142b2547ea451c3e63162cb6915ad4a7d1305`.

The resource declaration examples above are compiled and compared with exact catalog declarations. Recorded checks apply only to their source, declaration and runtime identities. Configure a connection and inspect its status to establish deployment-specific readiness.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.