Re: [GENERAL] Autonumbering column

From: "Antonio Garcia Mari" <agarcia(at)at4(dot)net>
To: owner-pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] Autonumbering column
Date: 1998-07-17 09:47:04
Message-ID: 199807171005.GAA29541@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
);
>
> > Hi,
> >
> > Is there anyway to have an autonumbering field?
> >
>
> I don't think so, but there is a way to generate the values for a key
> column safely. Look at the manpage on create_sequence...james
>

Antonio Garcia Mari
Mallorca (Spain)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message cn.liu 1998-07-17 11:09:29 \dt Error
Previous Message Hannu Krosing 1998-07-17 07:18:03 Re: [INTERFACES] Re: [HACKERS] changes in 6.4