pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Horst Herb <hherb@malleenet.net.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: constraint via selection
Date: Sat, 17 Nov 2001 13:06:14 -0800 (PST)
Message-ID: <20011117122714.M31141-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <20011117125544.6028.qmail@gnumed.dhs.org>

On Sun, 18 Nov 2001, Horst Herb wrote:

> > What would the most efficient formulation of the "check" constraint be
> > in this case?
>
> Sorry, I probably should reformulate my question into "is there a more
> effficient constraint than a foreign key constraint for this simple
> problem"?

Hmm, it depends.  You probably can't manage it through check constraints
unless you knew the values (at which point you might not even the other
table) since I'm pretty sure we don't support check constraints with
subselects in them. It's possible that for your application you could
manage to make a trigger that beats the foreign key constraint and
do it that way.





view thread (4+ messages)

Message-ID: <20011117122714.M31141-100000@megazone23.bigpanda.com>
Permalink:  ../20011117122714.M31141-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20011117122714.M31141-100000@megazone23.bigpanda.com

 · 

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: sszabo@megazone23.bigpanda.com, hherb@malleenet.net.au
  Subject: Re: constraint via selection
  In-Reply-To: <20011117122714.M31141-100000@megazone23.bigpanda.com>

* 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