Migrate from Airtable to PostgreSQL with Teable or Mathesar

Moving Airtable into a real PostgreSQL database keeps records and attachments on your servers, but there is no whole-base export, so the work is mostly schema design and re-linking. This page plans that work.

On this page

How to migrate Airtable to PostgreSQL with Teable or Mathesar

Moving Airtable bases into PostgreSQL is a schema-design and re-linking project, not a file copy. Airtable has no whole-base export, so each table is downloaded as its own CSV from a view, and those files arrive without the lookups, links, formulas and attachment identities that held the base together. Internal data or platform staff usually own the work, sometimes with an implementation partner for the schema and cutover. The effort depends mostly on how many linked tables a base has and how many attachments must keep their references, and the reader should confirm both counts for each base before estimating anything. The first decision is the target schema. Each Airtable table becomes a PostgreSQL table with a primary key, each linked-record field becomes a foreign key or a junction table, and lookup and rollup fields are usually recomputed as views rather than stored as copies. Attachments need a plan too: the CSV carries links that expire after a few hours, so the team must download the files during extraction and store them in a location they control, then update the reference column to match. Test the import on one base with a restored copy before touching production data. Teable and Mathesar play different roles once the tables exist. Teable runs on PostgreSQL and offers a spreadsheet interface with CSV import into existing tables, which suits teams that want the familiar grid, forms and automations back. Mathesar connects to an existing database and works directly with its schemas and tables, which suits teams whose PostgreSQL schema is already the system of record. Mathesar is in public beta, so confirm its readiness for production access control with your own tests. Plan a PostgreSQL version that is still supported for the length of the project, since version 14 reaches end of support in November 2026.

Which Airtable features map cleanly to PostgreSQL, and which need rework

This table compares common Airtable features with PostgreSQL tables and the Teable or Mathesar interface on top of them. Read each row as a planning note: clean maps move with little change, rework rows need redesign by hand, and gaps need a different tool or custom code. The main takeaway is that data and relationships move well, while formulas, automations and interface logic are where most of the effort sits.

Airtable featurePostgreSQL and Teable or MathesarMapping
Field types (text, number, date, single select)Typed PostgreSQL columns and Teable field types. Confirm how each select option and date format imports from your CSVs.Yes
Linked recordsForeign keys and junction tables. Linked records need an explicit parent and child design before import, and reverse links must be recreated.needs rework
AttachmentsAttachment links in Airtable expire, so files must be downloaded and stored in your own file storage, then referenced from a column. Mathesar offers a file data type to review.needs rework
Views (grid, form, kanban, calendar)Teable provides Grid, Form, Kanban, Gallery and Calendar views. Mathesar offers a spreadsheet-like table view and a form builder, so confirm kanban and calendar needs before choosing.needs rework
Formula, lookup and rollup fieldsTeable formulas run in the spreadsheet layer. Mathesar relies on SQL queries in its Data Explorer or database views, so each formula must be rewritten and tested.needs rework
Permissions and sharingMathesar uses PostgreSQL roles and privileges. Teable's standalone self-hosted edition covers collaboration, but confirm its role model against your sharing rules.needs rework
AutomationsNo importer carries Airtable Automations over. Rebuild triggers in a workflow tool or database triggers, and test each one before cutover.No
Interfaces and app builderTeable's standalone self-hosted edition excludes App Builder and AI features, so interface pages need Teable Cloud or a separate front end.No
SQL access to dataNative to PostgreSQL. Teable offers SQL query, and Mathesar's Data Explorer covers querying, so reporting becomes a database skill rather than a spreadsheet one.Yes

What PostgreSQL gives you that a spreadsheet database does not

The main gain from moving Airtable data into PostgreSQL is that the database itself enforces the data model. Primary keys, foreign keys, unique constraints and check constraints live in the schema, so a link between a customers table and an invoices table cannot point at a record that does not exist, and a required field cannot be left empty by a form, an import or a script. Airtable links are a spreadsheet feature enforced by the application. When you design the tables yourself, decide which relationships are many-to-one and which are many-to-many (usually a join table), and write those rules into the schema before the first import, so a failed import shows up as an error rather than as silent drift.

