Skip site navigation (1) Skip section navigation (2)

Re: pg_dump and sequences - RFC

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump and sequences - RFC
Date: 2000-09-28 15:01:08
Message-ID: 25958.970153268@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> OK. Given the discussion of 'select nextval', do you know if 'select
> setval' will set the is_called flag?

Looks like it does, both by experiment and by reading the code.
So if you issue a setval() you don't need a nextval() as well.

However you still have the problem that you can't recreate the
state of a virgin (never-nextval'd) sequence this way.  The
existing pg_dump code is correct, in that it will reproduce the
state of a sequence whether virgin or not.  A data-only reload
would fail to make that guarantee unless you drop and recreate
the sequence.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-09-28 15:12:25
Subject: Re: sys_nerr, sys_errlist
Previous:From: Tom LaneDate: 2000-09-28 14:36:56
Subject: Re: pg_dump and sequences - RFC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group