Re: Backslash handling in strings

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Backslash handling in strings
Дата
Msg-id 87sm04vxoc.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Backslash handling in strings  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Backslash handling in strings  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Backslash handling in strings  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:

> The goal, at some point, is that we would have two types of strings, ''
> strings and E'' strings.  '' strings don't have any special backslash
> handling for compatibility with with the ANSI spec and all other
> databases except MySQL (and in MySQL it is now optional).  E'' strings
> behave just like our strings do now, with backslash handling.


The only thing I'm not clear on is what exactly is the use case for E''
strings. That is, who do you expect to actually use them?

Any new applications are recommended to be using '' strings. And any existing
applications obviously won't be using them since they don't currently exist.

The only potential candidates are existing applications being ported forward.
And that only makes sense if they're currently using some function like
addslash. Is it really easier to change all the SQL queries to use E'' (and
still have a bug) than it is to replace addslash with PQquoteString() ?



Also, I'm really confused why you would make PQescapeString require E''
strings and introduce a new function. That means existing non-buggy
applications would suddenly be buggy? And it would be impossible to write a
properly functioning application that interpolates a constant into a query
that would be portable to 8.2 and 8.0?


-- 
greg



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Consumer-grade vs enterprise-grade disk drives
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Consumer-grade vs enterprise-grade disk drives