Christopher Kings-Lynne wrote: > > I think we can tell people in 8.1 that they should modify their > > applications to only use '', and that \' might be a security problem in > > the future. If we get to that then using ESC or not only affects input > > of values and literal backslashes being entered, and my guess is that > > 90% of the backslash entries that want escaping are literal in the > > application and not supplied by program variables. In fact, if we > > disable backslash by default then strings coming in only have to deal > > with single quotes (like other databases) and the system is more secure > > because there is no special backslash handling by default. > > I can tell you right now this will be a problem :) There are loads of > PHP ppl who use addslashes() instead of pg_escape_string() to escape data.
I read the PHP addslashes() manual page: http://us3.php.net/addslashes First, I see what people mean about PHP having most of the complex content in comments, rather than in the actual manual text, and this tendency is certainly something we want to avoid --- you end up having to digest all the comments to find the details that should be in the manual already. On to the case at hand, the comments mention that addslashes() isn't safe for all databases, and in fact isn't the prefered method. I do think it could be a problem we have to have people avoid. One idea for 8.1 is to throw a warning if \' appears in a string, thereby helping people find the places they are using the incorrect non-standard escaping. -- 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 ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])