Search Postgresql Archives

Re: Escape handling in strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux