Re: strange behavior with C function and DEFAULT function parameters - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: strange behavior with C function and DEFAULT function parameters
Date
Msg-id 52647A04.5030600@fuzzy.cz
Whole thread Raw
In response to strange behavior with C function and DEFAULT function parameters  (Tomas Vondra <tv@fuzzy.cz>)
List pgsql-hackers
On 21.10.2013 02:38, Tomas Vondra wrote:
> Hi,
> 
> I ran into some pretty strange behavior of C-language function and
> default parameter values, both on 9.2 and 9.4devel. Consider for example
> this trivial C function:
> 
>     Datum
>     show_bug(PG_FUNCTION_ARGS) {
>     elog(WARNING, "called ;-)");
>     PG_RETURN_VOID();
>     }
> 
> which is accessed using this definition:
> 
>     CREATE FUNCTION show_bug(a TEXT DEFAULT NULL)
>     RETURNS void
>     AS 'bug.so'
>     LANGUAGE C STRICT;

Meh, never mind. About a second after submitting the message I've
noticed I defined the function STRICT, so it's actually absolutely
correct behavior.

Sorry for the noise.

Tomas



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: strange behavior with C function and DEFAULT function parameters
Next
From: Andrew Dunstan
Date:
Subject: Re: strange behavior with C function and DEFAULT function parameters