Re: WIP: default values for function parameters

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Grzegorz Jaskiewicz" <gj(at)pointblue(dot)com(dot)pl>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Subject: Re: WIP: default values for function parameters
Date: 2008-12-09 14:53:03
Message-ID: 162867790812090653t2f7690dbtb412fa13ed9c4189@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/12/9 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
>> select foo(777, three=> '{1,2,3,4,5});
>
>> it's more safe and more readable.
>
> ... and it breaks an operator that's already in use.
>
>> I did some test, and I thing so it is implementable. I had to solve
>> problem with hstore module. There is defined operator => too, what is
>> bad. But we can implemented in transformation and it should by
>> disabled via GUC, so it's solveable.
>
> What's wrong with the "expr AS parameter_name" syntax that we've
> discussed before? (And no, having a GUC that changes the meaning
> of "=>" isn't an acceptable workaround.)
>

what is acceptable workaround? I unhappy, so this symbol was used for
this minor contrib module (for this operator doesn't exists regress
test).

a) "AS" is used in diferent meaning now [rename] (SQL/XML), labels
b) when we implemented, then we blocking possible way, when ANSI SQL
generalise current behave
c) it's own syntax that will be muddly (viz a.)
d) both mayor databases has syntax name symbol value

@name = value
name => value

I am searching ways (or syntax) for two features named params, and
named values. Last are inspirated SQL/XML that is great (I know, so
your opinion is different). For export functions I need to send some
information about columns or labels into functions. So it's usable for
custom export functions, JSON implementation, maybe for
communications.

regards
Pavel Stehule

> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-12-09 14:57:38 posix_fadvise v22
Previous Message Merlin Moncure 2008-12-09 14:52:02 Re: multiple function execute using (func()).*