Re: add column .. default

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add column .. default
Date: 2003-06-19 14:53:36
Message-ID: 1056034416.39060.22.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2003-06-19 at 10:42, Tom Lane wrote:
> Rod Taylor <rbt(at)rbt(dot)ca> writes:
> > On Thu, 2003-06-19 at 10:05, Alvaro Herrera wrote:
> >> Sorry, I haven't read the spec, but what happens when there is a default
> >> value already and it's not NULL? Are tuples where column =3D default
> >> updated? Are tuples where column IS NULL updated?
>
> > We're talking about add column. Since it's a new column, there will
> > never be a default and all entries are NULL in PostgreSQL.
>
> That's an overly simplistic analysis, given that the column may already
> exist in child tables. I am not sure that the behavior is fully
> consistent even now in such cases, but we at least should make certain
> it doesn't become less consistent.

Right now if the column exists in the child table, the add column is
rejected. I assume that will remain.

It is consistent with the user providing a column that inherits a column
from a parent by the same name.

--
Rod Taylor <rbt(at)rbt(dot)ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-06-19 15:00:23 Re: add column .. default
Previous Message Tom Lane 2003-06-19 14:42:52 Re: add column .. default