dollar quoting and pg_dump - Mailing list pgsql-hackers

From Andrew Dunstan
Subject dollar quoting and pg_dump
Date
Msg-id 40605306.5040603@dunslane.net
Whole thread Raw
Responses Re: dollar quoting and pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I had a brief look at this today. Basically, I thought of adding a new 
routine to dumputils.c thus:
   void appendStringLiteralDQ(PQExpBuffer buf, const char *str, const 
char *dqprefix)

and using it in dumping function bodies and comments on all objects, 
with a prefix argument of "function" and "comment" respectively. There 
might be other places where we want to use dollar quoting, but this 
would be a good start, ISTM.

Basically, this routine would start with $ (+ dqprefix if not null) and 
then keep adding characters (in turn "_1234567890") until that string 
was not found in str, then appending "$" and using that as the delimiter.

Thoughts?

cheers

andrew




pgsql-hackers by date:

Previous
From: Shachar Shemesh
Date:
Subject: postgres on windows page update
Next
From: Tom Lane
Date:
Subject: Re: dollar quoting and pg_dump