Re: [NOVICE] pg_dump sequence problem - Mailing list pgsql-general

From Tom Lane
Subject Re: [NOVICE] pg_dump sequence problem
Date
Msg-id 29287.1154706546@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump sequence problem  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
List pgsql-general
"Nikolay Samokhvalov" <samokhvalov@gmail.com> writes:
> My suggestions are:
>  - do not use SERIAL at all. Always create sequence manually and then
> write DEFAULT expr.

Not an unreasonable suggestion.

>  - when DEFAULT expr is simple nextval('...') you should make fool
> from pg_dump - write "DEFAULT nextval('...') + 0" - that dummy "+ 0"
> will prevent pg_dump from making conclusion that this is SERIAL...

This is completely silly, however.  pg_dump does not pay any attention
to the contents of the default when determining if something is a SERIAL.
(One could argue that that's exactly the problem ...)

            regards, tom lane

pgsql-general by date:

Previous
From: gustavo halperin
Date:
Subject: Re: Create function problem
Next
From: "Rohit Prakash Khare"
Date:
Subject: Recover lost database from DATA folder