pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bryn Llewellyn <bryn@yugabyte.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Re: Where's the doc for "array()" — as in "select array(values (17), (42))"
Date: Mon, 19 Sep 2022 00:31:21 -0400
Message-ID: <257592.1663561881@sss.pgh.pa.us> (raw)
In-Reply-To: <C167E3BD-B650-4A8E-80A3-3307E70883C0@yugabyte.com>
References: <F2DA0774-0B4D-4E72-8944-116154A57D98@yugabyte.com>
	<e6ac86e5-39f4-9704-7260-3f6c40c63b2d@aklaver.com>
	<C167E3BD-B650-4A8E-80A3-3307E70883C0@yugabyte.com>

Bryn Llewellyn <bryn@yugabyte.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





view thread (12+ messages)  latest in thread

Message-ID: <257592.1663561881@sss.pgh.pa.us>
Permalink:  ../257592.1663561881@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/257592.1663561881@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bryn@yugabyte.com, adrian.klaver@aklaver.com
  Subject: Re: Where's the doc for "array()" — as in "select array(values (17), (42))"
  In-Reply-To: <257592.1663561881@sss.pgh.pa.us>
  References: <F2DA0774-0B4D-4E72-8944-116154A57D98@yugabyte.com> <e6ac86e5-39f4-9704-7260-3f6c40c63b2d@aklaver.com> <C167E3BD-B650-4A8E-80A3-3307E70883C0@yugabyte.com> <257592.1663561881@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox