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

From: Jose Soares <jose(at)sferacarta(dot)com>
To: Don Baccus <dhogaza(at)pacifier(dot)com>
Cc: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Happy column adding (was RE: [HACKERS] Happy columndropping)
Date: 2000-01-26 13:39:19
Message-ID: 388EF907.65BAD9A4@sferacarta.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Don Baccus wrote:

> At 12:29 PM 1/25/00 -0600, Ross J. Reedstrom wrote:
> >On Tue, Jan 25, 2000 at 12:23:15PM -0500, Tom Lane wrote:
>
> >> Well, yeah: wouldn't you expect that "ADD COLUMN x DEFAULT 42" would
> >> cause every row currently existing in the table to acquire x = 42,
> >> rather than x = NULL? In fact that would *have* to happen to allow
> >> constraints to be added; consider ADD COLUMN x DEFAULT 42 NOT NULL.
>
> >Actually, no I wouldn't expect it. That's mixing DDL and DML in one
> >statement. I expect the ALTER command to be pure DDL, and the UPDATE
> >to be pure DML.
>
> Hmmm...interesting...is alter table in the standard?

Yes, of course.
...
<alter table statement> ::=
ALTER TABLE <table name> <alter table action>

<alter table action> ::=
<add column definition>
| <alter column definition>
| <drop column definition>
| <add table constraint definition>
| <drop table constraint definition>
...

> Again, my copy
> of Date's SQL 92 primer is somewhere 'wteen Boston, MA and Portland, OR,
> so I can't look myself. Since you've got the standard available you
> can answer perhaps?

>
> >Ouch, reading standards always makes my brain hurt. Especially how you
> >have to read them upside down. Turns out SELECT INTO is in the standard,
> >but not the way we implement it.
>
> Scary!!! :) :)
>
> - Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
> Nature photos, on-line guides, Pacific Northwest
> Rare Bird Alert Service and other goodies at
> http://donb.photo.net.
>
> ************

José

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 2000-01-26 16:05:37 Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates
Previous Message Jose Soares 2000-01-26 13:24:14 Re: Happy column adding (was RE: [HACKERS] Happy column dropping)