HubSpot and Postgres integration
Whalesync keeps HubSpot and your Postgres database in two-way sync, with no pipeline code. Rows in your tables fill HubSpot properties, and CRM records land in tables your app can query.
What you can do with HubSpot and Postgres
See which customers are outgrowing their plan
Your app's accounts table already knows each gym's plan, how many members it has, and when its staff last signed in. Sync it to HubSpot companies, with those columns set to flow one way into custom properties you create. Account managers spot the gyms near their plan's limit from the company record, and the figures follow the database after each pass Whalesync makes over the table.
Build onboarding lists from the users table
Your app records how far each new user has gotten with setup in a setup_step enum. Sync users to HubSpot contacts, and map the enum to a dropdown whose options carry the same labels; the row's gym_id becomes the contact's company. An active list per step picks up its contacts, so marketing writes the emails for each stage in HubSpot while the database decides who is at which.
Join closed deals to billing in SQL
Sync HubSpot deals into a deals table whose company_id points at the same accounts table your app writes, and closed-won revenue sits next to invoices and usage, ready for one query. HubSpot tells Whalesync when a deal's stage or amount changes, so those reach the table within seconds. Create amount yourself as a numeric column: one Whalesync creates for a currency field is a real, which rounds large figures.
Show customers their open tickets inside your app
Sync HubSpot tickets into a support_tickets table, each linked to its gym's row in the accounts table through the ticket's company. Your app's help page reads the table and lists a customer's open tickets, with no calls to HubSpot's API. When support moves a ticket to Closed, HubSpot notifies Whalesync, and the row changes within seconds.
Everything that syncs
Each card is something you can sync between HubSpot and Postgres.
-
Contacts Two-way
-
Companies Two-way
-
Deals Two-way
-
Tickets Two-way
-
Tasks Two-way
-
Notes Two-way
-
Meetings Two-way
-
Quotes Two-way
-
Line Items Two-way
-
Products Two-way
-
Taxes Two-way
-
Appointments Two-way
-
Custom Objects Two-way
-
Calls Into Postgres
-
Emails Into Postgres
-
Communications Into Postgres
-
All Tables Two-way
Just need a copy of HubSpot in Postgres?
Live Export keeps a one-way copy of your HubSpot data in Postgres, on a schedule, for the reports, pivot tables, and dashboards that only read it. It's on every plan, with a record allowance of its own.
-
Two-way sync
Best when your team works in both apps, and an edit in either belongs in the other.
- Maps fields between tables you choose, in HubSpot and Postgres
- Picks changes up by itself, with no schedule to set
- Counts toward your plan's records in sync
-
Live Export
Best when you only read HubSpot data in Postgres, and nothing you change there should go back.
- Creates a table for each HubSpot table you pick, in the database you connect
- Runs daily, hourly, or every 10 minutes, depending on your plan, and whenever you click Run now
- Writes only what changed on each run, over any edits to what it copied
- Copies Contacts, Companies, Deals, Tickets, Line Items, Products, Quotes, Notes, Tasks, Emails, Calls, Meetings, Communications, Appointments, Services, Leads, and your custom objects
How to sync HubSpot and Postgres
Step 1: Create the sync
Open Whalesync, start a New sync, and choose Postgres and HubSpot.
Step 2: Connect your Postgres database
Paste a connection URI for a database role that can read and write the tables you plan to sync, then choose the schema Whalesync should work in. If the database accepts only known addresses, allowlist Whalesync's IP, 34.66.3.22, before you connect. Whalesync switches to SSL by itself when the server asks for it.
Step 3: Authorize HubSpot
Sign in through the HubSpot connector and pick the account whose records you'll sync.
Step 4: Get both sides ready
Every Postgres table needs one ID column Whalesync can rely on: a primary key with a generated default, such as serial or gen_random_uuid(). If a table has none, Whalesync flags it and offers to add a whalesync_postgres_id column. Whalesync can create new tables in the schema for HubSpot objects, but it can't add HubSpot properties, so create any custom property you'll fill from Postgres first, and give each dropdown the same options as the column it pairs with. For deal amounts, create a numeric column yourself.
Step 5: Map tables and fields
Pair each table with a HubSpot object, such as accounts with Companies and users with Contacts. Automap asks an AI model to pair fields by their names and types, without reading any records; review its pairs and map the rest by hand. Map a foreign key to an association, and include the table it points at in the sync. Set the columns your app owns, like usage figures, to sync one way into HubSpot. Once the sync runs, don't rename a synced table or column, since Whalesync loses track of it.
Step 6: Match records that already exist, then activate
If records already exist on both sides, pick one field to match them on, such as email for contacts or domain for companies. Matching is exact, case and spaces included. Whalesync previews how many records it will create in each app, and then you turn the sync on.
3 ways to connect HubSpot and Postgres
-
HubSpot Data Out for PostgreSQL
Best when you have Data Hub Enterprise and need a read-only copy of HubSpot in Postgres for reporting, refreshed a few times a day.
- Built by HubSpot, and in beta: a Super Admin opts in through the Data Studio beta (HubSpot)
- Needs Data Hub Enterprise
- One way: each run replaces HubSpot-managed tables with a full snapshot, at most every 6 hours during the beta
-
Zapier
Best when a single event should set off a few steps in one direction, such as a HubSpot contact for each new row in a signups table.
- Postgres triggers fire on a new or updated row; HubSpot's on new deals, contacts, and property changes
- PostgreSQL is a premium app, which Zapier's free plan leaves out (Zapier)
- Each Zap runs one way: Zapier doesn't support two-way syncing
-
Whalesync
Best when product data should reach HubSpot records, and CRM edits should land back in your own tables, with no code to keep running.
- Each column syncs both ways or one way, your choice per field
- Associations become foreign keys, and foreign keys become associations
- Cost follows the records in sync, not the number of updates
HubSpot Data Out for PostgreSQL and Zapier checked against their own pages in November 2026.
Frequently asked questions
How do I keep HubSpot in sync with our own Postgres database?
Use a sync that writes both ways and understands your tables' keys. Whalesync pairs each Postgres table with a HubSpot object, writes HubSpot changes into your rows and row changes into HubSpot, and turns associations into foreign keys. HubSpot's own Data Out copies HubSpot into Postgres one way, on Data Hub Enterprise, and Zapier moves single events.
Can I fill HubSpot properties from Postgres columns?
Yes. Map a column to a property and set that field to sync one way, so the database stays in charge of it. Whalesync can't create HubSpot properties, so add them in HubSpot first. A dropdown takes only the options it has: a value it doesn't know clears the property, so give it the same options as the column.
Do HubSpot associations sync to Postgres foreign keys?
Yes, both ways, when the table the key points at is in the same sync. A foreign key column holds one link, so a contact with several companies keeps the first. For many, use an array column named <label>_fk_<Table>, as the Postgres docs describe.
What happens to a Postgres row when a HubSpot record is deleted?
Whalesync deletes the row. Going the other way, a row has to be missing from three passes in a row before Whalesync treats it as deleted, and then it archives the record in HubSpot. Turn on Delete Protection for a table to stop deletes from reaching it.
How quickly do HubSpot edits reach Postgres?
It depends on the property. HubSpot notifies Whalesync when core properties change on contacts, companies, deals, and tickets, such as a deal's stage or amount, and those reach Postgres within seconds. Custom properties and other objects wait for Whalesync's next pass over HubSpot, with a two-minute pause after each. Postgres sends no notifications, so a row change reaches HubSpot on the next read of its table, which takes longer the more rows you sync.
Can I copy HubSpot into Postgres one way, for reporting?
Yes. Live Export creates a Postgres table for each HubSpot table you pick, custom objects included, and refreshes them daily, hourly, or every 10 minutes depending on your plan, writing only what changed. Nothing written to those tables goes back to HubSpot; the two-way sync is for when Postgres should update HubSpot too.