Re: RE : full featured alter table?

Sven Köhler <skoehler@upb.de>

From: Sven Köhler <skoehler@upb.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org
Date: 2003-06-16T23:22:37Z
Lists: pgsql-general
 > You could invent a syntax that supports both use cases, along the
 > lines of
 >
 > ALTER ... POSITION <i> <column1> [ , <column2> ... ]

This idea is great, although the statement

ALTER TABLE <table> POSITION <i> <column>,<column>,...

might make the task to maintain the pg_attribute table more complicated 
than the simple statement

ALTER TABLE <table> ALTER COLUMN <column> POSITION <i>

which can be transformed into 2 update-statements i think.
perhaps it would be simpler to define a statement like

ALTER TABLE <table> POSITIONS <column1> <i1>, <column2> <i2>, ...

which just means the following:

ALTER TABLE <table> ALTER COLUMN <oclumn1> POSITION <i1>
ALTER TABLE <table> ALTER COLUMN <oclumn2> POSITION <i2>

we wouldn't have such strong/complicated contraints for each <i>, 
because each <i> can be >=1 and <= the column-count.

i don't know what i'd like most, but although your last suggestion looks 
great, it makes it hard to estimate what's the result.