Re: How to insert with a serial

Поиск
Список
Период
Сортировка
От Flávio Brito
Тема Re: How to insert with a serial
Дата
Msg-id 01102215494101.01182@pegasus
обсуждение исходный текст
Ответ на How to insert with a serial  (elwood@agouros.de (Konstantinos Agouros))
Список pgsql-general
HI  Konstantin

Use insert into table (type) values ('typedesc');
The database will create a sequence number to put in id


Flávio Brito
Rio de Janeiro
Brasil


Em Dom 21 Out 2001 11:16, Konstantinos Agouros escreveu:
> Hi,
>
> I have a table defined like this:
>
>   Attribute  |         Type          |                 Modifier
> -------------+-----------------------+-------------------------------------
>----- name        | character varying(40) |
>  type        | integer               |
>  id          | integer               | not null default
> nextval('serial'::text) ownerteamid | integer               |
> Index: devices_pkey
>
> How do I insert into it so that id is automatically incremented?
>
> Konstantin

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

Предыдущее
От: Keary Suska
Дата:
Сообщение: Re: Listing users
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: How to insert with a serial