dump and sequence initilizing

Started by Markus Rebbertover 22 years ago4 messagesgeneral
Jump to latest
#1Markus Rebbert
markus.rebbert@freenet.de

Hi list,

what happens with sequences if i dump a database and i want to reload
it?

Do i have to initialize the sequences like
SELECT setval('sequence', max(id)) FROM table;
?

Best regards,
Markus

#2Bruno Wolff III
bruno@wolff.to
In reply to: Markus Rebbert (#1)
Re: dump and sequence initilizing

On Mon, Dec 15, 2003 at 13:19:48 +0100,
Markus Rebbert <markus.rebbert@freenet.de> wrote:

Hi list,

what happens with sequences if i dump a database and i want to reload
it?

Do i have to initialize the sequences like
SELECT setval('sequence', max(id)) FROM table;
?

Sequence values should be part of the dump.

In reply to: Markus Rebbert (#1)
Re: dump and sequence initilizing

Dear Markus Rebbert ,

what happens with sequences if i dump a database and i want to reload
it?

The pg_dump command also dumps the index value of sequences and you do
not have to do any thing
Just make sure your pg_restore and pg_dump with option --disable-tiggers

Regards,
Vishal kashyap

#4Markus Rebbert
markus.rebbert@freenet.de
In reply to: Sai Hertz And Control Systems (#3)
Re: dump and sequence initilizing

Am Mon, den 15.12.2003 schrieb Sai Hertz And Control Systems um 16:26:

Dear Markus Rebbert ,

what happens with sequences if i dump a database and i want to reload
it?

The pg_dump command also dumps the index value of sequences and you do
not have to do any thing
Just make sure your pg_restore and pg_dump with option --disable-tiggers

Okay, thanks.

Markus