Re: Newbie Question

Поиск
Список
Период
Сортировка
От Ludwig Meyerhoff
Тема Re: Newbie Question
Дата
Msg-id Pine.LNX.4.21.0105042250020.4404-100000@ludwig
обсуждение исходный текст
Ответ на Newbie Question  ("Clay & Judi Kinney" <cricketk@home.com>)
Список pgsql-general
Hallo!

> How do I create an autoincrement field in a postgresql table???
> What are the correct field type and parameters????
Well, what about using sequences?
create sequence tralalala;
create table huibui
(
  id integer primary key default nextval('tralalala'),
  field1 references table1,
  and-so-on references all-other-tables
);

How, each time You insert some data in huibui using
insert into huibui (field1, and-son-on) values (?, ..);
the 'tralala' counter will be increased by one (nextval).


Saluti!

Ludwig


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

Предыдущее
От: Lark
Дата:
Сообщение: Data type money. How to use?
Следующее
От: Justin Clift
Дата:
Сообщение: When DST occurs