Re: dollar-quoting in psql and in general

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dollar-quoting in psql and in general
Date: 2004-08-12 03:53:12
Message-ID: 411AE9A8.4000402@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2004-08-12 04:32:46 Re: pg_dump 'die_on_errors'
Previous Message Tom Lane 2004-08-12 03:49:59 Re: dollar-quoting in psql and in general