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

From Philip Warner
Subject Re: pg_restore (libpq? parser?) bug in 8
Date
Msg-id 6.1.1.1.0.20040812132807.05515138@203.8.195.10
Whole thread Raw
In response to Re: pg_restore (libpq? parser?) bug in 8  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_restore (libpq? parser?) bug in 8  ("Andrew Dunstan" <andrew@dunslane.net>)
List pgsql-hackers
At 12:15 PM 12/08/2004, Tom Lane wrote:
>You might need to bite the bullet and implement a flex
>lexer.

I'd like to avoid this if I can; AFAICT, for statement detection on 
pg_restore, I can require white space before the $tag. Since I also skip 
over all quoted text, the bodies of functions are ignored. The only issues 
will be attribute names with ' $' in them, but they will be quoted as well 
(so ignored).

So to recognize a tag, I look for a '$' after white space, and assume it's 
a tag start. If I subsequently read an invalid tag char, I just go back 
into scan mode on that character and assume the '$...' was some other valid 
sql element.
From other threads, it sounds like removing the statement detection code 
entirely is not an option.



----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 03 5330 3172          |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                 |    --________--
PGP key available upon request,  |  /
and from pgp.mit.edu:11371       |/ 



pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: pg_dump 'die_on_errors'
Next
From: Mark Kirkwood
Date:
Subject: Re: Coming soon: PG 7.4.4, 7.3.7, 7.2.5