Bruce Momjian wrote:
Something that includes "'" would be clearest. I thought of <' and '>,I'm not sure that using a quote is necessarily clearest. But it's a matter of taste. I had thought of {{ and }} as maybe working.
but this would break:
[snip]
Quite cute. I like it better than the here-document style.One clean way would be to use {' to start a quote, and }' to end it, so we have:
CREATE FUNCTION test() ... {' x = 'text'; }'
which looks even better and this is safe because both braces in '}text}' are seen in a quoted string:
CREATE FUNCTION test() ... {' x = '}text}'; }'
Also, I can't imagine anyone defining those as operators.
Is this proposed as a general quoting mechanism, or only in the context of "create function"? (I favor a general mechanism, if that matters :-) - I got caught three times in the last 2 weeks with embedded quotes in "comment on" statements.)
cheers
andrew
---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?
http://archives.postgresql.org