Re: Odd array issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Odd array issue
Date: 2009-01-21 14:46:18
Message-ID: 1399.1232549178@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> writes:
> The following query should return 2 records, but returns zero instead:

> test=> select x, regexp_matches(x::text, 'm')
> test-> FROM generate_series(1,2) AS x;
> x | regexp_matches
> ---+----------------
> (0 rows)

No, that's correct. The SRF returns an empty set, so there are no
output records. The behavior you seem to be imagining would make it
impossible to distinguish empty set from a single row containing NULL.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2009-01-21 14:57:48 Re: autovacuum daemon
Previous Message Craig Ringer 2009-01-21 14:33:03 Odd array issue