Re: "...integer[] references..." = error - Mailing list pgsql-general

From Stephan Szabo
Subject Re: "...integer[] references..." = error
Date
Msg-id 20020906081232.I79857-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: "...integer[] references..." = error  (Joel Rodrigues <borgempath@Phreaker.net>)
Responses Re: "...integer[] references..." = error  (Joel Rodrigues <borgempath@Phreaker.net>)
Re: "...integer[] references..." = error  (Joel Rodrigues <borgempath@Phreaker.net>)
List pgsql-general
On Fri, 6 Sep 2002, Joel Rodrigues wrote:

> Thanks for the info & hints guys. Sad really that the most
> obvious construct does not work. So, though I can get away with
> skipping the REFERENCES bit by using a VIEW.  I'd still like to
> have some sort of referential integrity checking. I'm puzzled
> about how to achieve this. I thought I'd do a CHECK with a
> subquery expression, but, "Currently, CHECK expressions cannot
> contain subselects". And it's not even on the TODO list. Foiled
> again !
>
>
> A bit of searching on Google Groups reveals that at least a few
> people have attempted to use "...integer[] references...". Hate
> to use the "o" word again, but it is really such an obvious
> construct both in it's conception and (optimistic)
> implementation.

Not really.  There are some performance issues and such surrounding
it.  Arrays are positional and not multisets, so you get some
wierdness at the conversion.

For example:
I have (3,4) in an array.  I update it to (4).  For foreign
key purposes, is this effectively a delete of 3 (ie no
check required) or a delete of 4 and a change of 3->4.
If the array has 100 elements and I remove the first one,
do I do 99 foreign key checks or do I try to determine
that's all that happened.  What if the rest of the elements
were randomly assorted?


pgsql-general by date:

Previous
From: Tycho Fruru
Date:
Subject: Re: What is 'Postgres'?
Next
From: "scott.marlowe"
Date:
Subject: Re: pb on installation