Re: massive quotes?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: massive quotes?
Дата
Msg-id 354.1063309126@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: massive quotes?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: massive quotes?  (Jon Jensen <jon@endpoint.com>)
Re: massive quotes?  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Something that includes "'" would be clearest. I thought of <' and '>,
> but this would break:
>    if var <'yes'

People seem to be assuming that this feature needs to be impervious to
whitespace and being adjacent to other things.  I believe we could make
it a good deal more robust if both the opening and closing markers
(whatever they are) are required to stand alone on a line.  For example
{'}'

represents the empty string, and
{'    x = 'text';}'

represents '\tx = \'text\';'.  I think the rule would need to be that
the newline just after the opening marker, and the newline just before
the closing marker, are not included in the resulting string literal.

The point is we don't have to make case like {'xxx}' be recognized as an
occurrence of this construct, and on the whole I think it's a lot safer
if we don't.  Keep in mind that the string you are trying to quote is
often code in a language that is not SQL.  Therefore, choosing markers
on the grounds that they won't appear in SQL is not good enough.
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: massive quotes?
Следующее
От: Jon Jensen
Дата:
Сообщение: Re: massive quotes?