Re: [GENERAL] Autonumbering column

Поиск
Список
Период
Сортировка
От Antonio Garcia Mari
Тема Re: [GENERAL] Autonumbering column
Дата
Msg-id 199807171005.GAA29541@hub.org
обсуждение исходный текст
Ответ на Re: [GENERAL] Autonumbering column  (James Olin Oden <joden@Lee.k12.nc.us>)
Список pgsql-general
this is a hack, but it works...

CREATE SEQUENCE key_s INCREMENT 1 START 1;
CREATE TABLE cliente (
    key     int4 NOT NULL DEFAULT nextval('key_s') PRIMARY KEY,
    name     varchar(100) UNIQUE NOT NULL,
    username    varchar(8) NOT NULL
    );
>
> > Hi,
> >
> >   Is there anyway to have an autonumbering field?
> >
>
> I don't think so, but there is a way to generate the values for a key
> column safely.  Look at the manpage on create_sequence...james
>


Antonio Garcia Mari
Mallorca (Spain)


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

Предыдущее
От: Roland Roberts
Дата:
Сообщение: PHP and keystone (formerly PTS)
Следующее
От: Maarten Boekhold
Дата:
Сообщение: Re: [GENERAL] PostgreSQL connect options?