pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: G. Anthony Reina <reina@nsi.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: Can I CONSTRAIN a particular value to be UNIQUE?
Date: Thu, 29 Nov 2001 16:11:09 -0500
Message-ID: <23663.1007068269@sss.pgh.pa.us> (raw)
In-Reply-To: <3C06A32C.18856CA6@nsi.edu>
References: <f40d3195.0111291101.3b2a5074@posting.google.com>
	<23371.1007066300@sss.pgh.pa.us>
	<3C06A32C.18856CA6@nsi.edu>

"G. Anthony Reina" <reina@nsi.edu> writes:
> Oooooo! Option #2 seems very nice for what I'm trying to do. Would there be
> any problem with me using

> CREATE UNIQUE INDEX pk1 ON table1 (subject, target, trial) WHERE success = 1;
> CREATE UNIQUE INDEX pk0 ON table1 (subject, target, trial) WHERE success = 0;

> i.e. 2 partial indicies on the same table?

Not at all, but if those are the only two possible values of "success"
then it would seem this is the same as one non-partial unique index.
If you're thinking of allowing other, unconstrained success values then
this could make sense.

> I know PG7.2 is still in beta, but it might be worthwhile for me to make the
> jump from 7.1.3 for this feature. If I upgrade to the beta, will I have to do
> a dump/restore again when the official 7.2 release comes out?

We try to avoid forcing initdb after we start the beta cycle, but we
make no guarantees until we go final.  FWIW, at this point I doubt we'll
need to do that.

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <23663.1007068269@sss.pgh.pa.us>
Permalink:  ../23663.1007068269@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23663.1007068269@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, reina@nsi.edu
  Subject: Re: Can I CONSTRAIN a particular value to be UNIQUE?
  In-Reply-To: <23663.1007068269@sss.pgh.pa.us>

* 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