Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE - Mailing list pgsql-hackers

From Noah Misch
Subject Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE
Date
Msg-id 20110415155830.GC18609@tornado.leadboat.com
Whole thread Raw
In response to Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
Robert,

Thanks for the review.

On Wed, Apr 13, 2011 at 08:01:17PM -0700, Robert Haas wrote:
> I think you only need an AccessShareLock on InheritsRelationId, since
> you are only selecting from it.

True; fixed.

> If we adopt the elsewhere-proposed approach of forbidding the use of
> rowtypes to create typed tables, the circularity-checking logic here
> can become simpler.  I think it's not actually water-tight right now:
> 
> rhaas=# create table a (x int);
> CREATE TABLE
> rhaas=# create table b of a;
> CREATE TABLE
> rhaas=# create table c () inherits (b);
> CREATE TABLE
> rhaas=# create table d of c;
> CREATE TABLE
> rhaas=# alter table a of d;
> ALTER TABLE
> 
> pg_dump is not happy with this situation.

Good test case.

Since we're going to forbid hanging a typed table off a table rowtype, I believe
the circularity check becomes entirely superfluous.  I'm suspicious that I'm
missing some way to introduce problematic circularity using composite-typed
columns, but I couldn't come up with a problematic example.  The current check
would not detect such a problem, if one does exist, anyway.

When we're done with the relkind-restriction patch, I'll post a new version of
this one.  It will remove the circularity check and add a relkind check.

nm


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Rename pg_regress option --multibyte to --encoding
Next
From: Andrew Dunstan
Date:
Subject: Re: [COMMITTERS] pgsql: Rename pg_regress option --multibyte to --encoding