From: Antonio Garcia Mari <agarcia@at4.net>
To: Wari Wahab <wari@technology.com>
To: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] Autoincrement
Date: Fri, 17 Jul 1998 11:47:04 +0200
Message-ID: <199807171006.GAA29551@hub.org> (raw)
In-Reply-To: <Pine.LNX.3.96.980717145829.12201C-100000@spider.mis.yhssgp.com.sg>
> Hi, is there a way to do a field that can automatically increment itself,
> like in paradox or dbase?
>
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
);
Antonio Garcia Mari
Mallorca (Spain)
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-interfaces@postgresql.org
Cc: agarcia@at4.net, wari@technology.com
Subject: Re: [INTERFACES] Autoincrement
In-Reply-To: <199807171006.GAA29551@hub.org>
* 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