Re: Identifying no-op length coercions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Identifying no-op length coercions
Date: 2011-05-23 20:41:06
Message-ID: 20501.1306183266@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> This was the thing that concerned me. If anyone wants to add this
> feature for a new data type they're going to have to understand and
> tie their code to all this internal parser node stuff. That means
> their code will be much more closely tied to a specific version, will
> have to be written in C, and will require much more in-depth
> understanding of Postgres internal data structures.

> By comparison the boolean cast predicate could be written in any
> language and only required the data type implementor to understand
> their data type. It seems much more likely to actually get used and be
> used correctly.

I don't think I believe that interesting length-conversion functions are
going to be written in anything but C anyway, so I don't find that that
argument holds much water. Generally, the low-level functions for a new
datatype have to be in C.

As for the other point, if all you want to do is examine the
expression's typmod, the API for that is pretty stable (exprTypmod()).

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-05-23 21:06:23 Re: SSI predicate locking on heap -- tuple or row?
Previous Message Greg Stark 2011-05-23 20:31:41 Re: Identifying no-op length coercions