pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chapman Flack <jcflack@acm.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Peter Eisentraut <peter@eisentraut.org>
Subject: Re: FmgrInfo allocation patterns (and PL handling as staged programming)
Date: Tue, 15 Apr 2025 10:52:09 -0400
Message-ID: <1570495.1744728729@sss.pgh.pa.us> (raw)
In-Reply-To: <67FDA91C.1060909@acm.org>
References: <67F2B767.9040507@acm.org>
	<2965818.1743960827@sss.pgh.pa.us>
	<67F2D87F.1000709@acm.org>
	<2978258.1743968866@sss.pgh.pa.us>
	<67F30DDA.4000509@acm.org>
	<3112950.1743984111@sss.pgh.pa.us>
	<67F31F20.6090706@acm.org>
	<3291225.1743993461@sss.pgh.pa.us>
	<67FDA91C.1060909@acm.org>

Chapman Flack <jcflack@acm.org> writes:
> On 04/06/25 22:37, Tom Lane wrote:
>> BTW, I feel a little uncomfortable with the idea that we're adding
>> dependencies on objects that are explicitly mentioned nowhere in the
>> pg_proc entry.

> Pursuing that idea a bit further, was there a compelling original reason
> the column in pg_proc had to be protrftypes and not just protransforms?

The problem from a PL's standpoint is "given this input or output
of type FOO, should I transform it, and if so using what?".  So
the starting point has to be a type not a transform.  The lookups
are implemented by get_transform_tosql and get_transform_fromsql,
and if you look at those you find that the protrftypes data is used
as a filter before attempting a pg_transform lookup.  If the pg_proc
entry contained transform OIDs we'd have to filter after the lookup,
which is pretty inefficient, especially if you expect that the normal
case is that there's not an applicable transform.

So I agree with storing protrftypes.  Maybe we should also have stored
a parallel array of transform OIDs, but it'd be just to make the
dependency more obvious, and maybe it's not worth the storage space.

			regards, tom lane





view thread (15+ messages)

Message-ID: <1570495.1744728729@sss.pgh.pa.us>
Permalink:  ../1570495.1744728729@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1570495.1744728729@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jcflack@acm.org, peter@eisentraut.org
  Subject: Re: FmgrInfo allocation patterns (and PL handling as staged programming)
  In-Reply-To: <1570495.1744728729@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