Re: [ dspam-Bug Tracker-3023888 ] Wrong escaping of bytea (signature data) with postgresql 8.4

Stevan Bajić <[email protected]>
Newsgroups gmane.mail.spam.dspam.devel
Message-ID <[email protected]>
On Mon, 23 Aug 2010 08:06:49 +0200
Alban Hertroys <[email protected]> wrote:


> This is almost certainly due to the user having changed the PostgreSQL setting 'standard_conforming_strings' to 'on'. Admittedly that would be the preferable way to interpret strings, but it's not the default (compatibility reasons mostly).
> 
> dspam=> SHOW standard_conforming_strings ;
>  standard_conforming_strings 
> -----------------------------
>  off
> (1 row)
> 
Okay. Let's say I want to fix the PostgreSQL driver to take care of that setting.
If that setting is turned ON then a string can have backslashes and they would NOT be considered as escape characters. Right? So something like 'this\is\a\small\test' would be the same as using E'this\\is\\a\\smal\\test'. Right? But for someone NOT setting 'standard_conforming_strings' to 'on' the string 'this\is\a\small\test' would produce the wrong result. So either I have to check for 'standard_conforming_strings' and look if it is set to 'on' or I write every text with the E'' notation and don't care about 'standard_conforming_strings' bein 'on' or 'off'. But I would then need to escape every text while writing and unescaping it after reading. So this would be a performance penalty but would avoid bug reports like this one. Right?


> Alban Hertroys
> 
> --
-- 
Kind Regards from Switzerland,

Stevan Bajić

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Dspam-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspam-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.