Re: pg_restore (libpq? parser?) bug in 8 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_restore (libpq? parser?) bug in 8
Date
Msg-id 23064.1092276920@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_restore (libpq? parser?) bug in 8  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: pg_restore (libpq? parser?) bug in 8
Re: pg_restore (libpq? parser?) bug in 8
Re: pg_restore (libpq? parser?) bug in 8
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> Con someone confirm how dollar quoting works:
>      '$[tag]$'
> where tag is alpha chars? any chars? \n? \r?

IIRC the tag is either empty or anything that looks like a
(dollar-sign-less) identifier.  But check the rules in scan.l to be sure.

> Is there any circumstance where an unquoted '$' is valid?

$n parameter identifiers (which is why the tag cannot start with
a digit).  Also, I believe $ can be embedded in identifiers (ie,
it can be a non-first character).  So a dollar quote can't be
adjacent to a preceding identifier.

IIRC we tried to do ad-hoc code for dollar quoting in psql, and gave it
up as a bad job.  You might need to bite the bullet and implement a flex
lexer.

Why exactly does pg_restore need to parse the SQL anyway?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Brian Hirt
Date:
Subject: Re: will PITR in 8.0 be usable for "hot spare"/"log shipping" type
Next
From: Philip Warner
Date:
Subject: Re: pg_restore (libpq? parser?) bug in 8