From: Thomas Swan <tswan@olemiss.edu>
To: Sylte <Sylte_@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Auto incrementing an integer
Date: Mon, 14 May 2001 16:27:34 -0500
Message-ID: <3B004DC6.70301@olemiss.edu> (raw)
References: <9dokvu$4uo$1@sunsite.dk>
Sylte wrote:
>How do I construct a datatype that autoincrement in postgreSQL?
>
Use the SERIAL data type instead of an INT4. Serial is an integer
(INT4) that's default value is base on a sequence.
for example...
create table foo (
my_id serial not null,
my_data text
);
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: tswan@olemiss.edu, Sylte_@hotmail.com
Subject: Re: Auto incrementing an integer
In-Reply-To: <3B004DC6.70301@olemiss.edu>
* 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