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

Re: pg_dump and sequences - RFC

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump and sequences - RFC
Date: 2000-09-28 15:52:24
Message-ID: 3.0.5.32.20000929015224.041d3aa0@mail.rhyme.com.au (view raw or flat)
Thread:
Lists: pgsql-hackers
At 10:36 28/09/00 -0400, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>> My inclinations is do do the following:
>
>> - Issue 'CREATE SEQUENCE...Initial Value 1...' in OID order
>> - Issue 'SELECT SETVAL...' at end of data load.
>
>Seems reasonable, except you should not necessarily use 1; that could
>be outside the defined range of the sequence object.  Use its min_value
>instead.

OK. Given the discussion of 'select nextval', do you know if 'select
setval' will set the is_called flag? If not should I:


Issue 'CREATE SEQUENCE...Initial Value <MINVAL>...' in OID order

if (is_called was set AND we've loaded any data) then

    Issue 'SELECT NEXTVAL...' at end of data load, and *before* setval.
    Issue 'SELECT SETVAL...' at end of data load.

endif


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

In response to

Responses

pgsql-hackers by date

Next:From: Philip WarnerDate: 2000-09-28 16:06:50
Subject: Re: pg_dump and sequences - RFC
Previous:From: Tom LaneDate: 2000-09-28 15:29:42
Subject: Re: pg_dump and sequences - RFC

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