3728e5d
Make calling autocommit with the same value as set a NOOP to suppress the warning
3728e5d
3728e5d
  WARNING:  there is already a transaction in progress
3728e5d
3728e5d
from the PostgreSQL database (e.g. in prosody or prosodyctl). See also upstream commit:
3728e5d
3728e5d
https://code.google.com/p/luadbi/source/detail?r=aab3ed7d93fe9b10b75e302c787737999a8b4a5f
3728e5d
3728e5d
--- lua-dbi-0.5/dbd/postgresql/connection.c			2010-05-01 06:25:12.000000000 +0200
3728e5d
+++ lua-dbi-0.5/dbd/postgresql/connection.c.pgsql_transaction	2013-04-26 02:02:31.000000000 +0200
3728e5d
@@ -109,10 +109,12 @@
3728e5d
     int err = 0;
3728e5d
 
3728e5d
     if (conn->postgresql) {
3728e5d
-	if (on)
3728e5d
-	    err = rollback(conn);
3728e5d
-	else
3728e5d
-	    err = begin(conn);
3728e5d
+	if (on != conn->autocommit) {
3728e5d
+	    if (on)
3728e5d
+		err = rollback(conn);
3728e5d
+	    else
3728e5d
+		err = begin(conn);
3728e5d
+	}
3728e5d
 
3728e5d
 	conn->autocommit = on;	
3728e5d
     }