Re: [INTERFACES] Autoincrement

From: "Antonio Garcia Mari" <agarcia(at)at4(dot)net>
To: Wari Wahab <wari(at)technology(dot)com>, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Autoincrement
Date: 1998-07-17 09:47:04
Message-ID: 199807171006.GAA29551@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-sql

> 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)

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message leif 1998-07-17 10:36:00 Re: [INTERFACES] ODBC driver for Applixware and Unix
Previous Message Hannu Krosing 1998-07-17 07:18:03 Re: [INTERFACES] Re: [HACKERS] changes in 6.4

Browse pgsql-sql by date

  From Date Subject
Next Message Federico Passaro 1998-07-17 11:07:08 Re: [INTERFACES] Autoincrement
Previous Message Wari Wahab 1998-07-17 06:59:47 Autoincrement