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 2F642D1B170 for ; Fri, 2 Jul 2004 11:13:26 -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 60692-07 for ; Fri, 2 Jul 2004 14:13:25 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5BA32D1B380 for ; Fri, 2 Jul 2004 11:13:18 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i62EC7Hx014060; Fri, 2 Jul 2004 10:12:07 -0400 (EDT) To: reina_ga@hotmail.com (Tony Reina) Cc: pgsql-sql@postgresql.org Subject: Re: best method to copy data across databases In-reply-to: <272e4be7.0407020310.18785557@posting.google.com> References: <46a31c4d.0407011942.37839bb0@posting.google.com> <272e4be7.0407020310.18785557@posting.google.com> Comments: In-reply-to reina_ga@hotmail.com (Tony Reina) message dated "02 Jul 2004 04:10:15 -0700" Date: Fri, 02 Jul 2004 10:12:07 -0400 Message-ID: <14059.1088777527@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/15 X-Sequence-Number: 18267 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