From: Tom Lane on 27 May 2010 12:59 Andrew Dunstan <andrew(a)dunslane.net> 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 adding this unnecessary syntax wart? If their complaint is that CAST() is too much typing, perhaps they could adopt :: cast notation ;-) > 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. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Tom Lane on 27 May 2010 15:55 Peter Eisentraut <peter_e(a)gmx.net> 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 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 easy fix. It'd be nice that it puts the argument name first like the spec syntax, too. Question #1: is the SQL committee likely to standardize that out from under us, too? Question #2: will ecpg have a problem with this? Or psql for that matter (can you have a psql variable named '=')? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Pavel Stehule on 27 May 2010 16:02 2010/5/27 Tom Lane <tgl(a)sss.pgh.pa.us>: > Peter Eisentraut <peter_e(a)gmx.net> 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 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 easy fix. Â It'd be > nice that it puts the argument name first like the spec syntax, too. I can live with it. Regards Pavel > > Question #1: is the SQL committee likely to standardize that out > from under us, too? > > Question #2: will ecpg have a problem with this? Â Or psql for that > matter (can you have a psql variable named '=')? > > Â Â Â Â Â Â Â Â Â Â Â Â regards, tom lane > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers > -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: "David E. Wheeler" on 27 May 2010 13:27 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 "ISPARAMVALUEFOR"? That shouldn't conflict with anything. Best, David -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: David Fetter on 27 May 2010 18:03
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 <david(a)kineticode.com> 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 with the > >> spec-defined SUBSTRING(x FOR y) syntax. > > > > How about "ISPARAMVALUEFOR"? That shouldn't conflict with anything. > > 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. We could use the Turkish muvaffakiyetsizleştiricileştiriveremeyebileceklerimizdenmişsinizcesine, which I'm pretty sure isn't either :) Cheers, David. -- David Fetter <david(a)fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter(a)gmail.com iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |