Re: Change order of table-columns in pg_catalog.pg_attribute.attnum - Mailing list pgsql-admin

From Tom Lane
Subject Re: Change order of table-columns in pg_catalog.pg_attribute.attnum
Date
Msg-id 21001.1181141959@sss.pgh.pa.us
Whole thread Raw
In response to Re: Change order of table-columns in pg_catalog.pg_attribute.attnum  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Change order of table-columns in pg_catalog.pg_attribute.attnum  (Erwin Brandstetter <brsaweda@gmail.com>)
List pgsql-admin
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Erwin Brandstetter escribi�:
>> If I want to change the default order of two columns of a table, can I
>> just manipulate the values in
>> pg_catalog.pg_attribute.attnum?

> It works -- as long as the table is empty.

And as long as you have no views, foreign keys, indexes, defaults,
rules, etc etc etc referencing the columns.

Short answer is don't even think of trying it.

            regards, tom lane

pgsql-admin by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Change order of table-columns in pg_catalog.pg_attribute.attnum
Next
From: Erwin Brandstetter
Date:
Subject: Re: Change order of table-columns in pg_catalog.pg_attribute.attnum