Re: primary key problem

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Mohammad Faisal <faisalchouhan(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: primary key problem
Date: 2001-09-10 16:06:12
Message-ID: Pine.BSF.4.21.0109100903590.15132-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, 10 Sep 2001, Mohammad Faisal wrote:

> the primary key in postgreSQL is implemented as unique
> index and the unique index can be deleted and as a
> result the primary key constraints finishes.(oh a
> problem)
> what if i don't want an index on a table then in this
> case how can i implement Primary key constraint.

If you really want to do it yourself, you could write
a trigger procedure that locks the table and then checks to
see if the value is already in the table throwing an error
if it is. However, that's not going to show up as a primary
key for things that might require it (like foreign keys).

If you want to use the primary key specification, you need to
leave the index alone.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Baker 2001-09-10 16:15:15 Transaction Aborting on sql call failure
Previous Message Henshall, Stuart - WCP 2001-09-10 12:44:10 Re: FINAL: Multi-User PostgreSQL usage SECURITY