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

From Tom Lane
Subject Re: dollar-quoting in psql and in general
Date
Msg-id 24039.1092282599@sss.pgh.pa.us
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 <pjw@rhyme.com.au> writes:
> 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 documentation for dollar-quoting is pretty awful at the moment, as
it seems to have been pasted in with no thought to context, and is
incomplete anyway.  I have on my to-do list to go over it, but if
someone else beats me to it I won't pout.

> The section on dollar-quoting is also not explicit about valid tags, "zero 
> or more characters" is all I can see.

Use the source, Luke ... scan.l explains

/* $foo$ style quotes ("dollar quoting")* The quoted string starts with $foo$ where "foo" is an optional string* in the
formof an identifier, except that it may not contain "$", * and extends to the first occurrence of an identical string.
* There is *no* processing of the quoted text.*/
 
dolq_start        [A-Za-z\200-\377_]
dolq_cont        [A-Za-z\200-\377_0-9]
dolqdelim        \$({dolq_start}{dolq_cont}*)?\$
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_dump 'die_on_errors'
Next
From: Andrew Dunstan
Date:
Subject: Re: dollar-quoting in psql and in general