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 |/
---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings