[12:03] <spiv> postgres statement logging is too late -- the query never reaches postgres.
[12:04] <spiv> The simplest way would be to insert a print just before the relevant line in zope.app.rdb, -- what's the fnal part of the traceback?
[12:07] <daf>     *  Module canonical.rosetta.sql, line 678, in createMessageSetFromText
[12:07] <daf>       return createMessageSetFromText(self, text)
[12:07] <daf>     * Module canonical.rosetta.sql, line 291, in createMessageSetFromText
[12:07] <daf>       if messageIDs.count() == 0:
[12:07] <daf>     * Module sqlobject.main, line 1211, in count
[12:07] <daf>       count = self.accumulate('COUNT(*)')
[12:07] <daf>     * Module sqlobject.main, line 1207, in accumulate
[12:07] <daf>       return conn.accumulateSelect(self,expression)
[12:07] <daf>     * Module sqlobject.dbconnection, line 249, in accumulateSelect
[12:07] <daf>       val = int(self.queryOne(q)[0] )
[12:07] <daf>     * Module sqlobject.dbconnection, line 223, in queryOne
[12:07] <daf>       return self._runWithConnection(self._queryOne, s)
[12:07] <daf>     * Module sqlos.adapter, line 60, in _runWithConnection
[12:07] <daf>       raise DatabaseException, tuple(exc.args)
[12:08] <daf> DatabaseException: unindexable object
[12:09] <spiv> Actually, turning on debug in SQLObject would be sufficient.
[12:10] <daf> could you remind me how I do that?
[12:10] <spiv> Except the current sqlos seems to override that :/
[12:10] <spiv> sqlobject/dbconnection.py is what I edit.
[12:11] <spiv> You may need to remove self.debug = 0 from sqlos/adapter.py, too.
[12:18] <daf> <sqlobject.main.SelectResults object at 0xb421f7cc>
[12:18] <daf>  1/Pool    :  ACQUIRE pool=[] 
[12:18] <daf>  1/QueryOne:  SELECT COUNT(*) FROM POMsgID WHERE msgid = 'Opening %%d contact will open %%d new window as well.\r\nDo you really want to display this contact?'
[12:18] <daf>  1/Pool    :  RELEASE (implicit, autocommit=None) pool=[] 
[12:18] <daf> but, also:
[12:18] <daf>  1/Pool    :  ACQUIRE pool=[] 
[12:18] <daf>  1/QueryOne:  SELECT COUNT(*) FROM POMsgID WHERE msgid = 'Opening %d contact will open %d new window as well.\r\nDo you really want to display this contact?'
[12:18] <daf>  1/Pool    :  RELEASE (implicit, autocommit=None) pool=[] 
[12:22] <spiv> Also?  Weird.
[12:22] <spiv> The second one fails I presume?
[12:22] <daf> I presume so too
[12:22] <spiv> :)
[12:26] <daf> ah, think I've found the second one
[12:35] <daf> spiv: ok, I think I've sorted out the SELECTs
[12:35] <daf> spiv: now an INSERT is being a pain
[12:36] <daf> spiv: shouldn't this stuff be automatically escaped in SQLObject?
[12:36] <spiv> Probably, yes.
[12:37] <daf> is it difficult to fix?
[12:37] <spiv> (Which has the added suck that fixing it in SQLObject will break our code thatwe're writing now that assumes the fix isn't there)
[12:37] <daf> i.e. should I do a workaround, or wait for it to be fixed properly?
[12:37] <daf> is it only a problem with percent signs?
[12:38] <daf> speaking of the Rosetta code, there's not much code which is affected
[12:40] <spiv> I'd workaround it.
[12:40] <daf> ok, I know how to hack SELECTS to work
[12:40] <spiv> (man, my wireless is screwing up for some reason)
[12:40] <daf> how do I do the same for INSERTs?
[12:44] <spiv> Yes, it's only % -- it's because Python's printf-like formatting is being invoked.
[12:44] <daf> right
[12:45] <daf> it is a bug, right?
[12:47] <spiv> (i.e. psycopg's cursor.execute does  query % params )
[12:48] <spiv> (sorry about the lag -- my wireless keeps dropping out for no apparent reason)
[12:48] <spiv> You'd fix it for INSERTs the same way -- escape % as %% in any strings.
[12:49] <daf> using which method?
[12:50] <spiv> foo.replace('%', '%%')
[12:50] <spiv> How are you donig it for SELECTS? :)
[12:50] <daf> Class.select()
[12:51] <daf> I've always used Class(...) for insertions previously
[12:53] <spiv> Um, I think we're talking at cross-purposes.
[12:54] <spiv> You can do Class(foo=foo.replace('%', '%%'))
[12:54] <daf> ok, that's what I wanted to know
[12:54] <daf> sorry, I'm tired
[12:54] <spiv> And you can do Class.selectBy(foo=foo.replace('%', '%%'))
[12:55] <daf> oh, right