Thanks Tom, that worked!
On Mon, Mar 24, 2014 at 8:47 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
Ilya Ivanov <forn@xxxxxx> writes:Well, yeah. You need to convert the possibly-multiple match results into
> I need to find all active (status=0) items not belonging to any active
> trigger. The best I could come up with is this:
> select count(itemid) from items where status='0' and itemid not in (select
> cast(regexp_matches(_expression_,'{([^}]+)}','g') as integer) from triggers
> where status='0');
> However, the cast doesn't work:
> ERROR: cannot cast type text[] to integer
a set. Try putting unnest() around the regexp_matches call.
regards, tom lane
--
Ilya.