X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 27512D9A27 for ; Wed, 28 Sep 2005 01:04:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52024-09 for ; Wed, 28 Sep 2005 04:04:12 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 30C01D9A00 for ; Wed, 28 Sep 2005 01:04:12 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id DC7F231F53; Wed, 28 Sep 2005 06:04:11 +0200 (MET DST) From: Chris Browne X-Newsgroups: pgsql.sql Subject: Re: changing a column's position in table, how do you do that Date: Tue, 27 Sep 2005 23:24:13 -0400 Organization: cbbrowne Computing Inc Lines: 22 Message-ID: <60wtl1j2n6.fsf@dba2.int.libertyrms.com> References: <4339CD1B.10404@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (Jumbo Shrimp, linux) Cancel-Lock: sha1:UsEP5AYVs0xMBeUwysRm0v9CkSg= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.092 required=5 tests=[AWL=0.092] X-Spam-Level: X-Archive-Number: 200509/276 X-Sequence-Number: 22823 fmiddleton@verizon.net (Ferindo Middleton Jr) writes: > Is there a way to change the position attribute of a column in a > table? I have data that I need to import into various tables in my db > on a consistent basis... I usually us e the COPY ... FROM query but I > can't control the -order- of the fields my client dumps the data so I > would like to be able to change the position the columns in my table > to be able to better align the data to be imported with the format of > my table. I was thinking I could do something like "ALTER TABLE ALTER > COLUMN ... " or something like that to change the columns position in > the table but I can't figure out how. If you're running PostgreSQL 7.4 or later, you can specify field names in the COPY statement. That strikes me as a better way to control this. -- select 'cbbrowne' || '@' || 'ntlug.org'; http://www3.sympatico.ca/cbbrowne/nonrdbms.html Rules of the Evil Overlord #65. "If I must have computer systems with publically available terminals, the maps they display of my complex will have a room clearly marked as the Main Control Room. That room will be the Execution Chamber. The actual main control room will be marked as Sewage Overflow Containment."