| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | David Johnston <polobo(at)yahoo(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: type aliases |
| Date: | 2014-02-15 17:25:01 |
| Message-ID: | 24951.1392485101@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
David Johnston <polobo(at)yahoo(dot)com> writes:
> James Harper wrote
>> So suppose I wanted to implement myvarchar in C. In my _in function, how
>> do I know how big my column declaration is? Eg if someone tries to insert
>> 50 characters into my 42 character field, how do I get the declared length
>> and then tell postgres that the data to be inserted is too big?
> There is no current way for a function body to examine the type modifiers of
> its input, domain or otherwise.
Actually the point here is to know the required type modifier of the
*output*. Type input functions do get passed the target typmod, as a
separate argument. See varcharin() for an example.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Antman, Jason (CMG-Atlanta) | 2014-02-15 18:15:04 | Re: Restore postgresql data directory to tablespace on new host? Or swap tablespaces? |
| Previous Message | David Johnston | 2014-02-15 15:57:44 | Re: type aliases |