Re: ALTER TABLE TODO items - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER TABLE TODO items
Date
Msg-id 27334.1083895342@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE TODO items  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: ALTER TABLE TODO items  (Rod Taylor <pg@rbt.ca>)
Re: ALTER TABLE TODO items  (Rod Taylor <pg@rbt.ca>)
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> What happens with ordering of operations in the ALTER TABLE statement? 
> Like if I put an alter TYPE and a SET STORAGE in the same statement 
> (wiht commas between), in what order will things happen?

The "right thing" will happen --- in this case, the SET STORAGE will
take effect (before we actually rewrite the table, so the end result
will be exactly what you want).  Check out the multiple-pass structure
in commands/tablecmds.c.

> Is it deterministic?  Is it documented?  Are there situations where a
> crazy collection of 20 commands in a single ALTER TABLE will have
> unpredictable effects?

Yes, no (I did say we needed more docs effort), and I hope not.

> Also, should the syntax be SET TYPE, not just TYPE?

Shrug ... I dunno whether Rod had a precedent for that choice or not.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: ALTER TABLE TODO items
Next
From: Tom Lane
Date:
Subject: Re: psql 7.3.4 disagrees with NATURAL CROSS JOIN