summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wong <mark@2ndQuadrant.com>2019-09-07 17:03:27 +0000
committerMark Wong <mark@2ndQuadrant.com>2019-09-07 17:03:27 +0000
commit786deea891ed864016a35db2daaf515a3120ba4a (patch)
tree25a47e3ada3c9339750c31213d267ccdd5121ad0
parent537ed56d05dda919e36af56645b51ba89983d360 (diff)
Set default isolation level to read uncommitted
This sets the isolation level just for pg_top.
-rw-r--r--pg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pg.c b/pg.c
index 88ab52e..7533826 100644
--- a/pg.c
+++ b/pg.c
@@ -96,6 +96,10 @@ connect_to_db(struct pg_conninfo_ctx *conninfo)
for (i = 0; i < 5; i++)
if (conninfo->values[i] != NULL)
free((void *) conninfo->values[i]);
+
+ PQexec(conninfo->connection,
+ "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL " \
+ "READ UNCOMMITTED;");
}
void