Re: Re: Where's the doc for "array()" — as in "select array(values (17), (42))"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Re: Where's the doc for "array()" — as in "select array(values (17), (42))"
Date: 2022-09-19 04:31:21
Message-ID: 257592.1663561881@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bryn Llewellyn <bryn(at)yugabyte(dot)com> writes:
> Why is the "array()" constructor not found in "pg_proc"?

Because it isn't a function. Yeah, it kind of looks like one,
but its argument is a subquery. If SQL had first-class functions
and closures, maybe ARRAY() could be implemented as an ordinary
function. But I don't see any plausible way to do that as things
stand.

There are a bunch of other things that look like functions but
aren't in pg_proc, too :-(. Most of them are just catering to
the SQL committee's weird allergy to writing functions with
plain function syntax. But ARRAY()'s problem is semantic not
syntactic.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message misha1966 misha1966 2022-09-19 04:35:27 Re[4]: CVE-2022-2625
Previous Message David G. Johnston 2022-09-19 04:24:41 Re: Where's the doc for "array()" — as in "select array(values (17), (42))"