Re: Escape handling in strings

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Escape handling in strings
Дата
Msg-id 200506212331.j5LNVcJ09444@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Escape handling in strings  ("Ed L." <pgsql@bluepolka.net>)
Список pgsql-general
Ed L. wrote:
> On Tuesday June 21 2005 12:49 pm, Bruce Momjian wrote:
> > I have received very few replies to my suggestion that we
> > implement E'' for escaped strings, so eventually, after a few
> > major releases, we can have '' treat backslashes literally
> > like the SQL standard requires.
> >
> > I assume this is because most people say, "yea, it is going to
> > be a pain, and yea, we should probably do it".
>
> I read the webpage, but its still a little muddy.  Can you
> clarify/summarize the class of applications, and which dumps
> starting with 7.2*, will fail on clusters with this patch unless
> they are modified?

Well, postgresql.conf controls the warnings, until perhaps 8.3 where a
backslash in a string becomes literal, and \n is treated as \ and n, and
\\ is treated as \ and \, and \' is treated as \ and the end of the
string, and the rest of the string is part of the query, which is really
bad.

So, move \' to '', and when you get to 8.3 you need to use E'' for
escapes.

Dumps from releases before 8.1 might have problems loading in the CREATE
statements, but the COPY format is the same as before.

--
  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, Pennsylvania 19073

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

Предыдущее
От: Roman Neuhauser
Дата:
Сообщение: Re: Postfix/Maildrop and too many connections issues
Следующее
От: Gregory Youngblood
Дата:
Сообщение: Re: Postfix/Maildrop and too many connections issues