Re: Sequence not updated after a copy ?
| От | Oliver Elphick |
|---|---|
| Тема | Re: Sequence not updated after a copy ? |
| Дата | |
| Msg-id | 1016737285.21170.128.camel@linda обсуждение исходный текст |
| Ответ на | Sequence not updated after a copy ? ("GRIMOIS Eric" <eric.grimois@cpam-cergypontoise.cnamts.fr>) |
| Список | pgsql-sql |
On Thu, 2002-03-21 at 17:21, GRIMOIS Eric wrote:
> Hi All
>
> Does 'COPY table FROM...' command update the last_value field of the
> sequence(s) related to the table ?
No
> Is a setval( ) function required after completion ? In this case, what's the
> best command for doing that ?
SELECT setval('sequence_name', (SELECT MAX(column_name) FROM table_name) );
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
"Thy word have I hid in mine heart, that I might not sin against thee." Psalms 119:11
В списке pgsql-sql по дате отправления: