Re: Auto Increment

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: postgres(at)flipper(dot)webdevelop(dot)net
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Auto Increment
Date: 2000-12-27 01:18:23
Message-ID: 200012270118.eBR1IPP17569@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

postgres(at)flipper(dot)webdevelop(dot)net wrote:
>
> Is there a way set a primary key to Auto Increment like you can
>with MySQL?

CREATE TABLE junk (id SERIAL PRIMARY KEY, ...etc...)

The SERIAL data type is an INTEGER coupled with a sequence which is
created automatically.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"And they said, Believe on the Lord Jesus Christ, and
thou shalt be saved, and thy house." Acts 16:31

Browse pgsql-general by date

  From Date Subject
Next Message Brett W. McCoy 2000-12-27 01:59:12 Re: Auto Increment
Previous Message postgres 2000-12-27 01:10:37 Auto Increment