On Sun, Apr 08, 2007 at 12:19:06PM -0700, Daniel L. Miller wrote: > When I start dspam with "dspam --daemon", and continue to observe > the tty I started it from, every message that comes through pops > up the following: > > WARNING: nonstandard use of \\ in a string literal at character 138 > HINT: Use the escape string syntax for backslashes, e.g., E'\\'. > > Any idea where to begin tracing this down?
A quick Google reveals that these messages are emitted by recent versions of PostgreSQL. It seems that they've begun deprecating the use of backslashes within strings, as support for that will disappear in the future. If you want to fix it, you'll need to look into dspam's postgres backend. The simplest fix will be to prepend any string which needs to use backslash escapes with an E, e.g. E'This is a string\n'. If they're only being used to escape single quotes (i.e. "\'"), then you can just replace it with the standards-compliant method of doubling the quote: 'That\'s better' becomes 'That''s better.' If it's the latter case, then you'd probably be better served rewriting dspam's quoting routines to use PQescapeStringConn(), so as to ensure correct quoting is used. http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-CONSTANTS A cheaper alternative may be to see if there's a configuration option for PostgreSQL to disable those warnings, and hope someone else actually fixes the code.
