Re: Auto_Increment

From: Peter Childs <Blue(dot)Dragon(at)blueyonder(dot)co(dot)uk>
To: Stephane Pinel <spinel(at)noos(dot)fr>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Auto_Increment
Date: 2003-08-09 16:16:47
Message-ID: 200308091716.47530.Blue.Dragon@blueyonder.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Saturday 09 August 2003 15:44, Stephane Pinel wrote:
> What is the pgsql equivalent keyword for the MySQL auto_increment
> keyword ?

serial. (For the short answer) To be quick. ie

CREATE table x (a serial);

or

CREATE SEQUENCE a_seq;
ALTER TABLE x ALTER a SET DEFAULT next_val('a_seq');

>
> Thanks.
>
> Regards.
>
> Stephane
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

Peter Childs

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message John T. Yocum 2003-08-09 16:19:01 Re: CURRENT TIME causes server to shutdown connection
Previous Message Bruno Wolff III 2003-08-09 15:35:51 Re: Upgrade 7.2 to 7.3