Re: massive quotes? - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: massive quotes?
Date
Msg-id 3F60CD29.7090205@dunslane.net
Whole thread Raw
In response to Re: massive quotes?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian wrote:

>Something that includes "'" would be clearest. I thought of <' and '>,
>but this would break:
>  
>
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.

[snip]

>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.
>
>  
>
Quite cute. I like it better than the here-document style.

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



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Another small bug (pg_autovacuum)
Next
From: Tom Lane
Date:
Subject: Re: massive quotes?