Re: massive quotes?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: massive quotes?
Дата
Msg-id 200309111851.h8BIpoi23263@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: massive quotes?  (Andreas Pflug <pgadmin@pse-consulting.de>)
Ответы Re: massive quotes?  (Andrew Dunstan <andrew@dunslane.net>)
Re: massive quotes?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Andreas Pflug wrote:
> Sergio A. Kessler wrote:
> 
> 
> >
> > Too sad, all special chars are used up for operators....
> 
> 
>  also '{' '}' are used ?
> 
> I've only seen this in ACLs, so it might be usable. Tom, Bruce?

Something that includes "'" would be clearest. I thought of <' and '>,
but this would break:
if var <'yes'

I think {' and '} might work.  Arrays are specified as '{val, val}',
which is safe because it is opposite of the suggested syntax.  I can't
think of any case where you would use an opening brace, then a single
quote.  Interestingly, it looks like a C braces:
CREATE FUNCTION test() ...{'    x = 'no';'}

Of course, this brings up a problem.  What if we do:

CREATE FUNCTION test() ...{'    x = '}text';'}

Oops, two closing mega-quotes.

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.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


В списке pgsql-hackers по дате отправления:

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