Re: dollar quoting and pg_dump - Mailing list pgsql-hackers

From Tom Lane
Subject Re: dollar quoting and pg_dump
Date
Msg-id 21156.1080058965@sss.pgh.pa.us
Whole thread Raw
In response to Re: dollar quoting and pg_dump  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: dollar quoting and pg_dump
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> A thought: maybe just put this logic into the regular
>> appendStringLiteral routine, and trigger it when the string contains any
>> quotes or backslashes; if it has none, you can just use quotes ...

> I did think of fallback, but rejected it on the KISS principle :-)  I 
> also prefer consistency in style - I want all my functions dollar quoted 
> even if they don't currently contain characters in need of escape.

Good point.  Never mind that idea then.

>> Might be a good idea to make it disablable with a
>> fallback to regular quoting.

> Makes sense. "-X disable-dollar-quoting"? Or we could have it turned off 
> by default and require it to be specifically turned on - that might 
> conform to the principle of least surprise, at least for now.

I don't mind if it's on by default; just thinking that some people might
appreciate a way to turn it off.  "-X disable-dollar-quoting" sounds
fine.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: dollar quoting and pg_dump
Next
From: Sailesh Krishnamurthy
Date:
Subject: Re: linked list rewrite