Re: [NOVICE] pg_dump sequence problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nikolay(at)samokhvalov(dot)com
Cc: "Q Beukes" <pgsql-general(at)list(dot)za(dot)net>, "Postgresql General" <pgsql-general(at)postgresql(dot)org>, "Postgresql Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: [NOVICE] pg_dump sequence problem
Date: 2006-08-04 15:49:06
Message-ID: 29287.1154706546@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

"Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rohit Prakash Khare 2006-08-04 16:13:13 Recover lost database from DATA folder
Previous Message gustavo halperin 2006-08-04 15:44:16 Re: Create function problem

Browse pgsql-novice by date

  From Date Subject
Next Message John DeSoi 2006-08-04 16:56:54 Re: The old pl/pgsql editor question back again
Previous Message Tom Lane 2006-08-04 15:32:01 Re: pg_dump sequence problem