pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Niall Smart <niall.smart@ebeon.com>
Cc: pgsql-sql@postgresql.org
Subject: RE: Problem with subquery in CHECK constraint.
Date: Fri, 9 Jun 2000 03:01:50 +0900
Message-ID: <EKEJJICOHDIEMGPNIFIJGEJMCBAA.Inoue@tpf.co.jp> (raw)
In-Reply-To: <393F8A00.1D2D4AB5@ebeon.com>

> -----Original Message-----
> From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On 
> Behalf Of Niall Smart
> 
> 
> 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...
>

Doesn't the constraint mean that
	for any row in table CUST,there *always* exist some rows in
	the table XREF such that satisfies XREF_GROUP='CUST_TYPE'
	AND XREF_CD=TYPE_CD ?
If all such rows are deleted from the table XREF,above condition
isn't satisfied any longer. So isn't the constraint for the table XREF
either ?
 
Regards.

Hiroshi Inoue
Inoue@tpf.co.jp



view thread (7+ messages)  latest in thread

Message-ID: <EKEJJICOHDIEMGPNIFIJGEJMCBAA.Inoue@tpf.co.jp>
Permalink:  ../EKEJJICOHDIEMGPNIFIJGEJMCBAA.Inoue@tpf.co.jp/
Also on:    postgresql.org/message-id/EKEJJICOHDIEMGPNIFIJGEJMCBAA.Inoue@tpf.co.jp

 · 

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: Inoue@tpf.co.jp, niall.smart@ebeon.com
  Subject: Re: Problem with subquery in CHECK constraint.
  In-Reply-To: <EKEJJICOHDIEMGPNIFIJGEJMCBAA.Inoue@tpf.co.jp>
  References: <393F8A00.1D2D4AB5@ebeon.com> <EKEJJICOHDIEMGPNIFIJGEJMCBAA.Inoue@tpf.co.jp>

* 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