summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorSelena Deckelmann <selenamarie@gmail.com>2007-11-24 14:11:46 -0800
committerSelena Deckelmann <selenamarie@gmail.com>2007-11-24 14:11:46 -0800
commitad675de05096a509169a67440a72f9e81f033a45 (patch)
tree42c79eab1aa5f786146dadd719891a0f732d36c3 /commands.c
parentf2e159bb697d924982b4d588e71efc2e9bfd1e83 (diff)
fixed query for Locks to show locks not granted
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/commands.c b/commands.c
index a4f595b..e07ad70 100644
--- a/commands.c
+++ b/commands.c
@@ -87,10 +87,11 @@ static char *err_listem =
#define GET_LOCKS \
"SELECT datname, relname, mode, granted\n" \
- "FROM pg_stat_activity, pg_locks, pg_class\n" \
+ "FROM pg_stat_activity, pg_locks\n" \
+ "LEFT OUTER JOIN pg_class\n" \
+ "ON relation = pg_class.oid\n"\
"WHERE procpid = %d\n" \
- " AND procpid = pid\n" \
- " AND pg_class.oid = relation;"
+ " AND procpid = pid;" \
/*
* err_compar(p1, p2) - comparison routine used by "qsort"