David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> Suggest wrapping it in a function - or making a "regexp_matches_single"
> function that behaves similarly but returns a single text[] instead of a
> SETOF text[]
I wonder if we should have such a thing built-in. This isn't the first
complaint we've heard about the SETOF API being awkward to use, and it's
only needed if you specify the 'g' flag. Perhaps we could have a variant
that forbids 'g' and returns a non-set (either the single match, or NULL).
regards, tom lane