Re: Fix dumping pre-10 DBs by pg_dump10 if table "name" exists
Vitaly Burovoy <vitaly.burovoy@gmail.com>
From: Vitaly Burovoy <vitaly.burovoy@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2017-10-31T15:52:52Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-dumping-schema-if-a-table-named-name-exists.ver2.patch (application/octet-stream) patch 0001
On 10/31/17, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Vitaly Burovoy <vitaly.burovoy@gmail.com> writes: >> Recently my colleagues found a bug. > >> - "SELECT 'bigint'::name AS sequence_type, " >> + "SELECT 'bigint'::pg_catalog.name AS sequence_type, > > Good catch, but I think we could simplify this by just omitting the cast > altogether: > > - "SELECT 'bigint'::name AS sequence_type, " > + "SELECT 'bigint' AS sequence_type, > > pg_dump doesn't particularly care whether the column comes back marked > as 'name' or 'text' or 'unknown'. > > regards, tom lane OK, just for convenience I'm attaching your version of the fix. I left an other "NULL::name AS rolname" at src/bin/pg_dump/pg_dump.c:2978 because can't check (remoteVersion < 90000) it and it is under strict "selectSourceSchema(fout, "pg_catalog");" schema set. -- Best regards, Vitaly Burovoy
Commits
-
In client support of v10 features, use standard schema handling.
- f4e13963ca88 10.1 landed
- 51f4d3ed7ea4 11.0 landed
-
Fix underqualified cast-target type names in pg_dump and psql queries.
- 9cf2b854a59d 10.1 landed
- 080351466c5a 11.0 landed
-
Add CREATE SEQUENCE AS <data type> clause
- 2ea5b06c7a70 10.0 cited
-
pg_dump: Fix some schema issues when dumping sequences
- da4d1c0c15ab 10.0 cited