From: Sylte <Sylte_@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Auto incrementing an integer
Date: Mon, 14 May 2001 23:55:51 +0200
Message-ID: <9dpk8p$f5e$1@sunsite.dk> (raw)
References: <989853345.3afff6a1a3a45@bugs.unl.edu.ar>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: Sylte_@hotmail.com
Subject: Re: Auto incrementing an integer
In-Reply-To: <9dpk8p$f5e$1@sunsite.dk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox