Re: Serial Type

Поиск
Список
Период
Сортировка
От Justin Clift
Тема Re: Serial Type
Дата
Msg-id 3AEF94ED.F3B7AB4B@postgresql.org
обсуждение исходный текст
Ответ на Serial Type  ("Christian Marschalek" <cm@chello.at>)
Список pgsql-general
Hi Chris,

If you do an INSERT straight into the table, AND also make sure you give
it the value you want in the serial column, it will accept it and not
increment the serial column's counter.

There are also a few function which are useful with the serial type :

currval()
setval()
nextval()

See http://odbc.postgresql.org/docs/index.php?sql-createsequence.html
for more info.

Regards and best wishes,

Justin Clift

Christian Marschalek wrote:
>
> The serial data type automaticaly takes the next higher value, but what
> if there's a drop and I want to assing 3 even if there are 20 records
> and the next higher number would be 21 not 3?
>
> Tia Chris
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi

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

Предыдущее
От: "Christian Marschalek"
Дата:
Сообщение: RE: Ideal hardware configuration for pgsql
Следующее
От: "Eric G. Miller"
Дата:
Сообщение: Re: Improve a query...