On Wed, Jun 18, 2008 at 12:39 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> None. There is no type coercion there --- what that is really
> specifying is invocation of the int data type's input function
> on the given string.
I thought that something like this may be this was the case.
> I don't think your approach is going to work; you would have to
> make your client programs emit things like
>
> insert into mytab(integercol) values (''::varchar)
>
> in order to get a runtime varchar-to-int cast to be applied.
> At that point you might as well fix them properly.
I see. Other than directly modifying int4in (is this the one?), is
there a way to plug-in our modified empty string handling logic? I'm
picturing a scenario where we write write a wrapper function that
tests for empty strings and returns NULL, else just calls into int4in,
and then dynamically load this function, and finally update the
corresponding rows in pg_proc? Is this even possible?
thanks for your explanation Tom,
Dave