Re: massive quotes?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: massive quotes?
Date: 2003-09-11 19:29:45
Message-ID: 3F60CD29.7090205@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-09-11 19:38:46 Re: massive quotes?
Previous Message Bruce Momjian 2003-09-11 19:02:23 Re: Another small bug (pg_autovacuum)