Re: dollar-quoting in psql and in general

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dollar-quoting in psql and in general
Date: 2004-08-12 03:49:59
Message-ID: 24039.1092282599@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)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 form of 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-08-12 03:53:12 Re: dollar-quoting in psql and in general
Previous Message Tom Lane 2004-08-12 03:34:13 Re: [HACKERS] SAVEPOINT syntax again