Fwd: Problems with pg_stat_activity view - Mailing list pgsql-bugs

From mgr inż. Jacek Bzdak
Subject Fwd: Problems with pg_stat_activity view
Date
Msg-id CA+FttVNCykpn3LoTy4pn3K6otGM6Pt87Dc31A0MrxriHkNkeuA@mail.gmail.com
Whole thread Raw
In response to Problems with pg_stat_activity view  (mgr inż. Jacek Bzdak <jbzdak@gmail.com>)
Responses Re: Fwd: Problems with pg_stat_activity view  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs

I've checked my code and due other bug(s) indeed I had hangoing connections from already dropped users.

Maybe just fix pg_stat_activity so it uses LEFT JOIN, to cover such case. I guess it shouldnt break any code? 

jb:)


2013/11/2 Tom Lane <tgl@sss.pgh.pa.us>
mgr inż. Jacek Bzdak <jbzdak@gmail.com> writes:
> I guess (I have no idea really) that there is some bug in pg_stat_activity
> view, because if I use function pg_stat_get_activity(NULL::integer) I will
> get one connection.

If you look at the definition of the pg_stat_activity view, you'll see
it's just a join of pg_stat_get_activity's output against pg_database and
pg_authid.  It sounds like you had a row that had failed to join against
pg_authid --- maybe you dropped a user that still had a running session?

                        regards, tom lane


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #8576: 'btree index keys must be ordered by attribute'
Next
From: Peter Hicks
Date:
Subject: Re: BUG #8576: 'btree index keys must be ordered by attribute'