argument of AND must not return a set when using regexp_matches

From: Robert James <srobertjames(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: argument of AND must not return a set when using regexp_matches
Date: 2013-01-16 22:28:41
Message-ID: CAGYyBgiUSJ9AvwQ54zgbLi7-U9dDC3mmLXBvLuaGXCDPpVAu_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've been getting a funny SQL error, which I've boiled down to this case.

SELECT (regexp_matches('abc', '(.)b(.)'))[1] IS NOT NULL
-- Returns true, as expected

SELECT (regexp_matches('abc', '(.)b(.)'))[1] IS NOT NULL AND true
-- Gives this error:
ERROR: argument of AND must not return a set
SQL state: 42804

Can anyone make heads or tails of it? Is it a real bug? Is there a work around?

Postgres 8.3

Responses

Browse pgsql-general by date

  From Date Subject
Next Message T. E. Lawrence 2013-01-16 22:41:12 Re: reducing number of ANDs speeds up query RESOLVED
Previous Message Andrew Sullivan 2013-01-16 22:17:46 Re: Best method to compare subdomains