From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chapman Flack <jcflack@acm.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: FmgrInfo allocation patterns (and PL handling as staged programming)
Date: Mon, 07 Apr 2025 13:34:49 -0400
Message-ID: <3531057.1744047289@sss.pgh.pa.us> (raw)
In-Reply-To: <67F40ACD.7040507@acm.org>
References: <67F2B767.9040507@acm.org>
<2965818.1743960827@sss.pgh.pa.us>
<2968353.1743962392@sss.pgh.pa.us>
<67F40ACD.7040507@acm.org>
Chapman Flack <jcflack@acm.org> writes:
> This was really bumming me out. I thought "what on earth does that do
> to the rest of your surrounding query, say if you have anyelement types
> in the args or return value also?".
> So the answer to that part is easy: if a routine's types include both
> anyarray and anyelement (like, say, unnest), it just can't be applied
> to one of those statistics columns. An attempt to use it that way in
> a query is rejected early, before any attempt to call the routine:
> ERROR: cannot determine element type of "anyarray" argument
> STATEMENT: select unnest(stavalues1) from pg_statistic limit 1;
Right. AFAIK the oddity doesn't "leak out" of functions taking
anyarray.
> That seems to make for a tidy way of recognizing the situation. If
> you go to specialize and find anyarray among your supposedly-resolved
> call-site types, well, you know you're in Wonderland and can adjust
> behavior accordingly.
Cool.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, jcflack@acm.org
Subject: Re: FmgrInfo allocation patterns (and PL handling as staged programming)
In-Reply-To: <3531057.1744047289@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