Re: Summary: changes needed in function defaults behavior

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Summary: changes needed in function defaults behavior
Date: 2008-12-18 09:11:29
Message-ID: 479DD92A-1622-456C-A0F3-33D243DD2D09@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Le 18 déc. 08 à 00:56, Tom Lane a écrit :

> "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
>> do you remember on request for using "default" keyword in funccall?
>> This should be solution. In view, you don't store select foo(11), but
>> you have to store select foo(11, default, default).
>
> Seems pretty ugly; keep in mind you'd be looking at that notation
> constantly (in \d, EXPLAIN, etc), not just in dumps.

Well, considering it could solve the issue at hand without semantics
revisiting, it doesn't seem that ugly to me. Forcing the users of
default arguments to see they are using them all over the places is
fine by me.

And being able to put in default explicitly when calling the function
could also be a nice feature for people auto-generating calling code.
From what we get on IRC it's far easier for people to special case
DEFAULT rather than special case list constructions, as already
possible in INSERT statements.

> I think the most conservative thing to do is to treat varying
> numbers of
> defaults as ambiguous for now. We can relax that later without
> breaking
> working code, but we couldn't go the other way if something else comes
> up.

If a user vote is worth anything, I'd vote for explicit default
notation please.

- -
dim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAklKE8EACgkQlBXRlnbh1blAUwCeOPUglnybmjL1DKCoq56mB5Te
12MAn3zLhPJihx8LTVN8luELQrHMEQrJ
=+htG
-----END PGP SIGNATURE-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-12-18 09:26:28 Re: Partitioning wiki page
Previous Message Nikhil Sontakke 2008-12-18 06:48:39 Re: Partitioning wiki page