From: | Greg Stark <gsstark(at)mit(dot)edu> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Issues for named/mixed function notation patch |
Date: | 2009-08-09 23:01:38 |
Message-ID: | 407d949e0908091601o613a159dt994bd08ad262405c@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, Aug 9, 2009 at 7:30 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 1. As I already mentioned, I think the mixed-notation business is a bad
> idea. It's unintuitive, it's not especially useful, and it substantially
> increases our risk of being semantically incompatible with whatever the
> SQL committee might someday do in this area. I think we should disallow
> it until we see what they do. I gather that this might be an unpopular
> position though.
It seems like we could safely allow the cases which are unambiguous.
Namely where the call has a sequence of unnamed parameters followed by
some named parameters all of which refer to parameters which come
later.
So foo(1,2,3 as x,4 as y) would be legal as long as x and y were not
one of the first three arguments.
That's a pretty common idiom when you have a function which does
something normal to the first few arguments and then has a bunch of
non-standard modes which can be optionally invoked. Take for example
the perl DBI's connect method which takes a data source, username,
authentication token, then a list of parameters which can be any of
dozens of parameters (actually it takes a fifth argument which is a
hashref -- but the point here is just that it's a common style, not
that we should be copying perl's solution).
The reason I'm saying this is safe is because there's just no other
possible interpretation. As long as it only covers the unambiguous
cases then there's no other meaning other implementations can define
which this would conflict with.
From | Date | Subject | |
---|---|---|---|
Next Message | Petr Jelinek | 2009-08-09 23:05:49 | Re: GRANT ON ALL IN schema |
Previous Message | Peter Eisentraut | 2009-08-09 22:47:59 | pgsql: Ship documentation without intermediate tarballs Documentation |