Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-05 Thread Andrew Dunstan
David E. Wheeler wrote: On Jun 5, 2010, at 7:02 AM, Tom Lane wrote: From a usability point of view, if we adopt the spec's syntax we have to stop allowing => for any other purpose. Period. What if we added a new "dual" type and limited the => operator only to that type, being, ess

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-05 Thread David E. Wheeler
On Jun 5, 2010, at 7:02 AM, Tom Lane wrote: > From a usability point of view, if we adopt the spec's syntax we have to > stop allowing => for any other purpose. Period. What if we added a new "dual" type and limited the => operator only to that type, being, essentially, a constructor. Then hsto

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-05 Thread Pavel Stehule
2010/6/5 Greg Stark : > On Sat, Jun 5, 2010 at 3:02 PM, Tom Lane wrote: >> No, that really isn't going to work: how will the parser know that the >> names are not meant to match to actual named parameters of the function? >> You could possibly do it with a special case for hstore() in the >> gramm

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-05 Thread Tom Lane
Greg Stark writes: > I wonder if we could offer something like VARIADIC but allows > arbitrarily named parameters which get passed in a hstore-like hash > instead of an array. Just thinking aloud here. I haven't thought about > what this would mean in the function call api. Yeah, with an extra ke

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-05 Thread Greg Stark
On Sat, Jun 5, 2010 at 3:02 PM, Tom Lane wrote: > No, that really isn't going to work: how will the parser know that the > names are not meant to match to actual named parameters of the function? > You could possibly do it with a special case for hstore() in the > grammar, but we aren't going ther

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-05 Thread Tom Lane
Joseph Adams writes: > Here's a thought: suppose we did use the foo (name => value) syntax > for naming parameters. It could still be used in a very similar way > for hstore: > hstore(key1 => 'value1', key2 => 'value2') No, that really isn't going to work: how will the parser know that the nam

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-04 Thread Joseph Adams
On Fri, Jun 4, 2010 at 9:55 PM, Joseph Adams wrote: > If I had to choose between => and := for parameter naming, I'd go with > := because it seems more SQLish to me. On second thought, => might actually be a very intuitive syntax for defining dictionary types like hstore and json, since it matche

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-04 Thread Joseph Adams
On Wed, May 26, 2010 at 9:28 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, May 26, 2010 at 8:21 PM, Tom Lane wrote: >>> If we go with the spec's syntax I think we'd have no realistic choice >>> except to forbid => altogether as an operator name.  (And no, I'm not >>> for that.) > >> I sup

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Andrew Dunstan
Jan Wieck wrote: That is a sad wart that we should never have done, IMNSHO (it was before my time or I would have objected ;-) ). But beyond that, = is an operator in SQL and := is never an operator, IIRC. As far as I can tell, this was already in the code when Bruce moved it into core as

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Jan Wieck
On 5/27/2010 11:52 PM, Andrew Dunstan wrote: Bruce Momjian wrote: Peter Eisentraut wrote: On tor, 2010-05-27 at 12:59 -0400, Tom Lane wrote: I think we should fix it now. Quick thought: maybe we could use FOR instead of AS: select myfunc(7 for a, 6 for b);

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Bruce Momjian
David E. Wheeler wrote: > On Jun 3, 2010, at 8:53 AM, Dimitri Fontaine wrote: > > > Now that it's pretty clear from Peter that the standard is not going to > > change its choice here, I'll vote adding a WARNING each time an operator > > called => is created, so that we get a chance to move later o

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > Thinking some more, what is the value of keeping => in hstore for 9.0? > > Backwards compatibility. You have not made any argument today that we > have not been over many times before. I do not have time to argue > about this today --- I have to go fi

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread David E. Wheeler
On Jun 3, 2010, at 8:53 AM, Dimitri Fontaine wrote: > Now that it's pretty clear from Peter that the standard is not going to > change its choice here, I'll vote adding a WARNING each time an operator > called => is created, so that we get a chance to move later on. Should support for ==> be adde

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread David E. Wheeler
On Jun 3, 2010, at 8:54 AM, Tom Lane wrote: >> Thinking some more, what is the value of keeping => in hstore for 9.0? > > Backwards compatibility. You have not made any argument today that we > have not been over many times before. I do not have time to argue > about this today --- I have to go

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Tom Lane
Bruce Momjian writes: > Thinking some more, what is the value of keeping => in hstore for 9.0? Backwards compatibility. You have not made any argument today that we have not been over many times before. I do not have time to argue about this today --- I have to go fix max_standby_delay.

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Dimitri Fontaine
Bruce Momjian writes: > Is telling hstore users they have to change => to something else such a > large major version incompatibility that it is worth supporting and > documenting two syntaxes for parameter assignment? It is that calculus > that has me questioning our approach. Well it's not onl

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Bruce Momjian
Bruce Momjian wrote: > Tom Lane wrote: > > Bruce Momjian writes: > > > Are we sure we want hstore compatibility to drive this decision? > > > > hstore is what it is, and has been that way for a long time. We can't > > just ignore it. And I don't think breaking it (and probably other code) > > o

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Robert Haas
On Thu, Jun 3, 2010 at 11:34 AM, Bruce Momjian wrote: > Tom Lane wrote: >> Bruce Momjian writes: >> > Are we sure we want hstore compatibility to drive this decision? >> >> hstore is what it is, and has been that way for a long time.  We can't >> just ignore it.  And I don't think breaking it (an

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > Are we sure we want hstore compatibility to drive this decision? > > hstore is what it is, and has been that way for a long time. We can't > just ignore it. And I don't think breaking it (and probably other code) > on zero notice is an acceptable outc

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Tom Lane
Bruce Momjian writes: > Are we sure we want hstore compatibility to drive this decision? hstore is what it is, and has been that way for a long time. We can't just ignore it. And I don't think breaking it (and probably other code) on zero notice is an acceptable outcome.

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-03 Thread Bruce Momjian
Peter Eisentraut wrote: > On m?n, 2010-05-31 at 18:23 -0400, Tom Lane wrote: > > My feeling is that (a) there is no hurry to do anything about an > > unreleased draft of the standard, and (b) perhaps Peter could lobby > > the committee to change the standard before it does get published. > > Give

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-06-01 Thread Peter Eisentraut
On mån, 2010-05-31 at 18:23 -0400, Tom Lane wrote: > My feeling is that (a) there is no hurry to do anything about an > unreleased draft of the standard, and (b) perhaps Peter could lobby > the committee to change the standard before it does get published. Given that Oracle and DB2 already suppor

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Pavel Stehule
2010/6/1 Tom Lane : > "David E. Wheeler" writes: >> On May 31, 2010, at 7:40 PM, Robert Haas wrote: >>> I was going to propose ==> across the board. > >> What about -> ? > > hstore already uses that for something else. > > Robert's idea isn't a bad one if we're forced to rename the operator. > I'd

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Tom Lane
Bruce Momjian writes: > Tom Lane wrote: >> I'd still like to know exactly how hard the concrete has set on the >> SQL spec draft, first. (Peter?) > I don't know, but based on the fact it matches Oracle, I think it is > pretty well set by now. Eh? The SQL committee has a very long track record

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Robert Haas
On Mon, May 31, 2010 at 11:36 PM, Tom Lane wrote: > "David E. Wheeler" writes: >> On May 31, 2010, at 7:40 PM, Robert Haas wrote: >>> I was going to propose ==> across the board. > >> What about -> ? > > hstore already uses that for something else. > > Robert's idea isn't a bad one if we're force

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Bruce Momjian
Tom Lane wrote: > "David E. Wheeler" writes: > > On May 31, 2010, at 7:40 PM, Robert Haas wrote: > >> I was going to propose ==> across the board. > > > What about -> ? > > hstore already uses that for something else. > > Robert's idea isn't a bad one if we're forced to rename the operator. > I

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Tom Lane
"David E. Wheeler" writes: > On May 31, 2010, at 7:40 PM, Robert Haas wrote: >> I was going to propose ==> across the board. > What about -> ? hstore already uses that for something else. Robert's idea isn't a bad one if we're forced to rename the operator. I'd still like to know exactly how ha

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread David E. Wheeler
On May 31, 2010, at 7:40 PM, Robert Haas wrote: > I was going to propose ==> across the board. What about -> ? D -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Robert Haas
On Mon, May 31, 2010 at 9:24 PM, Florian Pflug wrote: > On Jun 1, 2010, at 0:23 , Tom Lane wrote: >> "David E. Wheeler" writes: >>> On May 31, 2010, at 8:56 AM, Andrew Dunstan wrote: I don't have strong feelings about the timing - I'd be very surprised if := were to be used in this con

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Florian Pflug
On Jun 1, 2010, at 0:23 , Tom Lane wrote: > "David E. Wheeler" writes: >> On May 31, 2010, at 8:56 AM, Andrew Dunstan wrote: >>> I don't have strong feelings about the timing - I'd be very surprised if := >>> were to be used in this context for any other purpose, so I don't think >>> we'd be bit

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Tom Lane
"David E. Wheeler" writes: > On May 31, 2010, at 8:56 AM, Andrew Dunstan wrote: >> I don't have strong feelings about the timing - I'd be very surprised if := >> were to be used in this context for any other purpose, so I don't think we'd >> be biting ourselves too much by just using that now. B

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread David E. Wheeler
On May 31, 2010, at 8:56 AM, Andrew Dunstan wrote: > I don't have strong feelings about the timing - I'd be very surprised if := > were to be used in this context for any other purpose, so I don't think we'd > be biting ourselves too much by just using that now. But if we do that, we > should d

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Dimitri Fontaine
Pavel Stehule writes: > it's not important in this discussion. Important is using some usual > symbol '=' or special symbol '=>'. Our syntax is probably only one > possible solution in this moment (there are minimum controversy), bud > semantic isn't best. Using same operator as assign statement u

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Bruce Momjian
Andrew Dunstan wrote: > > > Bruce Momjian wrote: > > MSSQL? Are you sure? This is the example posted in this thread: > > > > EXEC dbo.GetItemPrice @ItemCode = 'GXKP', @PriceLevel = 5 > > > > and it more matches our := syntax than => in its argument ordering. > > > > I think you are seri

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Andrew Dunstan
Bruce Momjian wrote: MSSQL? Are you sure? This is the example posted in this thread: EXEC dbo.GetItemPrice @ItemCode = 'GXKP', @PriceLevel = 5 and it more matches our := syntax than => in its argument ordering. I think you are seriously confused, or else you are seriously confu

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Pavel Stehule
2010/5/31 Bruce Momjian : > Pavel Stehule wrote: >> 2010/5/31 Bruce Momjian : >> > Pavel Stehule wrote: >> >> >> Part of the earlier discussion was about how => was a tempting >> >> >> operator name and other users may well have chosen it precisely >> >> >> because it's so evocative. But we don't a

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Bruce Momjian
Pavel Stehule wrote: > 2010/5/31 Bruce Momjian : > > Pavel Stehule wrote: > >> >> Part of the earlier discussion was about how => was a tempting > >> >> operator name and other users may well have chosen it precisely > >> >> because it's so evocative. But we don't actually have any evidence of > >>

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Pavel Stehule
2010/5/31 Bruce Momjian : > Pavel Stehule wrote: >> >> Part of the earlier discussion was about how => was a tempting >> >> operator name and other users may well have chosen it precisely >> >> because it's so evocative. But we don't actually have any evidence of >> >> that. Does anyone have any ex

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Bruce Momjian
Pavel Stehule wrote: > >> Part of the earlier discussion was about how => was a tempting > >> operator name and other users may well have chosen it precisely > >> because it's so evocative. But we don't actually have any evidence of > >> that. Does anyone have any experience seeing => operators in

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Andrew Dunstan
Tom Lane wrote: Bruce Momjian writes: Yes, but if we are going to have to honor "=>" eventually, shouldn't we just do it now? Supporting := and => seems confusing. Personally, I haven't accepted the "if" part of that, therefore I feel no need to argue over the "then".

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Pavel Stehule
2010/5/31 Bruce Momjian : > Greg Stark wrote: >> On Mon, May 31, 2010 at 3:59 PM, Tom Lane wrote: >> > Not breaking hstore, as well as any third-party modules that might be >> > using that operator name. ?Did you not absorb any of the discussion >> > so far? >> > >> >> In fairness most of the disc

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Tom Lane
Greg Stark writes: > If => is sql standard syntax then perhaps that changes the calculus. Well, it *isn't* standard, yet at least. All we have is a report of the current wording of a draft that's at least a year from release. regards, tom lane -- Sent via pgsql-hackers

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Bruce Momjian
Greg Stark wrote: > On Mon, May 31, 2010 at 3:59 PM, Tom Lane wrote: > > Not breaking hstore, as well as any third-party modules that might be > > using that operator name. ?Did you not absorb any of the discussion > > so far? > > > > In fairness most of the discussion about breaking hstore was p

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Greg Stark
On Mon, May 31, 2010 at 3:59 PM, Tom Lane wrote: > Not breaking hstore, as well as any third-party modules that might be > using that operator name.  Did you not absorb any of the discussion > so far? > In fairness most of the discussion about breaking hstore was prior to our learning that the sq

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > Yes, but if we are going to have to honor "=>" eventually, shouldn't we > > just do it now? Supporting := and => seems confusing. > > Personally, I haven't accepted the "if" part of that, therefore I > feel no need to argue over the "then". Right, I a

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Tom Lane
Bruce Momjian writes: > Yes, but if we are going to have to honor "=>" eventually, shouldn't we > just do it now? Supporting := and => seems confusing. Personally, I haven't accepted the "if" part of that, therefore I feel no need to argue over the "then". regards, tom l

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > Tom Lane wrote: > >> So as far as I can tell, no one is opposed to replacing "expr AS name" > >> with "name := expr" in the named-parameter syntax. Obviously we had > >> better get this done before beta2. Is anyone actually working on the > >> code/doc

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Pavel Stehule
2010/5/31 Tom Lane : > Bruce Momjian writes: >> Tom Lane wrote: >>> So as far as I can tell, no one is opposed to replacing "expr AS name" >>> with "name := expr" in the named-parameter syntax.  Obviously we had >>> better get this done before beta2.  Is anyone actually working on the >>> code/doc

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Tom Lane
Bruce Momjian writes: > Tom Lane wrote: >> So as far as I can tell, no one is opposed to replacing "expr AS name" >> with "name := expr" in the named-parameter syntax. Obviously we had >> better get this done before beta2. Is anyone actually working on the >> code/docs changes? If not, I'll pic

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Pavel Stehule
2010/5/31 Bruce Momjian : > Tom Lane wrote: >> So as far as I can tell, no one is opposed to replacing "expr AS name" >> with "name := expr" in the named-parameter syntax.  Obviously we had >> better get this done before beta2.  Is anyone actually working on the >> code/docs changes?  If not, I'll

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-31 Thread Bruce Momjian
Tom Lane wrote: > So as far as I can tell, no one is opposed to replacing "expr AS name" > with "name := expr" in the named-parameter syntax. Obviously we had > better get this done before beta2. Is anyone actually working on the > code/docs changes? If not, I'll pick it up. If we eventually ar

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-30 Thread Tom Lane
So as far as I can tell, no one is opposed to replacing "expr AS name" with "name := expr" in the named-parameter syntax. Obviously we had better get this done before beta2. Is anyone actually working on the code/docs changes? If not, I'll pick it up. regards, tom lane

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Dimitri Fontaine
Heikki Linnakangas writes: > On 28/05/10 19:19, Josh Berkus wrote: >> EXEC dbo.GetItemPrice @ItemCode = 'GXKP', @PriceLevel = 5 > > Once you solve the problem of finding the '='s in the source, replacing them > is exactly the same effort regardless of what you replace them with. I guess it would

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Robert Haas
On Fri, May 28, 2010 at 10:08 AM, Pavel Stehule wrote: > 2010/5/28 Tom Lane : >> Heikki Linnakangas writes: Peter Eisentraut  writes: > How about > select myfunc(a := 7, b := 6); >> >>> If we go with that, should we make some preparations to allow => in the >>> future? Like provide a

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Tom Lane
Andrew Dunstan writes: > Yeah. Whether or not we ever implement it really doesn't matter, IMO. We > should not be in the business of taking an SQL standard piece of syntax > and using it for some other purpose. Evidently the 201x SQL standard has blindsided us twice: first by defining a syntax

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Tom Lane
Josh Berkus writes: > Since former SQL Server / Sybase apps are the most likely to use named > parameter notation in PostgreSQL, having a syntax which could be ported > using only "sed" would be nice. I fear you're vastly overestimating the ability of sed to distinguish between = used in this w

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Heikki Linnakangas
On 28/05/10 19:19, Josh Berkus wrote: ( parameter := value ) notation is not only consistent with what is used inside pl/pgsql, it's also more consistent than "AS" with SQL Server's named parameter notation, which is: EXEC dbo.GetItemPrice @ItemCode = 'GXKP', @PriceLevel = 5 Since former SQL Se

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Andrew Dunstan
Bruce Momjian wrote: Josh Berkus wrote: Since former SQL Server / Sybase apps are the most likely to use named parameter notation in PostgreSQL, having a syntax which could be ported using only "sed" would be nice. Relevant to the whole discussion, though ... is the conflicting SQL stan

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Bruce Momjian
Josh Berkus wrote: > Since former SQL Server / Sybase apps are the most likely to use named > parameter notation in PostgreSQL, having a syntax which could be ported > using only "sed" would be nice. > > Relevant to the whole discussion, though ... is the conflicting SQL > standard syntax somet

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Josh Berkus
What's poor about it? It probably comes from PLSQL which in turn got it from Ada, so they aren't just making this up. I agree it's inconvenient for us, but that's a different issue. Further, the ( parameter := value ) notation is not only consistent with what is used inside pl/pgsql, it's als

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Andrew Dunstan
Tom Lane wrote: Heikki Linnakangas writes: Peter Eisentraut writes: How about select myfunc(a := 7, b := 6); If we go with that, should we make some preparations to allow => in the future? Like provide an alternative operator name for hstore's =>, and add a note so

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Pavel Stehule
2010/5/28 Tom Lane : > Heikki Linnakangas writes: >>> Peter Eisentraut  writes: How about select myfunc(a := 7, b := 6); > >> If we go with that, should we make some preparations to allow => in the >> future? Like provide an alternative operator name for hstore's =>, and >> add a note so

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Tom Lane
Heikki Linnakangas writes: >> Peter Eisentraut writes: >>> How about >>> select myfunc(a := 7, b := 6); > If we go with that, should we make some preparations to allow => in the > future? Like provide an alternative operator name for hstore's =>, and > add a note somewhere in the docs to disco

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Heikki Linnakangas
On 27/05/10 22:55, Tom Lane wrote: Peter Eisentraut writes: How about select myfunc(a := 7, b := 6); ? Hey, that's a thought. We couldn't have used that notation before because we didn't have := as a separate token, but since I hacked that in for plpgsql's benefit, I think it might be an eas

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Tom Lane
Andrew Dunstan writes: > Bruce Momjian wrote: >> One concern I have is that in PL/pgSQL, := and = behave the same, while >> in SQL, they would not. That might cause confusion. > I doubt there will be much confusion. I agree. Bruce is ignoring the fact that they are *not* interchangeable even i

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Andrew Dunstan
Bruce Momjian wrote: Peter Eisentraut wrote: On tor, 2010-05-27 at 12:59 -0400, Tom Lane wrote: I think we should fix it now. Quick thought: maybe we could use FOR instead of AS: select myfunc(7 for a, 6 for b); I'm afraid FOR doesn't work either; it'll cr

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Bruce Momjian
Peter Eisentraut wrote: > On tor, 2010-05-27 at 12:59 -0400, Tom Lane wrote: > > > I think we should fix it now. Quick thought: maybe we could use > > FOR > > > instead of AS: select myfunc(7 for a, 6 for b); > > > > I'm afraid FOR doesn't work either; it'll create a conflict with the > > spec-d

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread David Fetter
On Thu, May 27, 2010 at 02:55:54PM -0400, Robert Haas wrote: > On Thu, May 27, 2010 at 1:27 PM, David E. Wheeler > wrote: > > On May 27, 2010, at 9:59 AM, Tom Lane wrote: > > > >>> I think we should fix it now.  Quick thought: maybe we could use FOR > >>> instead of AS: select myfunc(7 for a, 6 f

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Pavel Stehule
2010/5/27 Tom Lane : > Peter Eisentraut writes: >> On tor, 2010-05-27 at 12:59 -0400, Tom Lane wrote: >>> I'm afraid FOR doesn't work either; it'll create a conflict with the >>> spec-defined SUBSTRING(x FOR y) syntax. > >> How about >> select myfunc(a := 7, b := 6); >> ? > > Hey, that's a thought

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > Peter Eisentraut writes: > > select myfunc(a := 7, b := 6); Kinda like it myself. > Question #1: is the SQL committee likely to standardize that out > from under us, too? Couldn't say on that one. > Question #2: will ecpg have a problem with this? Or p

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Tom Lane
Peter Eisentraut writes: > On tor, 2010-05-27 at 12:59 -0400, Tom Lane wrote: >> I'm afraid FOR doesn't work either; it'll create a conflict with the >> spec-defined SUBSTRING(x FOR y) syntax. > How about > select myfunc(a := 7, b := 6); > ? Hey, that's a thought. We couldn't have used that not

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Peter Eisentraut
On tor, 2010-05-27 at 12:59 -0400, Tom Lane wrote: > > I think we should fix it now. Quick thought: maybe we could use > FOR > > instead of AS: select myfunc(7 for a, 6 for b); > > I'm afraid FOR doesn't work either; it'll create a conflict with the > spec-defined SUBSTRING(x FOR y) syntax. How

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Robert Haas
On Thu, May 27, 2010 at 2:59 PM, David E. Wheeler wrote: > On May 27, 2010, at 11:55 AM, Robert Haas wrote: >> Or we could use the Finnish word >> epäjärjestelmällistyttämättömyydellänsäkäänköhän, which I'm pretty >> sure is not currently used in our grammar. > > I thought that was an Icelandic vo

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread David E. Wheeler
On May 27, 2010, at 11:55 AM, Robert Haas wrote: > Or we could use the Finnish word > epäjärjestelmällistyttämättömyydellänsäkäänköhän, which I'm pretty > sure is not currently used in our grammar. I thought that was an Icelandic volcano. Best, David -- Sent via pgsql-hackers mailing list (p

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Robert Haas
On Thu, May 27, 2010 at 1:27 PM, David E. Wheeler wrote: > On May 27, 2010, at 9:59 AM, Tom Lane wrote: > >>> I think we should fix it now.  Quick thought: maybe we could use FOR >>> instead of AS: select myfunc(7 for a, 6 for b); >> >> I'm afraid FOR doesn't work either; it'll create a conflict w

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread David E. Wheeler
On May 27, 2010, at 9:59 AM, Tom Lane wrote: >> I think we should fix it now. Quick thought: maybe we could use FOR >> instead of AS: select myfunc(7 for a, 6 for b); > > I'm afraid FOR doesn't work either; it'll create a conflict with the > spec-defined SUBSTRING(x FOR y) syntax. How about "I

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Tom Lane
Andrew Dunstan writes: > Peter Eisentraut wrote: >> In systems that have inheritance of composite types, this is used to >> specify which type the value is supposed to be interpreted as (for >> example, to treat the value as a supertype). Why don't they just use CAST() syntax for that, instead of

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Pavel Stehule
2010/5/26 Peter Eisentraut : > It turns out that the SQL standard uses the function call notation > > foo(this AS that) > > for something else: > > ::= > > ::= [ ] > > ::= [ [ { argument> }... ] ] > > ::= > | > | > > ::= AS user-defined type name> > > In systems that have inheri

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Peter Eisentraut
On tor, 2010-05-27 at 10:51 +0300, Heikki Linnakangas wrote: > On 27/05/10 10:49, Peter Eisentraut wrote: > > On tor, 2010-05-27 at 04:06 +0300, Heikki Linnakangas wrote: > >> On 27/05/10 03:57, Robert Haas wrote: > >>> Being compatible with the SQL > >>> standard and with Oracle is not to be taken

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Heikki Linnakangas
On 27/05/10 10:49, Peter Eisentraut wrote: On tor, 2010-05-27 at 04:06 +0300, Heikki Linnakangas wrote: On 27/05/10 03:57, Robert Haas wrote: Being compatible with the SQL standard and with Oracle is not to be taken lightly. I seem to be alone believing that the SQL standard doesn't say anyth

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Peter Eisentraut
On tor, 2010-05-27 at 04:06 +0300, Heikki Linnakangas wrote: > On 27/05/10 03:57, Robert Haas wrote: > > Being compatible with the SQL > > standard and with Oracle is not to be taken lightly. > > I seem to be alone believing that the SQL standard doesn't say anything > about named function parame

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Heikki Linnakangas
On 27/05/10 10:16, Pavel Stehule wrote: 2010/5/27 Heikki Linnakangas: On 27/05/10 09:50, Pavel Stehule wrote: 2010/5/27 Heikki Linnakangas: AFAIU, the standard doesn't say anything about named parameters. Oracle uses =>, but as you said, that's ambiguous with the =>operator. +1 for FOR.

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Pavel Stehule
2010/5/27 Abhijit Menon-Sen : > At 2010-05-27 08:50:18 +0200, pavel.steh...@gmail.com wrote: >> >> I don't see any advantage of "FOR". We can change ir to support new >> standard or don't change it. > > Adopting FOR would mean we don't use AS in a way that conflicts with the > standard. That's its

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Pavel Stehule
2010/5/27 Heikki Linnakangas : > On 27/05/10 09:50, Pavel Stehule wrote: >> >> 2010/5/27 Heikki Linnakangas: >>> >>> AFAIU, the standard doesn't say anything about named parameters. Oracle >>> uses >>> =>, but as you said, that's ambiguous with the =>  operator. >>> >>> +1 for FOR. >> >> I don't se

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Abhijit Menon-Sen
At 2010-05-27 08:50:18 +0200, pavel.steh...@gmail.com wrote: > > I don't see any advantage of "FOR". We can change ir to support new > standard or don't change it. Adopting FOR would mean we don't use AS in a way that conflicts with the standard. That's its only advantage. But I agree with you, I

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-27 Thread Heikki Linnakangas
On 27/05/10 09:50, Pavel Stehule wrote: 2010/5/27 Heikki Linnakangas: AFAIU, the standard doesn't say anything about named parameters. Oracle uses =>, but as you said, that's ambiguous with the => operator. +1 for FOR. I don't see any advantage of "FOR". Any advantage over AS? It doesn't c

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Pavel Stehule
2010/5/27 Robert Haas : > On Wed, May 26, 2010 at 9:28 PM, Tom Lane wrote: >> Robert Haas writes: >>> On Wed, May 26, 2010 at 8:21 PM, Tom Lane wrote: If we go with the spec's syntax I think we'd have no realistic choice except to forbid => altogether as an operator name.  (And no, I'm

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Pavel Stehule
2010/5/27 Tom Lane : > Robert Haas writes: >> On Wed, May 26, 2010 at 8:21 PM, Tom Lane wrote: >>> If we go with the spec's syntax I think we'd have no realistic choice >>> except to forbid => altogether as an operator name.  (And no, I'm not >>> for that.) > >> I suppose the most painful thing a

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Pavel Stehule
2010/5/27 Heikki Linnakangas : > On 27/05/10 02:09, alvherre wrote: >> >> Excerpts from Andrew Dunstan's message of mié may 26 18:52:33 -0400 2010: >> >>> I think we should fix it now.  Quick thought: maybe we could use FOR >>> instead of AS: select myfunc(7 for a, 6 for b); IIRC the standard's >>>

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Pavel Stehule
>> > > I think we should fix it now.  Quick thought: maybe we could use FOR instead > of AS: select myfunc(7 for a, 6 for b); IIRC the standard's mechanism for > this is 'paramname => value', but I think that has problems because of our > possibly use of => as an operator - otherwise that would be

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Robert Haas
On Wed, May 26, 2010 at 9:28 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, May 26, 2010 at 8:21 PM, Tom Lane wrote: >>> If we go with the spec's syntax I think we'd have no realistic choice >>> except to forbid => altogether as an operator name.  (And no, I'm not >>> for that.) > >> I sup

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Tom Lane
Robert Haas writes: > On Wed, May 26, 2010 at 8:21 PM, Tom Lane wrote: >> If we go with the spec's syntax I think we'd have no realistic choice >> except to forbid => altogether as an operator name.  (And no, I'm not >> for that.) > I suppose the most painful thing about doing that is that it wo

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Heikki Linnakangas
On 27/05/10 03:57, Robert Haas wrote: Being compatible with the SQL standard and with Oracle is not to be taken lightly. I seem to be alone believing that the SQL standard doesn't say anything about named function parameters. Can someone point me to the relevant section of the standard? As

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Robert Haas
On Wed, May 26, 2010 at 8:21 PM, Tom Lane wrote: > alvherre writes: >> The problem with the => operator seems best resolved as not accepting >> such an operator in a function parameter, which sucks but we don't seem >> to have a choice. > > "Sucks" is not the word; "utterly unacceptable" is the w

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Tom Lane
alvherre writes: > The problem with the => operator seems best resolved as not accepting > such an operator in a function parameter, which sucks but we don't seem > to have a choice. "Sucks" is not the word; "utterly unacceptable" is the word. Having an expression mean different things depending

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Heikki Linnakangas
On 27/05/10 02:09, alvherre wrote: Excerpts from Andrew Dunstan's message of mié may 26 18:52:33 -0400 2010: I think we should fix it now. Quick thought: maybe we could use FOR instead of AS: select myfunc(7 for a, 6 for b); IIRC the standard's mechanism for this is 'paramname => value', but

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread David E. Wheeler
On May 26, 2010, at 4:09 PM, alvherre wrote: > The problem with the => operator seems best resolved as not accepting > such an operator in a function parameter, which sucks but we don't seem > to have a choice. Perhaps we could allow "=>" to resolve as the > operator for the case the user really

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread alvherre
Excerpts from Andrew Dunstan's message of mié may 26 18:52:33 -0400 2010: > I think we should fix it now. Quick thought: maybe we could use FOR > instead of AS: select myfunc(7 for a, 6 for b); IIRC the standard's > mechanism for this is 'paramname => value', but I think that has > problems be

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Andrew Dunstan
Peter Eisentraut wrote: It turns out that the SQL standard uses the function call notation foo(this AS that) for something else: ::= ::= [ ] ::= [ [ { }... ] ] ::= | | ::= AS In systems that have inheritance of composite types, this is used to specify which type the

[HACKERS] functional call named notation clashes with SQL feature

2010-05-26 Thread Peter Eisentraut
It turns out that the SQL standard uses the function call notation foo(this AS that) for something else: ::= ::= [ ] ::= [ [ { }... ] ] ::= | | ::= AS In systems that have inheritance of composite types, this is used to specify which type the value is supposed to be inte

  1   2   >