pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Garris, Nicole <Nicole.Garris@dof.ca.gov>
To: 'pgsql-admin@postgresql.org' <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
Message-ID: <DA1D6951A4720F4FBC5BF398E4D5B122280CE2@dofmail.DOF.FINANCE> (raw)

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" <Nicole.Garris@dof.ca.gov> 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 <tablename>_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



view thread (3+ messages)

Message-ID: <DA1D6951A4720F4FBC5BF398E4D5B122280CE2@dofmail.DOF.FINANCE>
Permalink:  ../DA1D6951A4720F4FBC5BF398E4D5B122280CE2@dofmail.DOF.FINANCE/
Also on:    postgresql.org/message-id/DA1D6951A4720F4FBC5BF398E4D5B122280CE2@dofmail.DOF.FINANCE

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: Nicole.Garris@dof.ca.gov
  Subject: Re: FW: pg_dump not in object dependency order for sequences used for primary keys
  In-Reply-To: <DA1D6951A4720F4FBC5BF398E4D5B122280CE2@dofmail.DOF.FINANCE>
  References: <DA1D6951A4720F4FBC5BF398E4D5B122280CE2@dofmail.DOF.FINANCE>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox