Re: Proposal to adjust typmod argument on base UDT input functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Octavio Alvarez <octalpg(at)alvarezp(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Proposal to adjust typmod argument on base UDT input functions
Date: 2025-08-08 05:18:45
Message-ID: 1782006.1754630325@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Octavio Alvarez <octalpg(at)alvarezp(dot)org> writes:
> On 8/7/25 22:46, Tom Lane wrote:
>> I don't really see how we could accept this? Wouldn't it break
>> every existing extension datatype that uses typmod?

> That was my first thought as well, but COPY sends the typmod directly
> already, so if they support COPY, they should already be compatible.

COPY is not the same context.

I'm not averse to doing something here, because it's certainly a mess
as mentioned by the comment right above your proposed patch. But this
patch looks like "let's break half the universe for the benefit of the
other half". (And, given the shortage of prior complaints, that's
being very generous about the proportion of data types that would
benefit.)

I think the way to move forward here would be to invent an explicit
datatype property that controls what to do. I'm too tired to think
through exactly what the definition of the property would be, but
I suspect it'd have something to do with whether implicit and explicit
coercion behaviors are supposed to differ.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-08-08 05:38:52 Re: Issue with logical replication slot during switchover
Previous Message Octavio Alvarez 2025-08-08 05:05:47 Re: Proposal to adjust typmod argument on base UDT input functions