X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E3F3353957 for ; Tue, 26 Apr 2005 14:55:51 -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 69711-01 for ; Tue, 26 Apr 2005 17:55:42 +0000 (GMT) Received: from ntrk2.DOF.FINANCE (exchange.dof.ca.gov [134.186.75.161]) by svr1.postgresql.org (Postfix) with ESMTP id CC7BC539A8 for ; Tue, 26 Apr 2005 14:55:39 -0300 (ADT) Received: by ntrk2.dof.finance with Internet Mail Service (5.5.2657.72) id ; Tue, 26 Apr 2005 10:48:29 -0700 Message-ID: From: "Garris, Nicole" To: "'pgsql-admin@postgresql.org'" Subject: FW: pg_dump not in object dependency order for sequences used for primary keys Date: Tue, 26 Apr 2005 10:55:36 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.067 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/368 X-Sequence-Number: 17381 Quite right, "create sequence" occuring after the "create table" is not the cause of the problem. Thanks, Tom. (Now I'm suspecting a character translation problem, most likely with the line feed character.) -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Thursday, April 21, 2005 9:06 AM To: Garris, Nicole Cc: 'pgsql-admin@postgresql.org' Subject: pg_dump not in object dependency order for sequences used for pri mary keys "Garris, Nicole" writes: > I am running PostgreSQL 8.0.1 on Max OS X. Rather than using the serial data > type for a table's primary key, we use integer and default it to the nexval > of a sequence with the name of _seq (this syntax seems to work > best with Apple's WebObjects Enterprise Object Modeler). Therefore, the > table depends on the sequence, and in a reload of the database, the sequence > must be created first. However, pg_dump lists the "create sequence" after > the "create table". Of course I cannot use the pg_dump file as-is to reload > the database, it fails on the "create table" statement when referencing the > (as-yet) non-existent sequence. How so? The nextval only references the sequence as a string; it's not going to trigger any failure at create time. Please show a specific test case instead of assuming you know what the problem is. regards, tom lane