Convert Microsoft Access database into Postgresql DDL statements using DAOs (Database Access Objects).

GitHub Repository: ms_access2pg_dump


Creates PostgreSQL dump file to recreate basic table datamodel. Handles:

  • Conversion of MS Access data types to PostgreSQL data types.
  • Conversion of MS Access default values to PostgreSQL default values.
  • Not null constraints.
  • Column validation Rules (column check constraints).
  • Table validation Rules (table check constraints).
  • Primary key contraints.

note: check constraints may contain MS Acess specific functions and syntax which must be manually converted to PostgreSQL equivalents.

note: Boolean fields will default to false (if a default value is not specfied) and will enforce not null constraints.

note: Autonumber fields will enforce a not null constraint and will adopted the integer PostgreSQL data type.


Creates PostgreSQL dump file to recreate indexes.


Creates PostgreSQL dump file to recreate foreign key constraints.

note: If you MS Access Database performs case insenstive string matching you may have to sanitise your data before you are able to recreate foreign keys in PostgreSQL.


Creates PostgreSQL dump file to create sequences for MS Access autonumber fields and set default values.

note: Sequences will be initialised to the max value of the autonumber field + 1.


Creates PostgreSQL dump file to load record data

Based on Reverse engineer MS Access/Jet databases (Python recipe) by M.Keranen [07/12/2000].