develooper Front page | perl.dbd.pg | Postings from January 2012

Re: Inconsistent behaviour with Dollar-quoted String Constants

Thread Previous | Thread Next
From:
Andrew Dunstan
Date:
January 8, 2012 15:33
Subject:
Re: Inconsistent behaviour with Dollar-quoted String Constants
Message ID:
4F0A27B8.8020401@dunslane.net


On 01/08/2012 03:51 PM, David E. Wheeler wrote:
> 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?

Any non-ASCII character qualifies. From scan.l:

    dolq_start      [A-Za-z\200-\377_]
    dolq_cont       [A-Za-z\200-\377_0-9]
    dolqdelim       \$({dolq_start}{dolq_cont}*)?\$


cheers

andrew



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About