Changeset

4248:d79d1255fd40

Merge 0.8->trunk
author Matthew Wild <mwild1@gmail.com>
date Mon, 11 Apr 2011 17:01:55 +0100
parents 4246:d0767040236f (current diff) 4247:6a372135b4c4 (diff)
children 4249:896e8793e7a4
files
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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