QUESTION: Automatically generating Primary keys !!!

From: "Tom Janssens" <tom-janssens(at)freegates(dot)be>
To: pgsql-general(at)postgresql(dot)org
Subject: QUESTION: Automatically generating Primary keys !!!
Date: 2001-06-02 20:47:20
Message-ID: 3b194765@post.usenet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

**** Post for FREE via your newsreader at post.usenet.com ****

Hello,

I'm working on some sort of search-engine which is accesable by a browser.
On of the features of the engine is that you can insert new data into it
just by using your browser. For all this I use PHP, my database is in
Postgresql.

My problem is that I should be able to let the Database System (Postgresql)
generate its own primairy keys (from the rest of the data).

eg. I've got a table like this:

workplace_ID, name, street, nr, zipcode, city, country

workplace_ID is the primairy key of that table. Some other tables have a
foreign key refering to it. As a primairy key this ID is of course unique.
My Question is: How can I see which values (of the primairy key) are already
taken, and which is available for new data.

Thanks a lot

STom

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2001-06-02 22:32:32 Re: Databases compared at zend.com
Previous Message Rene Pijlman 2001-06-02 16:52:05 Mails from list after posting on Usenet