Re: Auto incrementing an integer

Поиск
Список
Период
Сортировка
От Sylte
Тема Re: Auto incrementing an integer
Дата
Msg-id 9dpk8p$f5e$1@sunsite.dk
обсуждение исходный текст
Ответ на Re: Auto incrementing an integer  (Martín Marqués <martin@bugs.unl.edu.ar>)
Список pgsql-sql
Thanks Mart�n....I found this http://dis.lib.muohio.edu/code/entry.html?ID=3

Creating an Autoincrement field in Postgresql
 postgres does this a little differently; the "serial" type creates an
integer column, and a sequence used to increment this column.

try this:

create table table_name(control serial,another_column text,primary key(control)
);

results in this:
Table    = table_name
+----------------------------------+----------------------------------+-----
--+
|              Field               |              Type                |
Length|
+----------------------------------+----------------------------------+-----
--+
| control                          | int4 not null default nextval('" |
4 |
| another_column                   | text                             |
var |
+----------------------------------+----------------------------------+-----
--+
Index:    table_name_pkey






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

Предыдущее
От: George Moga
Дата:
Сообщение: Re: Select most recent record?
Следующее
От: "ameet"
Дата:
Сообщение: Exp/Imp Problems...