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

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_restore (libpq? parser?) bug in 8
Date: 2004-08-13 01:45:11
Message-ID: 6.1.1.1.0.20040813113553.063442d8@203.8.195.10
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 11:42 PM 12/08/2004, Tom Lane wrote:
>That's a possibility, but I'd rather work around it by finding a way for
>pg_restore not to need to parse the dollar-quoted literal in the first
>place.

Two possibilities:

1) Parse the tags (I have the code working): it's not that hard, the only
trick bit being recognizing the tags in the first place. I have assumed
that any bare unquoted string that is not preceded by valid identifier name
chars, and which starts with a '$' may be a dollar quote. This seems valid
to me.

2) We could avoid special coding for TOC entry types (eg. pg_restore
knowing 'FUNCTION' TOC entries should not be parsed), by changing the TOC
data to include a flag/counter (set by pg_dump) indicating that the entry
contains > 1 statements. Then we don't hard code knowledge of TOC entry
types, and function definitions will not be parsed. Old dump files would be
treated as multi-statement, and still be parsed.

If my assumption in (1) is valid, then I have a very mild preference for
it, but am happy with either.

----------------------------------------------------------------
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 |/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-08-13 01:54:05 Re: [PATCHES] Patch for pg_dump: Multiple -t options and new -T option
Previous Message ntufar 2004-08-12 19:47:54 Re: Turkish downcasting in PL/pgSQL