On Jan 7, 2012, at 6:49 AM, [email protected] wrote:

> It seems like $2 is interpreted as placeholder before the evaluation of 
> Dollar-quoting, but only in $db->selectrow_hashref().
> The inconsistent part is that $db->do() works just fine.

It probably wouldn’t if you passed parameters to it.

Anyway, the ppg 
docs](http://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html) say 
about dollar quoting:

“The tag, if any, of a dollar-quoted string follows the same rules as an 
unquoted identifier, except that it cannot contain a dollar sign.”

And for an unquoted identifier, they say:

“SQL identifiers and key words must begin with a letter (a-z, but also letters 
with diacritical marks and non-Latin letters) or an underscore (_). Subsequent 
characters in an identifier or key word can be letters, underscores, digits 
(0-9), or dollar signs ($).”

Does 北 qualify as a non-Latin letter? If you can create a table with that 
character, it’s valid. I just tried:

    CREATE TABLE 北 (it int);

And it worked. So this looks like a bug in DBD::Pg, which recognizes dollar 
quoting when it parses for placeholders, but not to the letter of the 
documentation, I guess.

Would you mind reporting this bug by sending an email to 
[email protected], so that we can remain aware of it?

But I suspect it won’t be a priority for anyone to fix, since you can just use 
an ASCII character (or just `$$` -- no tag) as a pretty low-bar workaround.

Best,

Dasvid


Reply via email to