Re: subqueries in check

Lists: pgsql-hackers
From: Jaime Casanova <systemguards(at)yahoo(dot)com>
To: pgsql hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: subqueries in check
Date: 2005-01-08 05:06:58
Message-ID: 20050108050658.44793.qmail@web50001.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

i was looking at the unsuported features in the RC4
docs and found this:

F671| Enhanced integrity management| Subqueries in
CHECK| intentionally omitted

Why is it *intentionally omitted*?
Is it to hard? or has some side-effects?

just a question!

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com


From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Jaime Casanova <systemguards(at)yahoo(dot)com>
Cc: pgsql hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: subqueries in check
Date: 2005-01-09 16:14:57
Message-ID: 20050109161457.GE4194@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jan 07, 2005 at 11:06:58PM -0600, Jaime Casanova wrote:

Jaime,

> i was looking at the unsuported features in the RC4
> docs and found this:
>
> F671| Enhanced integrity management| Subqueries in CHECK| intentionally omitted
>
> Why is it *intentionally omitted*?
> Is it to hard? or has some side-effects?

Because it's too expensive to check. If you have a CHECK using a SELECT
against a second table, you should re-verify the SELECT every time the
second table suffers an UPDATE, INSERT or DELETE.

The user can replace the CHECK with a foreign key or a trigger, so there
is no loss of functionality.

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"No single strategy is always right (Unless the boss says so)"
(Larry Wall)