Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Rod Taylor <rbt(at)barchord(dot)com>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected
Date: 2001-11-28 20:56:00
Message-ID: 200111282056.fASKu0706193@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian writes:
>
> > o ALTER TABLE ADD COLUMN column SET DEFAULT should fill existing
> > rows with DEFAULT value or allow NULLs in existing rows
> >
> > My guess is that we will have to do spec behavior by default, and add a
> > flag to allow NULLs in existing rows.
>
> May I point you to the already existing set of commands that do exactly
> what you want:
>
> ALTER TABLE t1 ADD COLUMN name type;
> ALTER TABLE t1 ALTER COLUMN name SET DEFAULT foo;
>
> There's no reason to muck around with the spec here.

OK, so we will implement the spec, and allow people to avoid the
double-disk space by doing the steps manually and skipping the UPDATE.
Sounds good to me. TODO updated.

--
Bruce Momjian | http://candle.pha.pa.us
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 Bruce Momjian 2001-11-28 21:00:03 Re: CVS branch management (was Re: A problem with new pg_dump)
Previous Message Bruce Momjian 2001-11-28 20:54:41 Re: FW: [ppa-dev] Severe bug in debian - phppgadmin opens