Re: Problem with subquery in CHECK constraint.

From: Niall Smart <niall(dot)smart(at)ebeon(dot)com>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Problem with subquery in CHECK constraint.
Date: 2000-06-08 11:56:48
Message-ID: 393F8A00.1D2D4AB5@ebeon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message mikeo 2000-06-08 12:20:10 Re: Re: [SQL] oracle rownum equivalent?
Previous Message Jan Wieck 2000-06-08 10:50:20 Re: