Search Postgresql Archives

Re: migrating from mysql: need to convert empty string to null

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Dave Lee" <davelee.com@xxxxxxxxx> writes:
> I've read src/backend/utils/fmgr/README and it states that returning
> NULL is just a matter of setting isnull to true in the
> FunctionCallInfo struct, and provides a convenience macro,
> PG_RETURN_NULL. But then, in InputFunctionCall, I presume you're
> referring to the logic that that only allows NULL to be returned if
> the source input string is also NULL, otherwise raising an error. At a
> basic level, you're suggesting I need to take out this NULL check in
> InputFunctionCall to get the capability I'm looking for?

No, I'm stating it as a fact that that won't work.  You'd have to
change InputFunctionCall's API so that it could pass back a null to
its callers.

> Any idea why the input functions were designed this way?

Per above, and the fact that the behavior you're proposing is a 
complete violation of the SQL spec (yeah, I know Oracle does it too).

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux