spanner-migration-tool icon indicating copy to clipboard operation
spanner-migration-tool copied to clipboard

Fix treatment of Postgres INHERITS clause when using pg_dump

Open nevinheintze opened this issue 4 years ago • 0 comments

Starting with version 9.5, PostgreSQL supports an INHERITS clause: see https://www.postgresql.org/docs/9.5/ddl-inherit.html.

HarbourBridge handles this correctly when using direct database access i.e. when using driver=postgres.

However, pg_dump support is broken. For example running:

pg_dump ... | $GOPATH/bin/harbourbridge -driver=pg_dump

on a database containing a table created with:

  create table test_inherits () inherits (test);

will ignore the inherits clause, and essentially generate the empty table with no columns (which will be augmented with a synthetic synth_id column because there is no primary key). Any data for this table will almost certainly be dropped.

nevinheintze avatar Dec 08 '20 07:12 nevinheintze