Re: Happy column adding (was RE: [HACKERS] Happy column dropping)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Don Baccus <dhogaza(at)pacifier(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Happy column adding (was RE: [HACKERS] Happy column dropping)
Date: 2000-01-25 20:08:15
Message-ID: 200001252008.PAA20667@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> At 11:55 AM 1/25/00 +0100, Peter Eisentraut wrote:
> >On Tue, 25 Jan 2000, Hiroshi Inoue wrote:
> >
> >> Even default is not allowed in ADD COLUMN now.
> >> There may be other reasons why they aren't allowed.
> >
> >It's not a matter of *allowed*, it's a parsing deficiency. The fact that
> >there was a default declared gets silently ignored. If y'all allow ;) I
> >would like to fix that (have already started a bit) by perusing the code
> >in parse_func.c:transformCreateStmt and do the same for the alter table
> >add column part. Maybe and add/drop constraint will come out in the end as
> >well.
>
> However, heap_getattr still won't see the default since it simply
> checks to see of the attribute number falls off the end of the
> tuple and then returns null.
>
> There's no provision for then pulling out the default value and
> returning it instead.
>
> I think this is why Tom was implying that add column should really
> alter the table?
>
> A fully-featured "add column" feature would be very nice, indeed.

Oh, so that is why ALTER TABLE can't have a NOT NULLL default. Makes
total sense.

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Byron Nikolaidis 2000-01-25 20:14:49 Re: [INTERFACES] Re: ODBC drive strange behavior
Previous Message daniels 2000-01-25 19:50:34 Re: Postgresql Perl Problem