From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Johann Spies <johann(dot)spies(at)gmail(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: idle processes |
Date: | 2015-08-05 13:46:54 |
Message-ID: | 8915.1438782414@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Johann Spies <johann(dot)spies(at)gmail(dot)com> writes:
> I have read quite a variety of stuff on the internet about an explanation
> for idle postgresql processes but still do not understand the following
> typical scenario.
> This is on Debian (postgresql 9.4.4-1.pgdg80+1).
> Running the following (as user crest) on an empty table using psql:
> select * from wos.person;
> Shows that there are no data in the table. In psql the process ends and
> psql is ready for the next query. However, much later one sees something
> like this when querying pg_stat_activity:
> "book_citation";"postgres";3358;"";f;"2015-08-05
> 09:00:02.503117+02";"select * from wos.person;"
It's not entirely clear what your question is, but here are some possible
answers:
1. For quite some time now, the "query" column in pg_stat_activity has
been defined as "the query currently or most recently run by the session";
it's intentional that it doesn't go back to "<idle>" anymore. You need to
look at the "state" column to tell whether the session is actively running
the query or not.
2. Are you sure that operating system user "crest" isn't connecting as
database user "postgres"?
3. pg_cancel_backend() is only supposed to terminate the current query
(if any), not kill the session. If you want the latter try
pg_terminate_backend().
> Why does this happen?
> Should I do something about it? If so, what?
AFAICS you have not shown anything behaving out of the ordinary.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | John McKown | 2015-08-05 13:47:40 | Re: json ->> operator precedence |
Previous Message | John McKown | 2015-08-05 13:45:09 | Re: json ->> operator precedence |