public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Marthin Laubscher <[email protected]>
Cc: [email protected]
Subject: Re: Custom type's modifiers
Date: Thu, 27 Jun 2024 11:06:27 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
Marthin Laubscher <[email protected]> writes:
> But now I need to (re)define MyType to support type modifiers (e.g. MyType(1,14,18)) and I got that done using CREATE TYPE’s TYPMOD_IN and TYPMOD_OUT parameters resulting in the correct packed value getting stored in pg_attribute when I define a column of that type.
OK ...
> But when I pass a MyType value to a function defined in my C extension how would I access the type modifier value for the argument which could have been drawn from the catalog or the result of a cast.
You can't. Whatever info is needed by operations on the type had
better be embedded in the value.
regards, tom lane
view thread (4+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Custom type's modifiers
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox