Re: pg_restore (libpq? parser?) bug in 8

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: pg_restore (libpq? parser?) bug in 8
Дата
Msg-id 4181.24.211.141.25.1092301619.squirrel@www.dunslane.net
обсуждение исходный текст
Ответ на Re: pg_restore (libpq? parser?) bug in 8  (Philip Warner <pjw@rhyme.com.au>)
Ответы Re: pg_restore (libpq? parser?) bug in 8  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Philip Warner said:
> 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.
>
>


See the discussions that culminated here before Tom bit the bullet and
implemented a flex scanner for psql:

http://archives.postgresql.org/pgsql-patches/2004-02/msg00182.php

It's not as easy as you might think.

I had a thought that might short-circuit this - do we even need pg_dump to
use dollar quoting for non-text output, such as is required by pg_restore?
IIRC, the idea was to have text dumps that didn't undo what the user had
done in using dollar quoting, but I am not sure that consideration applies
to non-text output. Turning it off should be very easy - we already have the
switch.

Thoughts?

cheers

andrew




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: [COMMITTERS] pgsql-server: PostgreSQL extension makefile
Следующее
От: Harald Fuchs
Дата:
Сообщение: Re: Add Missing From?