From: Erwin Brandstetter <brsaweda@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: Change order of table-columns in pg_catalog.pg_attribute.attnum
Date: Wed, 06 Jun 2007 08:21:48 -0700
Message-ID: <1181143308.525613.238500@q75g2000hsh.googlegroups.com> (raw)
In-Reply-To: <21001.1181141959@sss.pgh.pa.us>
References: <1181138388.508384.51110@q75g2000hsh.googlegroups.com>
<20070606143852.GF6377@alvh.no-ip.org>
<21001.1181141959@sss.pgh.pa.us>
On Jun 6, 4:59 pm, t...@sss.pgh.pa.us (Tom Lane) wrote:
> Alvaro Herrera <alvhe...@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.
Thanks for your answers.
I had tried it with data in the table and it seemed to work, but it
does mess up views referencing the table. So, no go.
The only way to change the default order of columns is still to drop
the table and all references to it and recreate it all?
Regards
Erwin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: brsaweda@gmail.com
Subject: Re: Change order of table-columns in pg_catalog.pg_attribute.attnum
In-Reply-To: <1181143308.525613.238500@q75g2000hsh.googlegroups.com>
References: <1181138388.508384.51110@q75g2000hsh.googlegroups.com> <20070606143852.GF6377@alvh.no-ip.org> <21001.1181141959@sss.pgh.pa.us> <1181143308.525613.238500@q75g2000hsh.googlegroups.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox