Re: Custom type's modifiers

From: Marthin Laubscher <postgres(at)lobeshare(dot)co(dot)za>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Custom type's modifiers
Date: 2024-06-27 15:49:08
Message-ID: 0390C71D-93CD-4CE5-A2E6-324076967BAC@lobeshare.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024/06/27, 17:06, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
> You can't. Whatever info is needed by operations on the type had better be embedded in the value.

OK, thanks, that's clear and easy enough. I'll ensure the the third parameter to the input function is embedded in my opaque value.

I don't see another function getting passed the value so I'd assume that (unless I return a MyType value from one of my own functions which would follow its internal logic to determine which type modifiers to use) the only way a MyType can get an initial value is via the input function. If the type is in a table column the input function would be called with the default value specified in external format if a value isn't specified during insert, but either way it would always originate from the eternal format. I suppose when a cast is involved it goes via the external format as well, right?

Are those sound assumptions to make or am I still way off base here?

--- Thanks for your time - Marthin Laubscher

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2024-06-27 16:12:25 Re: Custom type's modifiers
Previous Message Simone G. 2024-06-27 15:34:50 Re: ClientRead on ROLLABACK