Re: [HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: [HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table
Date
Msg-id 20170502212616.GO21223@tamriel.snowman.net
Whole thread Raw
In response to Re: [HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
Amit,

* Amit Langote (Langote_Amit_f8@lab.ntt.co.jp) wrote:
> Now that WITH OPTIONS is optional even for CREATE TABLE OF, perhaps it
> needs to be mentioned in the release notes?

Doesn't strike me as rising to the level of needing to go into the
release notes, but I won't object if people feel that it needs
mentioning.

> Attached updated patches.

Thanks, but aren't the changes for handling pg_dump --binary-upgrade
when dealing with partitions whose parents are in another schema
backwards?

The source schema selected is for the partition, so we don't need to
schema-qualify the partition, but we do need to schema-qualify the
parent because it could be in another schema.  I think the approach to
use is to decide, first, if we need to schema-qualify the parent or not,
then set up a string which has the qualified (if necessary) name of the
parent, and then just use that when appropriate while building the ALTER
TABLE command.  Remember, we select the source schema of the table in
tbinfo at the top of dumpTableSchema() (see 'selectSourceSchema()'), so
it shouldn't ever be necessary to schema-qualify the table in tbinfo.

I've somehow managed to run out of time again today (it's gotten quite
busy lately), but I'll try to find time late tonight to continue working
on this, or I'll be working on it again tomorrow.  This *really* needs
some tests that actually cover this case, as it's clearly not hard to
get confused about what needs to be qualified and what doesn't.

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling)
Next
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Row Level Security UPDATE Confusion