How to insert with a serial

From: elwood(at)agouros(dot)de (Konstantinos Agouros)
To: pgsql-general(at)postgresql(dot)org
Subject: How to insert with a serial
Date: 2001-10-21 13:16:19
Message-ID: elwood.1003670142@news.agouros.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
--
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood(at)agouros(dot)de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not survive the forming of the cosmos." B'Elana Torres

Responses

Browse pgsql-general by date

  From Date Subject
Next Message carex 2001-10-21 19:40:39 index files still growing
Previous Message DOMA 2001-10-21 08:10:16 Stored procedure