Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T6P3U-0001qn-0W for pgsql-bugs@postgresql.org; Tue, 28 Aug 2012 16:54:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T6P3S-00026O-R7 for pgsql-bugs@postgresql.org; Tue, 28 Aug 2012 16:54:19 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q7SGsG1w003221; Tue, 28 Aug 2012 12:54:16 -0400 (EDT) From: Tom Lane To: Bruce Momjian cc: Rikard Pavelic , Merlin Moncure , pgsql-bugs@postgresql.org Subject: Re: BUG #6489: Alter table with composite type/table In-reply-to: <20120828024053.GH6786@momjian.us> References: <4F60E122.3080409@zg.htnet.hr> <20120828024053.GH6786@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Mon, 27 Aug 2012 22:40:53 -0400" Date: Tue, 28 Aug 2012 12:54:15 -0400 Message-ID: <3220.1346172855@sss.pgh.pa.us> X-Pg-Spam-Score: -1.0 (-) X-Archive-Number: 201208/215 X-Sequence-Number: 33939 Bruce Momjian 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