pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ries@jongert.nl
To: pgsql-sql@postgresql.org
Subject: Re: partial unique constraint
Date: Tue, 6 Apr 2004 17:05:37 +0200
Message-ID: <001601c41be8$9ece4f60$fd01000a@IT001> (raw)
In-Reply-To: <1081261772.31785.48.camel@camel>

You should create a functional index here.

Ries

> -----Oorspronkelijk bericht-----
> Van: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]Namens Robert Treat
> Verzonden: dinsdag 6 april 2004 16:30
> Aan: pgsql-sql@postgresql.org
> Onderwerp: [SQL] partial unique constraint
> 
> 
> Trying to come up with the proper syntax to meet the 
> following criteria:
> 
> create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); 
> 
> note the above syntax is not correct, but should demonstrate what i'm
> trying to do; I want to add a unique constraint such that we 
> only allow
> one case of bar and baz = true...  i can have unlimited bar and baz =
> false, and there can be multiple bar and baz = true if the bars are
> different...  did some doc reading and mail list searching but a valid
> syntax for this seems to be escaping me... 
> 
> btw I'm pretty sure I could do this with an external trigger, but am
> wondering about a constraint oriented approach
> 
> Robert Treat
> -- 
> Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
> 
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
> 



view thread (9+ messages)  latest in thread

Message-ID: <001601c41be8$9ece4f60$fd01000a@IT001>
Permalink:  ../001601c41be8$9ece4f60$fd01000a@IT001/
Also on:    postgresql.org/message-id/001601c41be8$9ece4f60$fd01000a@IT001

 · 

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: ries@jongert.nl
  Subject: Re: partial unique constraint
  In-Reply-To: <001601c41be8$9ece4f60$fd01000a@IT001>

* 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