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

From Robert Haas
Subject Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE
Date
Msg-id BANLkTi=M8AgPjaKXurdQX8++Op5KnRx0uA@mail.gmail.com
Whole thread Raw
In response to Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE  (Noah Misch <noah@leadboat.com>)
Responses Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE
Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE
List pgsql-hackers
On Fri, Apr 8, 2011 at 5:12 PM, Noah Misch <noah@leadboat.com> wrote:
> Implemented as attached.  The first patch just adds the ALTER TABLE subcommands
> to attach and detach a table from a composite type.  A few open questions
> concerning typed tables will probably yield minor changes to these subcommands.
> I implemented them to be agnostic toward the outcome of those decisions.

I suppose one issue is whether anyone would care to bikeshed on the
proposed syntax.  Any takers?

I think you only need an AccessShareLock on InheritsRelationId, since
you are only selecting from it.

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.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Typed table DDL loose ends
Next
From: Tom Lane
Date:
Subject: Re: POSIX shared memory redux