Bruce Momjian wrote:

Peter Eisentraut wrote:


David Fetter wrote:


Kind people,

Please find attached a diff to the SGML docs that attempts to go over
the new dollar quoting feature.


I think we should just use $$ in each case. Otherwise it might look more complicated than before.



Agreed. I was worried about dollar arguments in functions, e.g. $1: test=> select $$$1$$; ?column? ---------- $1 (1 row)

but that seems to be OK.  Is our only problem actual $$ in a function
body?  And there is no way of escaping that, right?  They have to choose
a different quote characters sequence.




The string inside $x$ is totally opaque and unescaped. The restriction on markers is that the string mustn't contain $x$, and mustn't end with $x, i.e., the scanners see $x$ and simply accumulate all the characters in the string until they see $x$ again - all 3 scanners (postgres, psql, plpgsql) work the same way on this.


Functions with arguments might need to be quoted with something other than plain $$, and in any case if their bodies make use of $$ they certainly will. pg_dump's approach to quoting function bodies is to start with $$ and then generate longer and longer markers until the marker without trailing $ is not found in the string comprising the function body. In most cases it ends up using $_$.

I hope that makes things clearer.

cheers

andrew


---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to