From: SourceForge.net <no...@so...> - 2007-03-03 10:34:34
|
Bugs item #1672884, was opened at 2007-03-03 10:34 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1672884&group_id=16528 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Larry Hastings (lhastings) Assigned to: Nobody/Anonymous (nobody) Summary: "where x in %s" failes with single-element tuple Initial Comment: This: db.execute("delete from table where index in %s", ((1, 2, 3),) ) works fine. But this: db.execute("delete from table where index in %s", ((1,),) ) fails with a syntax error. It's because PyPgSQL renders the arguments into the command, so the command fed into PostgreSQL becomes delete from table where index in (1,); and PostgreSQL's parser doesn't like a one-element tuple like that. I suspect the fix is: notice when rendering a one-element tuple, and somehow remove or prevent the comma. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1672884&group_id=16528 |