Re: How to auto create a unique key for each newly added record? - Mailing list pgsql-general

From Zak McGregor
Subject Re: How to auto create a unique key for each newly added record?
Date
Msg-id 200103270336.FAA03305@zak.home.dom
Whole thread Raw
In response to How to auto create a unique key for each newly added record?  ("Jeff" <jklcom@mindspring.com>)
List pgsql-general
On Mon, 26 Mar 2001 21:20:13 -0500
"Jeff" <jklcom@mindspring.com> wrote:

> Hi,
>
> How to if it is possible to let postgresql to auto assign unique key to each
> new record that is added to the database?
>
Just set up the table with the field you are wanting to have as a unique id as type "serial".

eg:

create table auto_id (id serial, description varchar(32));

Cheers

Zak

pgsql-general by date:

Previous
From: Stephen Davies
Date:
Subject: records zapped to null
Next
From: Zak McGregor
Date:
Subject: Re: How to copy a table?