Re: Equivalent for AUTOINCREMENT?

Поиск
Список
Период
Сортировка
От Michelle Konzack
Тема Re: Equivalent for AUTOINCREMENT?
Дата
Msg-id 20081101132437.GD3514@tamay-dogan.net
обсуждение исходный текст
Ответ на Equivalent for AUTOINCREMENT?  (Michelle Konzack <linux4michelle@tamay-dogan.net>)
Ответы Re: Equivalent for AUTOINCREMENT?  (Joshua Tolley <eggyknap@gmail.com>)
Re: Equivalent for AUTOINCREMENT?  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список pgsql-general
Hello Nikolas,

Am 2008-10-31 09:44:50, schrieb Nikolas Everett:
> I think you want a sequence. Give the serial number the type bigserial or
> serial.  See
> http://www.postgresql.org/docs/current/static/functions-sequence.html for
> more.

OK, thats cool...  I have found an example in  "sql-createsequence.html"

CREATE SEQUENCE serial START 1;

INSERT INTO distributors VALUES (nextval('serial'), 'nothing');

But there is one thing not clear:

Du I need to create a SEQUENCE for each table or do I need only  ONE  of
if and can use it independant on differnt tables?

Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant


--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
+49/177/9351947    50, rue de Soultz         MSN LinuxMichi
+33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Вложения

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

Предыдущее
От: Rafal Pietrak
Дата:
Сообщение: INSERT .... RETURNING
Следующее
От: Michelle Konzack
Дата:
Сообщение: Re: Equivalent for AUTOINCREMENT?