GoogleCloudPlatform / GoogleCloudPlatform/spanner-migration-tool

Fix treatment of Postgres INHERITS clause when using pg_dump

Open
#92 0 comments 0 reactions 0 assignees View on GitHub
p4
Dominant language
PLpgSQL
Stars
155
Forks
83
Avg merge
3d 7h
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.