Re: pg_dump fails to include sequences, leads to restore fail in any version

From: "Jeffrey Baker" <jwbaker(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump fails to include sequences, leads to restore fail in any version
Date: 2008-06-17 21:51:32
Message-ID: fd145f7d0806171451l5f602b70la8986a4e6a1d690c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 17, 2008 at 2:43 PM, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
wrote:

> Jeffrey Baker escribió:
> > On Tue, Jun 17, 2008 at 10:59 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > > "Jeffrey Baker" <jwbaker(at)gmail(dot)com> writes:
> > > > It is impossible to dump (with pg_dump -Ocx) and restore (with psql)
> a
> > > > database which contains sequences in any of 8.1, 8.2, or 8.3:
> > >
> > > I should think we would have heard about it before now if such a
> > > sweeping claim were true.
> >
> > Last time this problem came up, in August, you dismissed it somewhat
> > rudely. So perhaps the lack of reports is due more to perception than
> any
> > other thing.
>
> How did you set it up exactly? I have no problem with this situation:
>

[snip]

The table was originally created this way:

CREATE TABLE transaction
(
transaction_id SERIAL PRIMARY KEY,
buyer_account_id INTEGER,
seller_account_id INTEGER,
date DATE,
item_id INTEGER,
source TEXT
);

However, when dumped with pg_dump 8.1, it comes out this way:

CREATE TABLE "transaction" (
transaction_id integer DEFAULT
nextval('transaction_transaction_id_seq'::regclass) NOT NULL,
buyer_account_id integer,
seller_account_id integer,
date date,
item_id integer,
source text
);

.. and the sequence does not get dumped with it.

-jwb

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-06-17 22:14:01 Re: pg_dump fails to include sequences, leads to restore fail in any version
Previous Message Alvaro Herrera 2008-06-17 21:43:20 Re: pg_dump fails to include sequences, leads to restore fail in any version