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

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jeffrey Baker <jwbaker(at)gmail(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:43:20
Message-ID: 20080617214320.GE10140@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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:

$ psql
Welcome to psql 8.1.10, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

alvherre=# create table foo (a serial);
NOTICE: CREATE TABLE will create implicit sequence "foo_a_seq" for serial colum
n "foo.a"
CREATE TABLE
alvherre=# \q
$ pg_dump -t foo | psql foo
SET
SET
SET
SET
SET
SET
CREATE TABLE
ALTER TABLE
setval
--------
1
(1 row)

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeffrey Baker 2008-06-17 21:51:32 Re: pg_dump fails to include sequences, leads to restore fail in any version
Previous Message Greg Stark 2008-06-17 21:39:29 Re: Reducing overhead for repeat de-TOASTing