Teable is built on PostgreSQL, so its tables sit on a real PostgreSQL database that your own SQL tools can query, and its SQL query feature gives you a direct route to the same data. Mathesar works the other way round: it connects to a database you already have or sets one up, and it works with existing schemas and tables. That means the model you design is the model you keep. If you later replace Mathesar or Teable, the tables, constraints and data remain in PostgreSQL and any standard client can read them. Confirm which Teable features need a paid self-hosted license, and check which Airtable features, such as some formula, lookup and automation behavior, you will need to rebuild rather than expect to carry over.

PostgreSQL's operational controls are documented and your team can plan around them. Access can be set through authentication methods including password, GSSAPI, LDAP, certificate and OAuth, and Mathesar's access control builds on PostgreSQL roles and privileges. Hot standby servers can serve read-only queries, and synchronous or asynchronous replication is available, although PostgreSQL does not detect a failed primary or promote a standby on its own, so automatic failover needs external tools. The PostgreSQL License is permissive, so the database carries no license fee. Ask your platform team which high availability design they need before you choose a hosting setup.

What data and integrations move, and what you must rebuild

Airtable gives you no single-file base export, so the move is table by table, with attachments and automations handled separately. Each card below marks one part of the work that the PostgreSQL target makes your responsibility, from the first CSV to the last rebuilt workflow.

One CSV per table

Airtable downloads each table as its own CSV from a view, so there is no whole-base export. Export from a view that shows every field you need, and record which views filter rows out. Hidden fields and filtered records will not appear in the file, so check row counts against Airtable before you design the PostgreSQL schema. Confirm each table's row count before you start mapping columns.

Attachments need a separate download

CSV exports carry attachment references, not the files themselves. Download every attachment to your own storage, keep a mapping from each Airtable record ID and field to the stored path, and then re-link those files in PostgreSQL, for example through a file column or an external object store. Attachment links from Airtable are time-limited, so do this download early in the project, not at cutover.

Web API for complete extracts

For a complete and repeatable extract, including linked record IDs and fields that a CSV view may omit, use the Airtable Web API. Plan for Airtable's per-workspace monthly API call caps on Free and Team plans, since a full extract of a large base can consume a large share of them. Confirm your current plan's limits with Airtable before scripting the job.

Relationships rebuilt as foreign keys

Airtable linked record fields do not become PostgreSQL foreign keys on their own. Map each link to a join key, load parent tables first, and then resolve the Airtable record IDs to new primary keys. Lookup and rollup fields are calculated in Airtable, so rebuild them as SQL views or generated logic and check the results against figures in the source base.

Formulas, automations and interfaces

Airtable formulas, automations and interfaces have no importer path into Teable or Mathesar, so each one is a rebuild task. Inventory every automation, its trigger and its external calls, then decide whether it moves to a database trigger, a scheduled job or a workflow tool. Test each replacement against real records before you switch users over.

Access rules and user accounts

Airtable sharing permissions do not map to PostgreSQL roles. Mathesar bases access control on PostgreSQL roles and privileges, so define which groups read or edit each table before you import. Recreate user accounts and invitations in your identity system, since Airtable accounts and their collaborator grants will not carry over.

Migration sequence from inventory to decommissioning

This sequence moves Airtable data into PostgreSQL in controlled stages, so each table is inventoried, modeled, loaded, checked and signed off before the Airtable base is retired. Each step ends with a named output that the next step depends on.

  1. Inventory bases, tables and views

    List every base in scope, then for each table record its field types, linked-record fields, lookup, rollup and formula fields, attachment fields, and the views and filters people rely on. Name the owner of each base and the people who use its views daily. Record row counts per table from the Airtable interface. Output: an inventory register with one row per table, showing field types, dependencies, owner and row count, reviewed and signed off by the data owner.

  2. Design the PostgreSQL schema

    Turn the inventory into PostgreSQL tables. Map each Airtable table to a table, each single-select to a lookup table or a constrained column, and each linked-record field to a foreign key with a junction table where the relationship is many to many. Decide which lookups and rollups become SQL views and which formulas become generated columns or application logic. Record data types, primary keys, nullability and access roles. Output: a schema document and DDL scripts, reviewed by a database owner and the base owners.

  3. Pilot one table through CSV import

    Choose one low-risk table and export it from a view as CSV, since Airtable downloads each table separately from a view. Create the matching PostgreSQL table, then import the file through Teable's CSV import into an existing table, or through Mathesar's CSV import, where you set the delimiter to comma, tab, semicolon, colon or pipe to match the export. Check that multi-line text, dates and numbers parse as expected. Output: a pilot report listing any type mismatches, delimiter problems and the fixes applied to the schema or export settings.

  4. Re-link attachments

    Airtable CSV exports contain attachment links that expire after a few hours, so download the files while the links are still valid and store them in your own object storage or file store. Create an attachment reference table or a file column in PostgreSQL, then update each row to point to the stored file. Confirm that the file count and the total number of attachment references match the Airtable inventory. Output: an attachment manifest mapping each record and field to its stored file, with a count reconciliation signed off by the data owner.

  5. Load all tables and reconcile counts

    Import the remaining tables in dependency order, parents before children, so foreign keys resolve. After each load, compare the row count in PostgreSQL with the count recorded in the inventory, then spot-check a sample of linked records and formula results against Airtable. Reconcile any gaps before moving on. Output: a row-count reconciliation for every table and a list of exceptions, each with a recorded decision.

  6. Run a parallel period and rebuild views

    Keep Airtable as the read reference while people work in Teable or Mathesar on top of PostgreSQL. Recreate the grid, form and filtered views that the inventory listed, and test them with the users who depend on them. Record any differences in sort order, filter logic or formula output. Confirm that roles and privileges in PostgreSQL give each group only the access it needs. Output: signed-off views and a log of differences, with the owner's acceptance for each base.

  7. Cut over and operate the new database

    Freeze edits in Airtable at an agreed point, run a final incremental import of changes made after the last load, and repeat the row-count and attachment reconciliation. Point users, integrations and reports at PostgreSQL. Confirm backups of the database and attachment store, and schedule PostgreSQL minor updates. Output: a cutover record with final reconciliation results and the named owner for the database.

  8. Decommission the Airtable bases

    Once the cutover record is accepted, export a final archive of each base for retention under your policy, revoke integration tokens and API access, remove users, and downgrade or cancel the Airtable plan at the next renewal, after confirming the terms with Airtable. Remove any scheduled exports or automations that still point at Airtable. Output: a decommissioning checklist with archive locations, revoked credentials and a dated confirmation from the business owner.

How to run Airtable and the new database in parallel

A read-only freeze is the simplest approach. Airtable is set to view-only for everyone who edits data, the final export runs from a clean snapshot, and the new PostgreSQL tables and the Teable or Mathesar interface become the only place where records change. Because nothing is written to two places, there is no reconciliation to design, but the business pauses while the import, attachment re-linking and checks run.

  • User expectations: Every editor needs to know the start and end of the freeze, and any work that must continue during it needs an agreed holding process, such as a shared intake form or a paper log.
  • Permission change: Remove edit rights from Airtable collaborators at the cutover point, and confirm that API tokens and automations that write to Airtable are disabled too.
  • Snapshot discipline: Export each table as CSV from a view after the freeze begins, because Airtable has no whole-base export and the files must reflect one agreed moment.
  • Attachment links: Airtable attachment URLs expire, so download attachments during the freeze rather than relying on links taken earlier.
  • Rollback path: Keep Airtable read-only rather than deleted until the new system has been checked by its owners.

Before choosing this approach, confirm with the table owners how long the business can wait for updates and whether any integration writes to Airtable on a schedule.

What drives cost and duration in this migration

This table lists the components that move the effort of an Airtable to PostgreSQL migration up or down, why each one matters, and how to reduce it. Read it before requesting a quote, because the same scope written two ways can produce very different work.

