Re: are foreign keys realized as indexes? - Mailing list pgsql-general

From Tom Lane
Subject Re: are foreign keys realized as indexes?
Date
Msg-id 26668.1178721565@sss.pgh.pa.us
Whole thread Raw
In response to Re: are foreign keys realized as indexes?  (Felix Kater <fkater@googlemail.com>)
List pgsql-general
Felix Kater <fkater@googlemail.com> writes:
> On Tue, 8 May 2007 15:54:08 +0200
> Martijn van Oosterhout <kleptog@svana.org> wrote:
>> A unique index is not a "substitute" for a unique constraint, they're
>> exactly the same thing.

> Yes. For this reason I didn't have to implement *both* 'unique
> constraints' *and* 'unique indices' in my pg interface.

If you are trying to get away with a dumbed-down subset of SQL, be
prepared for people to refuse to use your tool ;-).

You have to support the unique-constraint syntax because the SQL spec
says so (and people are used to it), and you have to support the
create-index syntax because it gives access to functionality not
available through the constraint syntax.  Unique indexes on expressions
for instance.

            regards, tom lane

pgsql-general by date:

Previous
From: Scott Ribe
Date:
Subject: Re: Dangers of fsync = off
Next
From: Michael Glaesemann
Date:
Subject: Re: In theory question