RE: [HACKERS] Happy column dropping

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Don Baccus" <dhogaza(at)pacifier(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "PostgreSQL Development" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: [HACKERS] Happy column dropping
Date: 2000-01-25 03:22:44
Message-ID: 001201bf66e3$7204f4c0$2801007e@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Don Baccus [mailto:dhogaza(at)pacifier(dot)com]
>
> At 09:12 PM 1/24/00 -0500, Tom Lane wrote:
>
> > * VACUUM with rebuild or ADD/DROP COLUMN: write new data into
> > files with an incremented version number.
>
> Just a reality check for my learning of the internals. Out of curiousity
> I coincidently have spent the last hour looking to see how add column's
> implemented. It doesn't appear to do anything other than the new
> attribute
> to the proper system table. heap_getattr() just returns null if you ask
> for an attribute past the end of the tuple.
>
> 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. .

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(at)tpf(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Mascari 2000-01-25 03:31:37 Re: [HACKERS] Happy column dropping
Previous Message Tom Lane 2000-01-25 03:18:29 Re: [HACKERS] Happy column dropping