Re: Help with array constraints - Mailing list pgsql-general

From Joe Conway
Subject Re: Help with array constraints
Date
Msg-id 3E8C75D4.6020500@joeconway.com
Whole thread Raw
In response to Re: Help with array constraints  (Jason Hihn <jhihn@paytimepayroll.com>)
List pgsql-general
Jason Hihn wrote:
> Ah that's more like what I'm looking for. I have to attempt a select of the
> new letter in the contrainted-to table. If it finds it, success! If the
> contrainted-to table has an index, it should be very fast no matter how many
> letters it's being constrained against...
> "SELECT NEW.letter FROM constraint_table WHERE letter=id"
> if null set raise exception.

I didn't follow this thread in its entirety, but it sounds like you need
an "array contains element x" function for use as a trigger? I think
there may be something that does that already in contrib/array or
contrib/intarray (I see you're not using int arrays, but maybe you could
port the C code).


> I would have thought this would be built in? Can it be?
>

I'm currently working on a fairly major upgrade to array support. No
promises on exactly what will make it into 7.4, but I'm planning to look
at contrib/array and contrib/intarray and rewrite or move as much of it
as makes sense into the backend (subject of course to acceptance of the
patches).

Joe


pgsql-general by date:

Previous
From: "Tamir Halperin"
Date:
Subject: Re: Anyone know of a news group for mysql?
Next
From: "scott.marlowe"
Date:
Subject: Re: 'DROP INDEX' kills stored rpocedures