alexcinovoj.devby TechTide AI
Back to Airtable notes
Pattern · Airtable workflow examples

Mapping Airtable fields to PostgreSQL

When PostgreSQL is the chosen destination, I document each field mapping before import. Links, formulas, rollups, attachments, and time zones need deliberate handling. A text export alone does not preserve those meanings.

Reference example

I use this reference example to explain the method and checks to try. It includes no client names, schemas, data, or reported results.

Short answer

How do I map Airtable fields to PostgreSQL?

When PostgreSQL is the chosen destination, I document each field mapping before import. Links, formulas, rollups, attachments, and time zones need deliberate handling.

Method

  • Map each field type using the table below and record any deviation with a reason.
  • Promote single and multiple select fields to lookup tables or enums rather than free text.
  • Store attachments in object storage and keep a row with URL, checksum, and content type.
  • Preserve timezone information on every date-time field; Airtable's display timezone is not the stored value.
  • Convert formula fields to generated columns or views, never to static values.
Field type mapping
Airtable field        ->  PostgreSQL
------------------------------------------------------------
Single line text      ->  text
Long text             ->  text
Number (integer)      ->  bigint
Number (decimal)      ->  numeric(precision, scale)
Currency              ->  numeric(14,2) + currency code column
Percent               ->  numeric(5,4)
Checkbox              ->  boolean not null default false
Date                  ->  date
Date with time        ->  timestamptz
Single select         ->  enum or lookup table + fk
Multiple select       ->  join table
Collaborator          ->  fk to users
Link to another record->  fk (1:n) or join table (n:m)
Lookup                ->  view or generated column
Rollup                ->  aggregate view
Formula               ->  generated column or view
Attachment            ->  object storage + attachments table
Barcode / URL / email ->  text with check constraint
Autonumber            ->  identity column (keep original as a column)
Created / modified    ->  timestamptz with trigger

What can go wrong

  • Floating-point storage can introduce rounding differences in currency values.
  • A timestamp without time zone does not preserve the original offset.
  • Comma-joined multiple-select values lose their relational structure.

Checks to try

  • Round-trip a sample of each field type and compare normalised values.
  • Check constraints reject the malformed values the old base tolerated.

Questions this pattern answers

How do I map Airtable fields to PostgreSQL?

When PostgreSQL is the chosen destination, I document each field mapping before import. Links, formulas, rollups, attachments, and time zones need deliberate handling.

What steps does this method use?

Map each field type using the table below and record any deviation with a reason. Promote single and multiple select fields to lookup tables or enums rather than free text. Store attachments in object storage and keep a row with URL, checksum, and content type. Preserve timezone information on every date-time field; Airtable's display timezone is not the stored value. Convert formula fields to generated columns or views, never to static values.

How can I check the result?

Round-trip a sample of each field type and compare normalised values. Check constraints reject the malformed values the old base tolerated.

What can go wrong with this approach?

Floating-point storage can introduce rounding differences in currency values. A timestamp without time zone does not preserve the original offset. Comma-joined multiple-select values lose their relational structure.

Related patterns

Related projects

I explain this method here. The Airtable Rescue Decision Sprint can recommend staying, repairing, connecting tools, or migration. TechTide AI publishes current scope, prices, and terms.

Airtable Rescue Decision Sprint at TechTide AI