Re: dollar-quoting in psql and in general - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: dollar-quoting in psql and in general
Date
Msg-id 411AE9A8.4000402@dunslane.net
Whole thread Raw
In response to Re: dollar-quoting in psql and in general  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers

Philip Warner wrote:

> At 01:07 PM 12/08/2004, Andrew Dunstan wrote:
>
>> \ is not magical inside dollar quotes,
>
>
> Sorry, I was confused by the manual: the paragraph that starts 
> "C-style backslash escapes are also available..." is right after the 
> paragraphs on dollar-quoting.
>
> The section on dollar-quoting is also not explicit about valid tags, 
> "zero or more characters" is all I can see. Can you give me a 
> definitive answer as to what is valid? AFAICT, must be 
> [A-Z,a-z,0-9,_]*, with non-numeric start. Is that right?
>
>

Don't forget the high-bit chars too. pgsqlscan.l says:

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

The scanner files for plpgsql and the backend have equivalent specs, so 
this is definitive.

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: dollar-quoting in psql and in general
Next
From: Philip Warner
Date:
Subject: Re: pg_dump 'die_on_errors'