# HG changeset patch # User Matthew Wild # Date 1302537715 -3600 # Node ID d79d1255fd40257a964333a8dd9378fa5d457697 # Parent d0767040236fc0b9faaf5b0f9feb6ccb97122d3c# Parent 6a372135b4c48fa2d8155a0f952017ec3c95983e Merge 0.8->trunk diff -r d0767040236f -r d79d1255fd40 tools/migration/migrator/prosody_sql.lua --- a/tools/migration/migrator/prosody_sql.lua Wed Apr 06 20:00:44 2011 +0100 +++ b/tools/migration/migrator/prosody_sql.lua Mon Apr 11 17:01:55 2011 +0100 @@ -149,7 +149,11 @@ assert(stmt:execute()); local stmt = assert(dbh:prepare("DELETE FROM prosody")); assert(stmt:execute()); - local insert = assert(dbh:prepare("INSERT INTO `prosody` (`host`,`user`,`store`,`key`,`type`,`value`) VALUES (?,?,?,?,?,?)")); + local insert_sql = "INSERT INTO `prosody` (`host`,`user`,`store`,`key`,`type`,`value`) VALUES (?,?,?,?,?,?)"; + if output.driver == "PostgreSQL" then + insert_sql = insert_sql:gsub("`", "\""); + end + local insert = assert(dbh:prepare(insert_sql)); return function(item) if not item then assert(dbh:commit()) return dbh:close(); end -- end of input