Re: [HACKERS] pg_attribute.attisinherited ?

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] pg_attribute.attisinherited ?
Date: 2002-08-26 20:49:07
Message-ID: Pine.LNX.4.44.0208261634480.15217-200000@cm-lcon1-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane dijo:

> Alvaro Herrera <alvherre(at)atentus(dot)com> writes:
> > I'm thinking about the ONLY part in the grammar in ALTER TABLE... DROP
> > COLUMN and RENAME COLUMN. I think they should not be there:
>
> Local DROP COLUMN is fine: it just causes the column to become
> non-inherited in any children. (Your patch for attisinherited will
> need to cover this case.)

Oh, I see.

> Local RENAME COLUMN does need to be prohibited, as does local ADD
> COLUMN, as does local ALTER COLUMN if we ever allow changing column
> type. Basically we need to prohibit the column from becoming
> incompatible with its children.

> I don't agree with the notion of changing the grammar to achieve that,
> btw. Simpler and more friendly to add a specific error check in
> (most likely place) utility/tcop.c. Then if you try to say ONLY you'll
> get a more useful complaint than "parse error".

Uh, I added checks in the command itself (command/tablecmds.c), just
because I had already done so and to not make tcop/utility.c messier
than it already is; I can probably move the check if people thinks it's
better. Also implemented is the change from inherited to non-inherited
when local-dropping a column.

I also changed the text of some error messages from "renameatt: cannot
foo" to "ALTER TABLE: cannot foo". But my choose in wording of new
error messages probably needs improvement (suggestions welcome).

Please review; I have not received comments on whether this
implementation is a good approach: note the signature change of
TupleDescInitEntry().

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"La espina, desde que nace, ya pincha" (Proverbio africano)

Attachment Content-Type Size
attisinherited-5.patch text/plain 70.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-08-26 21:20:24 Re: Think I see a btree vacuuming bug
Previous Message Tom Lane 2002-08-26 20:25:55 Re: Think I see a btree vacuuming bug

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-08-26 20:51:40 Re: revised patch for PL/PgSQL table functions
Previous Message Neil Conway 2002-08-26 20:29:15 Re: revised patch for PL/PgSQL table functions