idle processes

From: Johann Spies <johann(dot)spies(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: idle processes
Date: 2015-08-05 07:38:28
Message-ID: CAGZ55DQpCuGo3369WESoFBqA_BTVVpYPwONmBQwfv_vwPN6e9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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;"

Now the process is indicated as one run by the user postgres.

As user postgres:

postgres=# select pg_cancel_backend(3358);
pg_cancel_backend
-------------------
t
(1 row)

And I can repeat this but ps (or pg_stat_activity) shows process 3358.
Now my questions:

Why does this happen?
Should I do something about it? If so, what?

Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoff Winkless 2015-08-05 10:02:38 json ->> operator precedence
Previous Message Jim Nasby 2015-08-05 05:22:18 Re: Question about copy from with timestamp format