"Dave Lee" <davelee.com@gmail.com> writes:
> 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?
There isn't any really nice way to do that :-(. You could put a wrapper
function around int4in but it would not help, because the internal API
for datatype input functions doesn't support having them return NULL
(see InputFunctionCall in the sources). If you don't want to fix your
clients then you'll really have little choice but to hack the Postgres
source code. The good news is there are probably not very places you'd
have to change, depending on exactly what contexts you need this to
happen in.
regards, tom lane