Re: strange behavior with C function and DEFAULT function parameters

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: strange behavior with C function and DEFAULT function parameters
Date: 2013-10-21 00:49:08
Message-ID: 52647A04.5030600@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-10-21 00:54:44 Re: strange behavior with C function and DEFAULT function parameters
Previous Message Tomas Vondra 2013-10-21 00:38:07 strange behavior with C function and DEFAULT function parameters