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: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dollar-quoting in psql and in general
Date: 2004-08-12 02:47:15
Message-ID: 23348.1092278835@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:
> While trying to understand dollar-quoting, I found the following in psql:
> select $a$ hello $a$;

> behaves as expected, but psql does not like

> select $a$ \ $a$;
> or
> select $a$ \\ $a$;

Define "does not like". The behavior seems correct to me.

> Should it? How should a dollar-quote handle:
> $a$ \$a\$a $a$

The value of that is " \$a\$a ". Backslashes are not special inside
dollar quotes --- nor is anything else, except the matching close tag.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2004-08-12 02:56:16 Re: pg_restore (libpq? parser?) bug in 8
Previous Message Tom Lane 2004-08-12 02:43:30 Re: pg_restore (libpq? parser?) bug in 8