Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 1A47F9552D6 for ; Tue, 28 Feb 2012 17:49:44 -0400 (AST) Received: from smtp-out-01.xnet.hr ([83.139.103.71] helo=smtp.xnet.hr) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S2UvW-0005mD-PQ for pgsql-bugs@postgresql.org; Tue, 28 Feb 2012 21:49:44 +0000 Received: from ike.bnet.hr (ike.bnet.hr [83.139.80.4]) by smtp.xnet.hr (XnetMailOut) with ESMTP id 61D5C48394; Tue, 28 Feb 2012 22:49:26 +0100 (CET) Received: from smtp.xnet.hr ([83.139.103.74]) by ike.bnet.hr (avcleaner-b.mx.xnet.hr [83.139.80.4]) (XNet AV Scanner, port 10026) with ESMTP id HnrC5v8ZCMzn; Tue, 28 Feb 2012 22:49:23 +0100 (CET) Received: from [109.60.103.57] (unknown [109.60.103.57]) by smtp.xnet.hr (XnetMailOut) with ESMTP id B8E0789F0B; Tue, 28 Feb 2012 22:49:23 +0100 (CET) Message-ID: <4F4D4BE2.4040106@zg.htnet.hr> Date: Tue, 28 Feb 2012 22:49:22 +0100 From: Rikard Pavelic User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Marti Raudsepp CC: pgsql-bugs@postgresql.org Subject: Re: BUG #6489: Alter table with composite type/table References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/204 X-Sequence-Number: 32547 On 28.2.2012. 15:01, Marti Raudsepp wrote: > On Sat, Feb 25, 2012 at 15:23, wrote: >> This works: >> alter table t1 add x float not null; > Peeking at the code, currently any modifications that cause a rewrite > of the original table are disallowed. > > Adding a nullable column without a default is allowed since it can be > done without a rewrite -- all rows magically get the value NULL. As shown in example above, I was adding not null column (but table was empty so query passed) > I'm not sure whether it's worth complicating code for this. If you > want to store composite types in tables, I think you're better off > using CREATE TYPE/ALTER TYPE. I guess this falls under advanced type usage (like recursive types - which can be used for lists) which are not even recognized as important ;( Regards, Rikard