Re: serial data type

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Tom Allison <tallison(at)tacocat(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: serial data type
Date: 2004-09-25 23:13:40
Message-ID: 874qlmq6vv.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Allison <tallison(at)tacocat(dot)net> writes:

> Can I use the serial data type in lieu of an 'auto_number' field?

What are the exact semantics of an "auto_number" field?

> I asked something like this some months ago and it seems that
> auto_number fields were addressed through a combination of triggers
> and procedures to ensure that there were do duplicate KEYS generated.
>
> Is it realistic to use the serial data type as a KEY?

Lots and lots of people do. If you're just looking for a unique key
column for a single table, it works fine.

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Allison 2004-09-25 23:20:23 Re: serial data type
Previous Message Tom Lane 2004-09-25 23:06:47 Re: SMgrRelation hashtable corrupted