Re: named parameters in SQL functions - Mailing list pgsql-hackers

From Greg Stark
Subject Re: named parameters in SQL functions
Date
Msg-id 407d949e0911151121y1c706cbdge9a00d6b9263d62c@mail.gmail.com
Whole thread Raw
In response to Re: named parameters in SQL functions  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: named parameters in SQL functions
Re: named parameters in SQL functions
List pgsql-hackers
On Sun, Nov 15, 2009 at 6:26 PM, David E. Wheeler <david@kineticode.com> wrote:
>> Moreover you would still have conflicts possible because sql can quote
>> identifiers so people can have columns named "$foo". You would have a
>> weird syntactic detail where "$foo" would mean something different
>> than $foo even though they're both valid identifiers.
>
> Same with Foo and "Foo", no?

No, that's not the same.

The point is that $ is a perfectly valid SQL identifier character and
$foo is a perfectly valid identifier. You can always quote any
identifier (yes, after case smashing) so you would expect if $foo is a
valid identifier then "$foo" would refer to the same identifier.
You're introducing a meaning for $foo but saying there's no valid way
to quote the identifier to get the same thing. And worse, if you do
quote it you get something else entirely different.

-- 
greg


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Summary and Plan for Hot Standby
Next
From: "David E. Wheeler"
Date:
Subject: Re: named parameters in SQL functions