| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Marthin Laubscher <postgres(at)lobeshare(dot)co(dot)za> |
| Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Custom type's modifiers |
| Date: | 2024-06-27 15:06:27 |
| Message-ID: | 1734255.1719500787@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Marthin Laubscher <postgres(at)lobeshare(dot)co(dot)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’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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2024-06-27 15:21:38 | Re: ClientRead on ROLLABACK |
| Previous Message | David E. Wheeler | 2024-06-27 15:05:31 | Re: Patch bug: Fix jsonpath .* on Arrays |