pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Require callers of coerce_to_domain() to supply base type/typmod
Date: Wed, 29 Jan 2025 20:42:27 +0000
Message-ID: <E1tdEtH-004HKu-IF@gemulon.postgresql.org> (raw)

Require callers of coerce_to_domain() to supply base type/typmod.

In view of the issue fixed in commit 0da39aa76, it no longer seems
like a great idea for coerce_to_domain() to offer to perform a lookup
that its caller probably should have done already.  The caller should
be providing a value of the domain's base type, so it's hard to
envision a valid case where it hasn't looked up that type.  After
0da39aa76 there is only one caller using the option for internal
lookup, and that one can trivially be rearranged to not do that.
So this seems more like a bug-encouraging misfeature than a useful
shortcut; let's get rid of it (in HEAD only, there's no need to
break any external callers in back branches).

Discussion: https://postgr.es/m/1865579.1738113656@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ba0da16bd054de854c200a2dfa0b21c70e0300cf

Modified Files
--------------
src/backend/parser/parse_coerce.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)



Message-ID: <E1tdEtH-004HKu-IF@gemulon.postgresql.org>
Permalink:  ../E1tdEtH-004HKu-IF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tdEtH-004HKu-IF@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Require callers of coerce_to_domain() to supply base type/typmod
  In-Reply-To: <E1tdEtH-004HKu-IF@gemulon.postgresql.org>

* 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