From: Robert Treat <xzilla@users.sourceforge.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: partial unique constraint
Date: 06 Apr 2004 12:38:41 -0400
Message-ID: <1081269521.31791.73.camel@camel> (raw)
In-Reply-To: <24888.1081264623@sss.pgh.pa.us>
References: <1081261772.31785.48.camel@camel>
<24888.1081264623@sss.pgh.pa.us>
On Tue, 2004-04-06 at 11:17, Tom Lane wrote:
> Robert Treat <xzilla@users.sourceforge.net> writes:
> > Trying to come up with the proper syntax to meet the following criteria:
> > create table foo (bar integer, baz boolean UNIQUE (bar, baz = true));
>
> The correct way to do it is with a separate CREATE INDEX command:
I think I had initially abandoned looking at that type of solution after
having run across this paragraph in the docs while looking for the
proper constraint syntax:
"Note: The preferred way to add a unique constraint to a table is ALTER
TABLE ... ADD CONSTRAINT. The use of indexes to enforce unique
constraints could be considered an implementation detail that should not
be accessed directly."
The subliminal mind is a powerful force eh? Perhaps that paragraph
should be modified... but I'm not sure if it should expanded to include
thoughts along the lines of Stephan's response or maybe just drop the
"should not be accessed directly" bit...
Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: xzilla@users.sourceforge.net, tgl@sss.pgh.pa.us
Subject: Re: partial unique constraint
In-Reply-To: <1081269521.31791.73.camel@camel>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox