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