Re: Serial data type not starting at 1

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Serial data type not starting at 1
Дата
Msg-id 20011116014118.B3148@svana.org
обсуждение исходный текст
Ответ на Serial data type not starting at 1  (Tielman J de Villiers <tjdevil@bondnet.co.za>)
Список pgsql-general
On Thu, Nov 15, 2001 at 03:50:29PM +0200, Tielman J de Villiers wrote:
> Hi,
>
> I hope someone can help me.
>
> I want to create a new table using the "automatic" sequence function of
> Postgres by creating the first column as type "serial". But I want to start
> at say "5000". Can it be done, and how?

I don't think you can do it within the table definition, but you can
certainly use setval() to change the value after the table has been created.
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Serial data type not starting at 1
Следующее
От: Vivek Khera
Дата:
Сообщение: Re: Modifying check constraints