At 10:36 28/09/00 -0400, Tom Lane wrote:
>Philip Warner <[EMAIL PROTECTED]> 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   |/

Reply via email to