Re: Change order of table-columns in pg_catalog.pg_attribute.attnum

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Erwin Brandstetter <brsaweda(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Change order of table-columns in pg_catalog.pg_attribute.attnum
Date: 2007-06-06 14:59:19
Message-ID: 21001.1181141959@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Erwin Brandstetter 2007-06-06 15:21:48 Re: Change order of table-columns in pg_catalog.pg_attribute.attnum
Previous Message Alvaro Herrera 2007-06-06 14:38:52 Re: Change order of table-columns in pg_catalog.pg_attribute.attnum