Re: massive quotes?

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: massive quotes?
Дата
Msg-id 3F60CD29.7090205@dunslane.net
обсуждение исходный текст
Ответ на Re: massive quotes?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Another small bug (pg_autovacuum)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: massive quotes?