Skip site navigation (1) Skip section navigation (2)

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

From: Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6489: Alter table with composite type/table
Date: 2012-02-28 21:49:22
Message-ID: 4F4D4BE2.4040106@zg.htnet.hr (view raw or flat)
Thread:
Lists: pgsql-bugs
On 28.2.2012. 15:01, Marti Raudsepp wrote:
> On Sat, Feb 25, 2012 at 15:23,  <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr> 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

In response to

pgsql-bugs by date

Next:From: Kevin GrittnerDate: 2012-02-28 22:01:40
Subject: Re: BUG #6497: Error sent to client, but data written anyway
Previous:From: Tom LaneDate: 2012-02-28 21:47:06
Subject: Re: BUG #6496: Why the SQL is not reported as incorrect? Is there a builtin column named "name"?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group