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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Require callers of coerce_to_domain() to supply base type/typmod
Date: 2025-01-29 20:42:27
Message-ID: E1tdEtH-004HKu-IF@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Langote 2025-01-30 02:58:47 pgsql: Move PartitionPruneInfo out of plan nodes into PlannedStmt
Previous Message Tom Lane 2025-01-29 20:32:14 pgsql: Handle default NULL insertion a little better.