X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 66B40D1B534 for ; Sat, 3 Jul 2004 19:57:36 -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 17322-02 for ; Sat, 3 Jul 2004 22:57:37 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id F3D44D1B53F for ; Sat, 3 Jul 2004 19:57:34 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i63MvYi7019543 for ; Sat, 3 Jul 2004 22:57:34 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i63McaRr009916 for pgsql-sql@postgresql.org; Sat, 3 Jul 2004 22:38:36 GMT From: ctrl@altonsys.com (ctrl) X-Newsgroups: comp.databases.postgresql.sql Subject: Re: best method to copy data across databases Date: 3 Jul 2004 11:19:50 -0700 Organization: http://groups.google.com Lines: 26 Message-ID: <46a31c4d.0407031019.78b04fdb@posting.google.com> References: <46a31c4d.0407011942.37839bb0@posting.google.com> <272e4be7.0407020310.18785557@posting.google.com> <14059.1088777527@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=DATE_IN_PAST_03_06 X-Spam-Level: X-Archive-Number: 200407/37 X-Sequence-Number: 18289 Many thanks Tony and Tom, since this was a "one time" process speed wasn't an issue... I just did a plain pg_dump with insert and explicit column names in the dump, then used vi to rename the columns and get rid of some of them... non very scientific but it worked :) cheers. tgl@sss.pgh.pa.us (Tom Lane) wrote in message news:<14059.1088777527@sss.pgh.pa.us>... > reina_ga@hotmail.com (Tony Reina) writes: > > If the 2 tables have different arrangements, then I'm not sure if > > there is a quick way. The safest way is probably to do a pg_dump > > --attribute-inserts. > > In recent versions (definitely 7.4, don't remember about 7.3), > pg_dump will include a column list in its COPY commands, so a > plain pg_dump should work. The way with COPY will be a good bit > faster than a pile of INSERT commands. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match