Re: Auto Increment Questions - Mailing list pgsql-novice

From Bruce Momjian
Subject Re: Auto Increment Questions
Date
Msg-id 200506041840.j54Ie3S22772@candle.pha.pa.us
Whole thread Raw
In response to Auto Increment Questions  ("Michael Avila" <mavila@mich.com>)
List pgsql-novice
How is SERIAL not automatic?  Have you read the FAQ?

---------------------------------------------------------------------------

Michael Avila wrote:
> I am currently working on a project that may be used throughout the United
> States. I have created the project database in MySQL but have been looking
> at Postgres due to it being completely free.  The application will be web
> based and the language with primarily be PHP.
>
> In MySQL there is the availability of an auto increment field. I need this
> type of field in several of the tables.  Looking in the archives, I see that
> there is a serial 8 filed that basically does the same thing. In MySQL, auto
> increment is just that - automatically incremented for each new record.
>
> In Postgres I see that it is not so automatic and is not truly
> serial/sequential. Reviewing my objectives, I don't think not being truly
> serial/sequential will be a problem.  However, I prefer the automated part
> versus my having to code additional lines and hits against the database.
>
> Questions:
>
> - Is there ever going to be a truly auto increment feature like MySQL has?
> If so, any ideas when?
>
> - What is the easiest, shortest, and safest way to code for serial?
>
> - Are there any pitfalls, gotchas that I need to know about using serial?
>
> Thank you for your help.
>
> Mike
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.1 - Release Date: 6/3/2005
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-novice by date:

Previous
From: "Michael Avila"
Date:
Subject: Auto Increment Questions
Next
From: "Michael Avila"
Date:
Subject: Data Store on C: