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 1B77153E1A for ; Thu, 21 Apr 2005 13:06:19 -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 19920-05 for ; Thu, 21 Apr 2005 16:06:13 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 632FD53E11 for ; Thu, 21 Apr 2005 13:06:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j3LG6BE4016053; Thu, 21 Apr 2005 12:06:11 -0400 (EDT) To: "Garris, Nicole" Cc: "'pgsql-admin@postgresql.org'" Subject: Re: pg_dump not in object dependency order for sequences used for pri mary keys In-reply-to: References: Comments: In-reply-to "Garris, Nicole" message dated "Thu, 21 Apr 2005 08:39:47 -0700" Date: Thu, 21 Apr 2005 12:06:11 -0400 Message-ID: <16052.1114099571@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/302 X-Sequence-Number: 17315 "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