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

From Don Baccus
Subject RE: [HACKERS] Happy column dropping
Date
Msg-id 3.0.1.32.20000124205003.00f6fac0@mail.pacifier.com
Whole thread Raw
In response to RE: [HACKERS] Happy column dropping  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
List pgsql-hackers
At 12:22 PM 1/25/00 +0900, Hiroshi Inoue wrote:
>> -----Original Message-----
>> From: Don Baccus [mailto:dhogaza@pacifier.com]

>> This would appear to be (at least one reason) why you can't add a 
>> "not null"
>> constraint to a column you're adding to an existing relation, or set the
>> new column to some non-null default value.
>>
>> 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. .

Right...and my reading says neither happens.

(and I'm not arguing that either should, I posed my question as a reality
check as to whether or not a pedantic, lame-brain like myself is actually
capable of reading and understanding the code)

>Do other DBMSs allow such things ?

Don't know, haven't researched it.  I think it's a reasonable restriction,
though.

>For example,in Oracle NOT NULL constraint could be specified for new
>column only when there's no row in the table AFAIK.

I think that's right.

>I couldn't judge it's worth the work.

Gosh, and I hope you didn't think I was suggesting it was.  I was simply
responding to Tom's saying that "ADD/DROP column" would require a new
file for the updated relation, and asking if the current situation was
slated for change (because the current situation doesn't require that
the relation be copied to a new file after a "alter table add column",
if I read the code right).

That's all...I just wasn't able to relate Tom's point to how things 
appear to work, and wondered if I was missing something crucial in my
reading of the code.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


pgsql-hackers by date:

Previous
From: Don Baccus
Date:
Subject: Re: [HACKERS] Happy column dropping
Next
From: Don Baccus
Date:
Subject: Re: [HACKERS] Happy column dropping