Re: Custom type's modifiers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Custom type's modifiers
Date
Msg-id 1734255.1719500787@sss.pgh.pa.us
Whole thread Raw
In response to Custom type's modifiers  (Marthin Laubscher <postgres@lobeshare.co.za>)
Responses Re: Custom type's modifiers
List pgsql-hackers
Marthin Laubscher <postgres@lobeshare.co.za> 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’sTYPMOD_IN and TYPMOD_OUT parameters resulting in the correct packed value getting stored in pg_attribute when I
definea 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
theargument 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



pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Patch bug: Fix jsonpath .* on Arrays
Next
From: Tom Lane
Date:
Subject: Re: ClientRead on ROLLABACK