Re: BUG #6489: Alter table with composite type/table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr>, Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6489: Alter table with composite type/table
Date: 2012-08-28 16:54:15
Message-ID: 3220.1346172855@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> On Wed, Mar 14, 2012 at 07:19:14PM +0100, Rikard Pavelic wrote:
>> On 13.3.2012. 20:49, Merlin Moncure wrote:
>>> I personally think it's an oversight. This was just discussed a
>>> couple of days ago here:
>>> http://postgresql.1045698.n5.nabble.com/Altering-a-table-with-a-rowtype-column-td5544844.html

>> TODO: alter table-type columns according to attribute type rules.
>> Enforce only TYPE features and ignore TABLE features when altering composite table-types.

> Should we add this TODO? I am confused by the text above though.

I think this is making an assumption that we have consensus on what
are "type" properties and what are only "table" properties; that is,
is it a feature or a bug that column defaults don't work for instances
of composite types?

The ALTER code is rejecting the case on the assumption that we think
this is a bug that should get fixed eventually. I'd only want to relax
the check if we have consensus that that will never happen.

The thread linked to via nabble above covers a lot of the background and
issues here. It didn't seem to me that there was clear consensus.

In any case, if we do do this, ISTM the TODO is much less about removing
one test in ALTER TABLE and much more about documenting the chosen
behavior. I think the reason you're confused by the proposed TODO
wording is exactly that it uses the phrases "TYPE features" and "TABLE
features" as if those concepts were defined or documented anywhere.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2012-08-29 03:16:47 Re: [HACKERS] BUG #6572: The example of SPI_execute is bogus
Previous Message Merlin Moncure 2012-08-28 15:06:20 Re: BUG #6489: Alter table with composite type/table