X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 11BD2D8A7D; Wed, 31 Aug 2005 07:00:41 -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 75773-06; Wed, 31 Aug 2005 10:00:38 +0000 (GMT) Received: from obelix.askesis.nl (laudanum.demon.nl [82.161.125.16]) by svr1.postgresql.org (Postfix) with ESMTP id 167E6D8A38; Wed, 31 Aug 2005 07:00:35 -0300 (ADT) Received: obelix.askesis.nl 172.31.0.1 from 172.31.1.8 172.31.1.8 via HTTP with MS-WebStorage 6.0.6249 Received: from Panoramix by obelix.askesis.nl; 31 Aug 2005 12:00:31 +0200 Subject: How do I copy part of table from db1 to db2 (and rename the columns)? From: Joost Kraaijeveld To: Pgsql-sql@postgresql.org, Pgsql-General Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 31 Aug 2005 12:00:30 +0200 Message-Id: <1125482430.9456.6.camel@Panoramix> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.095 required=5 tests=[AWL=0.045, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/1560 X-Sequence-Number: 82968 Hi, I want to copy several columns of a source table from db1 to db2, and create the target table and rename the columns in the process. Is that possible in PostgresQL? If so, an example or url for such a command /script would be appreciated... TIA Joost