Re: [HACKERS] Happy column dropping - Mailing list pgsql-hackers

From Mike Mascari
Subject Re: [HACKERS] Happy column dropping
Date
Msg-id 388D1919.DC7D369F@mascari.com
Whole thread Raw
In response to RE: [HACKERS] Happy column dropping  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Responses RE: [HACKERS] Happy column dropping
List pgsql-hackers
Hiroshi Inoue wrote:
> > Correct?  (again, to see if my eyeballs and brain are working in synch
> > tonight)
> >
> 
> Probably yes.
> Adding NOT NULL constraints to new column needs to apply default
> value to existent rows and this would need either implicit updation of
> existent rows or to copy into different version of the relation file. .
> 
> Do other DBMSs allow such things ?
> For example,in Oracle NOT NULL constraint could be specified for new
> column only when there's no row in the table AFAIK.
> 
> I couldn't judge it's worth the work.
> 
> Regards.
> 
> Hiroshi Inoue
> Inoue@tpf.co.jp
> 

But the times when I've found it would be nice to use ALTER TABLE
ADD COLUMN with NOT NULL constraints is in development mode when
the schema is changing rapidly and there actually isn't any data
yet in the tables. Otherwise, to add a new NOT NULL column during
a development cycle, one has to drop and recreate the table, all
triggers, comments, etc. Its just a real pain. :-(

Mike Mascari


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Happy column dropping
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace