Blob Blame History Raw
Make calling autocommit with the same value as set a NOOP to suppress the warning

  WARNING:  there is already a transaction in progress

from the PostgreSQL database (e.g. in prosody or prosodyctl). See also upstream commit:

https://code.google.com/p/luadbi/source/detail?r=aab3ed7d93fe9b10b75e302c787737999a8b4a5f

--- lua-dbi-0.5/dbd/postgresql/connection.c			2010-05-01 06:25:12.000000000 +0200
+++ lua-dbi-0.5/dbd/postgresql/connection.c.pgsql_transaction	2013-04-26 02:02:31.000000000 +0200
@@ -109,10 +109,12 @@
     int err = 0;
 
     if (conn->postgresql) {
-	if (on)
-	    err = rollback(conn);
-	else
-	    err = begin(conn);
+	if (on != conn->autocommit) {
+	    if (on)
+		err = rollback(conn);
+	    else
+		err = begin(conn);
+	}
 
 	conn->autocommit = on;	
     }