> For the complete documentation index, see [llms.txt](https://docs.whalesync.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.whalesync.com/sync/connectors/postgres.md).

# Postgres

Two-way sync Postgres tables with Airtable, Notion, Google Sheets, and more. Covers setup requirements, primary keys, supported field types, and tips.

## Supported Fields

<table><thead><tr><th>Field</th><th>Status</th></tr></thead><tbody><tr><td>🏷️ Array</td><td>✅ Supported</td></tr><tr><td>#️⃣ Bigint</td><td>✅ Supported</td></tr><tr><td>📝 Bit</td><td>✅ Supported</td></tr><tr><td>☑️ Boolean</td><td>✅ Supported</td></tr><tr><td>📝 Composite</td><td>➡️ Supported (1-Way)</td></tr><tr><td>📅 Date</td><td>✅ Supported</td></tr><tr><td>📅 Daterange</td><td>➡️ Supported (1-Way)</td></tr><tr><td>🔗 Domain</td><td>➡️ Supported (1-Way)</td></tr><tr><td>🔘 Enum</td><td>✅ Supported</td></tr><tr><td>🖇️ Foreign Key</td><td>✅ Supported</td></tr><tr><td>#️⃣ Geometric</td><td>➡️ Supported (1-Way)</td></tr><tr><td>#️⃣ Integer</td><td>✅ Supported</td></tr><tr><td>#️⃣ Interval</td><td>➡️ Supported (1-Way)</td></tr><tr><td>🗃️Json</td><td>✅ Supported</td></tr><tr><td>💱 Money</td><td>✅ Supported</td></tr><tr><td>📝 Network</td><td>✅ Supported</td></tr><tr><td>#️⃣ Numeric</td><td>✅ Supported</td></tr><tr><td>⏱️ Range</td><td>➡️ Supported (1-Way)</td></tr><tr><td>📝 Text</td><td>✅ Supported</td></tr><tr><td>📝 Textsearch</td><td>➡️ Supported (1-Way)</td></tr><tr><td>⏱️ Time</td><td>➡️ Supported (1-Way)</td></tr><tr><td>⏱️ Timestamp</td><td>✅ Supported</td></tr><tr><td>🆔 Uuid</td><td>✅ Supported</td></tr><tr><td>🗃️ XML</td><td>✅ Supported</td></tr><tr><td>Binary</td><td>✖️ Not Yet</td></tr></tbody></table>

## Things to Keep in Mind <a href="#h_bccce14d8a" id="h_bccce14d8a"></a>

### During Setup

> [!WARNING]
> **All Postgres tables must have a primary key**\
> We use the primary key to keep your data in sync. See [Postgres snippets](https://docs.whalesync.com/sync/connectors/postgres/primary-key-snippets.md) for additional detail.

> [!WARNING]
> **Primary keys must be auto-generated**\
> Make sure your primary keys are generated by your database (i.e. have a default value). See [Postgres snippets](https://docs.whalesync.com/sync/connectors/postgres/primary-key-snippets.md) for additional detail.

> [!WARNING]
> **Double-check that the Postgres account you use with Whalesync has access** **to the tables you want to map.**

### After Setup

> [!CAUTION]
> **Renaming schema, tables, or columns will break Whalesync mappings**\
> If you rename a table or column, you'll need to remap the impacted table/column in Whalesync. Note - remapping an impacted table will lead to duplicates unless you reset your data as well.&#x20;

### **Handy Tips**

> [!NOTE]
> **We support foreign keys (including two-way sync)!**\
> Make sure to map both tables and reach out for help if not sure how to set it up.

> [!NOTE]
> **Adding ".html" or "\_html" to the end of a column name will preserve HTML**\
> If you name a Postgres column something such as "text\_html", Whalesync will preserve that column's values as HTML while syncing.
