Re: Creating a table

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Reuben Olson <reuben(dot)olson(at)clear(dot)net(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Creating a table
Date: 2001-11-12 03:54:44
Message-ID: 200111120354.fAC3siE13775@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Hi there
>
> I am converting a mySQL database to postgresql database and I
> was wondering if there was any auto increment function like
> there is in mysql or di I need to use a sequence or something...

Sure, sequences. If you define a column as type SERIAL you get a
sequence default on the column.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-11-12 05:08:40 Re: PL/pgSQL RENAME bug?
Previous Message Stephan Szabo 2001-11-12 03:29:08 Re: Creating a table