[ Moved to pgsql-general. pgsql-hackers is for development of PostgreSQL
On Mon, 2011-07-25 at 20:06 -0300, Alexandre Savaris wrote:
> ********** Error **********
> ERRO: input function 49344 returned NULL
> SQL state: XX000
> Character: 45
> It seems like the call to PG_RETURN_NULL() on the input function is
> causing the error. Is this the correct behaviour? There's another way to
> return a NULL value as the result of a data type's input function?
The docs say:
"The input function must return a value of the data type itself."
Which means you can't return a NULL from the input function when there
is non-NULL input. The context around that statement is a little more
informative, but perhaps it could be more clear.
I assume that postgresql has that requirement because it needs to know
whether something is NULL without necessarily knowing what type it is.
' ' IS NULL
Should that be true or false? If it depends on the type of the
left-hand-side, how do you figure out what type it is? I'm not sure if
this is the exact reason it's prohibited, but it seems like there would
be a problem somewhere along these lines.
Interesting idea though.
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2011-07-26 03:25:18|
|Subject: Re: Error calling PG_RETURN_NULL() |
|Previous:||From: Jerry Sievers||Date: 2011-07-26 02:59:46|
|Subject: Re: Check constraints on partition parents only?|
pgsql-general by date
|Next:||From: Tom Lane||Date: 2011-07-26 03:19:55|
|Subject: Re: pgsql error |
|Previous:||From: Joe Conway||Date: 2011-07-26 00:45:35|
|Subject: Re: create table as select... with auto increment id ?|