Hi Scott
Scott Frankel wrote:

Hi all,

Is it possible to specify a position when adding a column to a table?
No not AFAIK.

I want to swap one column for another without losing the column's position. eg: given that 'foo' is the 5th column in an 8 column table, I want to replace it with a 'bar' column at column 5.

    ALTER TABLE qwe DROP COLUMN foo;
    ALTER TABLE qwe ADD COLUMN bar;

ALTER TABLE qwe RENAME COLUMN foo TO bar;

That does imply the COLUMN TYPE stays the same though... The help file does have examples in the ALTER TABLE section how to change the TYPE of a column.

HTH,

Johan Nel
Pretoria, South Africa.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to