Auto Increment Questions

From: "Michael Avila" <mavila(at)mich(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Auto Increment Questions
Date: 2005-06-04 18:35:02
Message-ID: NBBBLNPHAMCFENDFHIDCEEHHECAA.mavila@mich.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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 Content-Type Size
winmail.dat application/ms-tnef 2.1 KB

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruce Momjian 2005-06-04 18:40:03 Re: Auto Increment Questions
Previous Message Babak Asadi 2005-06-04 18:17:50 Wrong SQLSTATE returned?