Re: resetting primary key after copy

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: resetting primary key after copy
Дата
Msg-id 20070212174557.GA24776@a-kretschmer.de
обсуждение исходный текст
Ответ на resetting primary key after copy  (Don Guernsey <dononyx@yahoo.com>)
Список pgsql-novice
am  Mon, dem 12.02.2007, um  9:28:40 -0800 mailte Don Guernsey folgendes:
> does anyone know how to do this? I need to reset the primary key after I copy a

Why? Do you want to break the primary key? You can use setval() for
this.
http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html


> bunch of data to postgres. The other option would be to start my tables primary
> key at a high number, like 3000000. Any Ideas?

Also with setval() or create sequence foo start 300000;


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

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

Предыдущее
От: Don Guernsey
Дата:
Сообщение: resetting primary key after copy
Следующее
От: "Andrej Ricnik-Bay"
Дата:
Сообщение: Re: resetting primary key after copy