DriverWhy it changes effortHow to keep it down
Schema designAirtable tables mix data, display and calculated fields. Each one must be mapped to a PostgreSQL column type, key or constraint, which is design work done once but needed before any import.Inventory every table and field first, drop unused fields, and agree column types and keys in writing before import starts.
Number of tables and linked relationshipsEach Airtable link becomes a foreign key or junction table. Many-to-many links and linked records spread across tables increase testing of joins and cascades.Map relationships on one diagram, consolidate duplicate tables, and test a sample of linked records before loading everything.
Attachment volumeAttachments are exported as links that expire, so files must be downloaded and stored, then re-linked to rows. Total size drives transfer time, storage, and checks.Measure attachment count and total size per table, decide on storage location early, and confirm how file links are rewritten.
Formula, lookup and automation rebuildsCSV export carries values, not logic. Formulas, rollups, lookups and automations must be rewritten as SQL views, triggers or application logic, and each needs testing.List every formula and automation, classify them as keep, simplify or retire, and ask for a per-item rebuild list in the quote.
Number of users and permission modelsAirtable permissions do not map directly to PostgreSQL roles and privileges. Each group, view restriction and external user needs a role design that Mathesar can enforce.Reduce roles to a few groups, document who can read or write each table, and confirm which access rules must survive cutover.
Hosting, backups and restore testingThe organization runs the servers, so hosting, patching, backup schedules and restore tests are ongoing costs. A backup that has not been restored is not evidence of recovery.Use one standard hosting pattern, automate backups, and schedule periodic restore tests. Ask the quote to separate setup from recurring operations.
PostgreSQL version and upgrade planningPostgreSQL 14 is listed as supported until November 12, 2026, so a fresh install should target a version with a longer support window. Later major upgrades need pg_upgrade, dump and restore, or logical replication.Choose a currently supported major version, note its end-of-support date, and ask how upgrades and rollbacks will be handled.
Internal staff timeData owners must validate records, confirm field meanings and sign off on access rules. Waiting for these reviews often extends the schedule more than technical work does.Name reviewers and their availability up front, and agree on acceptance criteria per table before work begins.

What usually goes wrong and how to prevent it

Most failures in an Airtable to PostgreSQL move come from a few predictable places: attachments, derived fields, types, access rules, the tool layer and the database version. Each card names one of these risks and the check that catches it before cutover.

Lost attachment links after expiry

Airtable attachment URLs are temporary, so a CSV export that carries only those links will break once they expire. Download every file while the base is still live, store it in your own object storage or file store, and map each file to its record ID in a column of the PostgreSQL table. Then check a sample of records by opening the stored file, not the link. Teable and Mathesar will display whatever path or URL you load, so the file copy must be verified separately.

Broken links from lookup and rollup logic

Airtable lookup and rollup fields are calculated from linked records and do not export as stored values in a CSV. If you rebuild them as plain columns, they stop updating when the source rows change. Recreate linked relationships as foreign keys between tables, then express lookups and rollups as SQL views or computed queries. Compare row counts and a set of summed totals between the Airtable view and the PostgreSQL query before you retire the base.

Data type mismatches on import

CSV export flattens types, so dates, currency, checkboxes, single-select options and multi-select values can arrive as plain text. Define each column's PostgreSQL type before import, decide how empty cells map to NULL, and check date formats and decimal separators in a test load. Mathesar imports CSV with a choice of delimiter (comma, tab, semicolon, colon or pipe), so confirm the delimiter in the file matches the setting you use. Teable's CSV import into existing tables should be tested the same way.

Permissions drift between Airtable and PostgreSQL roles

Airtable sharing is set per base, view and user, while Mathesar bases access control on PostgreSQL roles and privileges. Users who could only see one view in Airtable may gain access to the whole table after import unless grants are set on purpose. Map each Airtable permission to a role and a grant, then test each role with a real account. Mathesar can use existing PostgreSQL roles or roles created in Mathesar, so decide which source of truth your team will maintain.

Mathesar beta limits in production

Mathesar describes itself as in public beta, with version 0.12.0 tagged on July 2, 2026. Beta software can change between releases, so pin a specific version in your deployment, test upgrades in a staging copy, and keep a dated backup before each one. Confirm which features your team relies on, such as the form builder and Data Explorer, are in the release you pin. Ask the Mathesar project for its current support and upgrade expectations before you depend on it for records that must be kept.

Unplanned PostgreSQL support windows

PostgreSQL 14 is supported until November 12, 2026, so a database built on it now will need a major upgrade within a short window. Choose a major version whose support runs well past your planned go-live, and schedule the upgrade in your operations calendar at the start. Major upgrades can use pg_upgrade, a dump and restore, or logical replication, which allows a short cutover. Confirm the chosen method with a rehearsal on a copy of the data, and make sure Mathesar or Teable supports the PostgreSQL version you pick.

How the migration changes by base size and starting point

A base run by one team, with a handful of tables and no outside consumers, is the simplest case. Most of the effort sits in schema design: you export each table as CSV from a view, decide which columns become typed PostgreSQL columns, and turn Airtable link fields into foreign keys. Because one team owns the data, cutover can be a short window agreed in advance, with the team switching to the Mathesar or Teable interface once the import checks pass.

  • Schema work: Map single-select and linked-record fields to lookup tables and foreign keys, and choose data types before importing, since PostgreSQL will not infer them the way a spreadsheet does.
  • Attachments: Download attachments separately, store them in a location you control, and re-link them to the rows after import.
  • Cutover: Freeze edits in Airtable for the agreed window, run a final export, and compare row counts per table against the source.
  • Integrations: Usually few or none, so the main integration work is re-creating any Airtable automations by hand.
  • Record count: Check the base against Airtable's per-base caps on your plan first, since exporting a base near a cap may need several passes.

Before planning, confirm the record count and attachment volume for each table with your Airtable admin, so the import window reflects the real size of the base.

Operating PostgreSQL after the Airtable cutover

Once the Airtable data sits in PostgreSQL, the database becomes infrastructure you run, so the first decision is a routine for minor updates. PostgreSQL minor releases never change the internal storage format, so applying one means replacing the executables and restarting the server. Plan that restart in a maintenance window and confirm with your team which PostgreSQL package or container image Teable or Mathesar was deployed against, since both sit on top of the same server and a restart affects the spreadsheet interface too. Keep a dated record of the minor version in each environment so a security patch can be traced to a specific host.

Major versions need a plan years in advance. PostgreSQL supports each major version for five years after its initial release, and the supported list runs from 14 to 18. Version 14 is listed as supported until November 12, 2026, so a cluster created during this migration on 14 has a short runway. Check the support dates in the PostgreSQL versioning policy before you choose a version. For the upgrade itself, the documented options are a dump and restore, pg_upgrade, or logical replication. Logical replication is the option that keeps downtime to several seconds, but it needs testing against a copy of your schema, because Mathesar and Teable must still work on the new major version.

Backups need point-in-time recovery, not only nightly dumps. Continuous archiving with a base backup and archived write-ahead logs lets you restore to a moment before an accidental bulk edit from a spreadsheet interface. Test a restore into a separate host at least once per quarter and record how long it took. Hot standby servers can serve read-only queries, and synchronous or asynchronous replication are both available, but PostgreSQL does not detect a failed primary or promote a standby by itself, so automatic failover needs an external tool that you select, deploy and test. Ask your provider or internal team who owns that tool and how it is exercised. Add PgBouncer when the count of connections from Teable, Mathesar and any integrations starts to crowd the server, and confirm the pooling mode against each application's requirements before rollout.

Questions buyers ask before migrating Airtable to PostgreSQL

What drives the cost of migrating Airtable to PostgreSQL?

The cost is driven by how much schema design the team must do, how many tables and linked records need re-linking, and how many attachments must be moved and reattached. Airtable exports each table as its own CSV from a view, so a base with many tables means many exports, mapping steps and import checks. Costs recur only where you run the infrastructure: PostgreSQL hosting, backups, patching and the Teable or Mathesar server. Ask any provider to split the quote into one-time design and migration work and recurring operations, and to state which Airtable formulas, lookups and rollups will be rebuilt in SQL or in the interface layer.

How long does an Airtable to PostgreSQL migration usually take?

Duration depends on the number of bases and tables, the complexity of the relationships, the volume of attachments and how many automations and views must be rebuilt. No duration figure is given here, so ask for a timeline tied to a written scope that lists tables, record counts and attachment volumes. Teams that already document their Airtable schema, field types and link fields usually shorten the design phase, because the PostgreSQL model has to be decided before any data is imported.

What does the internal team need to provide for the migration?

The internal team should provide a named business owner for each base, access to the Airtable workspace with rights to export views, and someone who can approve the target schema. You also need a PostgreSQL environment inside your own infrastructure, with the operations skills to run backups, restores and version upgrades. PostgreSQL 14 is listed as supported until November 12, 2026, while 18 is supported until November 14, 2030, so the team should choose a version that will still be supported when the system goes live.

Can one internal team migrate Airtable to PostgreSQL alone?

A capable team with SQL and PostgreSQL experience can do it alone for a small number of bases with simple relationships. Larger estates usually need schema design, data cleaning, attachment handling and access rule mapping done in parallel, which strains one team. Ask whether the vendor or partner will take fixed-scope work for the schema and import, leaving your staff to own operations. DeployOpen plans, implements and documents self-hosted platforms in the client's own infrastructure, and most engagements are fixed-scope with deliverables agreed in writing before work starts.

Should we choose Teable or Mathesar on top of PostgreSQL?

Choose Teable if your users want a full collaborative grid with views, forms, automations and an API, and you accept the AGPL-3.0 community edition and its paid license-key features. Choose Mathesar if you want a PostgreSQL-first interface licensed under GPLv3, with access control based on PostgreSQL roles and privileges. Mathesar 0.12.0 was tagged on July 2, 2026 and describes itself as in public beta, so confirm its maturity against your own requirements. Teable's self-hosted Business admin panel is described on its pricing page, so verify which capabilities you need.

How are Airtable attachments handled during the move?

Airtable does not provide a whole-base export, and attachment links from its API expire after a short period, so attachments must be downloaded deliberately and stored in a location you control. Plan where files will live, such as a file storage service in your own infrastructure, and how each attachment record will point to its stored file. Mathesar offers a file data type, and Teable supports import and export, but confirm how each handles attachment fields before committing to a design. Test with a sample of large and multi-file records first.

What happens to Airtable automations after the move?

Airtable automations do not carry over in any import, so each trigger and action must be rebuilt. Where they run on the database, you will need to design triggers, scheduled jobs or application logic in your own environment, and test each one against copied data before cutover. Keep a written inventory of every automation, its owner and its downstream effects. Automations that send email or update other systems also need credentials and permissions reviewed as part of the migration.

How DeployOpen scopes and runs an Airtable to PostgreSQL migration

DeployOpen plans, implements, integrates, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure. For this migration, we start from an inventory of your Airtable tables, views, links and attachments, then agree in writing which PostgreSQL schema, Teable or Mathesar interface, and handover materials are in scope before any data moves.

How we scope

  • Inventory every base, table, linked field and attachment column, and record which views people rely on day to day
  • Agree in writing which tables move, which PostgreSQL target and interface (Teable or Mathesar) apply, and what stays out of scope
  • Confirm the hosting location, PostgreSQL version, and roles that will own the data before the work is scheduled

How we build

  • Design PostgreSQL tables, keys and foreign keys from the exported CSV structure, and document each mapping decision
  • Export each table as CSV from a view, then load and check row counts and linked-record references against the source
  • Re-link attachments to their records and test that spreadsheet views, filters and access rules behave as agreed

How we hand over

  • Deliver the schema, data dictionary, import scripts and a list of Airtable formulas, automations and interfaces that were rebuilt or retired
  • Document role-based access in PostgreSQL, including which roles Mathesar or Teable use and who approves changes
  • Run a walkthrough with the owners of each table so they can verify their data and operate the new interface

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, agreed separately from the migration scope
  • Plan PostgreSQL minor updates and major upgrades against the community support window, confirmed with your team before each change
  • Keep backup and recovery procedures documented and tested for the database that now holds your former Airtable data

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.