pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Niall Smart <niall.smart@ebeon.com>
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problem with subquery in CHECK constraint.
Date: Thu, 08 Jun 2000 12:56:48 +0100
Message-ID: <393F8A00.1D2D4AB5@ebeon.com> (raw)
References: <000901bfd0df$f57c1f20$2801007e@tpf.co.jp>


CONSTRAINT TYPE_CD_OK CHECK (
	EXISTS (SELECT 1 FROM XREF WHERE 
			XREF_GROUP = 'CUST_TYPE' AND
			XREF_CD = TYPE_CD)
)


> There seems to be more serious problems.
> 1) The constraint is not only for the defined table but also for referenced
>     tables in the subquery.

I don't understand what you mean -- the constraint only
constrains 1 column in one table...

> 2) There should be some standard lock mechanism for the range restricted
>     by the subquery.
> 
> I'm suspicious that we should/could implement constraints other than
> column constraints.

Again, I don't fully understand what you're saying; but I
have successfully implemented the constraint using a user
defined function.

Niall



view thread (7+ messages)  latest in thread

Message-ID: <393F8A00.1D2D4AB5@ebeon.com>
Permalink:  ../393F8A00.1D2D4AB5@ebeon.com/
Also on:    postgresql.org/message-id/393F8A00.1D2D4AB5@ebeon.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: niall.smart@ebeon.com, Inoue@tpf.co.jp
  Subject: Re: Problem with subquery in CHECK constraint.
  In-Reply-To: <393F8A00.1D2D4AB5@ebeon.com>
  References: <000901bfd0df$f57c1f20$2801007e@tpf.co.jp> <393F8A00.1D2D4AB5@ebeon.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