Re: pg_dump and sequences - RFC

Поиск
Список
Период
Сортировка
От Philip Warner
Тема Re: pg_dump and sequences - RFC
Дата
Msg-id 3.0.5.32.20000929015224.041d3aa0@mail.rhyme.com.au
обсуждение исходный текст
Ответ на Re: pg_dump and sequences - RFC  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_dump and sequences - RFC
Список pgsql-hackers
At 10:36 28/09/00 -0400, Tom Lane wrote:
>Philip Warner <pjw@rhyme.com.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   |/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump and sequences - RFC
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump and sequences - RFC