Why does this PostgreSQL transaction give “WARNING: there is no transaction in progress”
I am running the transaction queries in code like this (simplified): try { runQuery("begin"); runQuery("some query ..."); runQuery("some other query ..."); runQuery("some more query ..."); runQuery("some extra query ..."); runQuery("commit"); } catch (e){ runQuery("rollback"); } Here is the list of statements from the postgres log file. Notice that first begin / commit works fine and the second commit gives the error mentioned in the subject: 2015-02-18 20:19:17 UTC [6459-7] vdsr@sails LOG: statement: begin 2015-02-18 20:19:17 UTC [6459-8] vdsr@sails LOG: execute <unnamed>: INSERT INTO "groups