Search Postgresql Archives

add column specify position

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi all,

Is it possible to specify a position when adding a column to a table?

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;


I'm writing a sql script to migrate from one version of my schema to another, dropping one column and adding another to a number of tables. Unfortunately, the windowing toolkit I'm using relies on integer values to determine column positions.

Any ideas come to mind?

Thanks in advance!
Scott


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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux