Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 01F529FB524 for ; Wed, 6 Jun 2007 11:59:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 79452-07 for ; Wed, 6 Jun 2007 11:59:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 55AF39FB454 for ; Wed, 6 Jun 2007 11:59:22 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l56ExJOe021002; Wed, 6 Jun 2007 10:59:19 -0400 (EDT) To: Alvaro Herrera cc: Erwin Brandstetter , pgsql-admin@postgresql.org Subject: Re: Change order of table-columns in pg_catalog.pg_attribute.attnum In-reply-to: <20070606143852.GF6377@alvh.no-ip.org> References: <1181138388.508384.51110@q75g2000hsh.googlegroups.com> <20070606143852.GF6377@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Wed, 06 Jun 2007 10:38:52 -0400" Date: Wed, 06 Jun 2007 10:59:19 -0400 Message-ID: <21001.1181141959@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/40 X-Sequence-Number: 25708 Alvaro Herrera 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