Thread: dump and sequence initilizing

dump and sequence initilizing

From
Markus Rebbert
Date:
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


Re: dump and sequence initilizing

From
Bruno Wolff III
Date:
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.

Re: dump and sequence initilizing

From
Sai Hertz And Control Systems
Date:
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

Re: dump and sequence initilizing

From
Markus Rebbert
Date:
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