Insert not finishing

From: Johann Spies <johann(dot)spies(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Insert not finishing
Date: 2013-05-07 09:38:34
Message-ID: CAGZ55DQ2FXiF+wjn=0FgkiHdqZdbmYYaKye66GwvEjrnJytezA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am running python scripts to read tag-formated files and put the data
into tables.

Sometimes a script (I am running several of them in parallel on a server)
just hangs. That happened now again and when I checked I saw this:

SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
pg_stat_get_backend_activity(s.backendid) AS current_query FROM (SELECT
pg_stat_get_backend_idset() AS backendid) AS s;
procpid
|
current_query

---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
31697 | SELECT rkw_art_link.id, rkw_art_link.rart_id,
rkw_art_link.kw_id FROM rkw_art_link WHERE ((rkw_art_link.kw_id =
'a9285811-8b14-421b-b7ee-2c0a7dc9c52c') AND (rkw_art_link.rart_id =
'000182809000214')) ORDER BY rkw_art_link.id LIMIT 1 OFFSET 0;
32234 | INSERT INTO rkeywords(de,uuid) VALUES ('ANGIOTENSIN RECEPTOR
BLOCKER','4b1c8ae2-d837-4d25-a32f-4891db267b9b');
30791 | INSERT INTO rkeywords(de,uuid) VALUES
('SYNCOPE','45044b9e-3cab-4f7b-83b9-f32cbed3cb24');
31799 | <IDLE> in transaction
16893 | <IDLE>
31624 | INSERT INTO rkeywords(de,uuid) VALUES ('DIASTOLIC
FUNCTION','0c3633b4-05d1-4871-bbc1-b5e4c797e0db');
31884 | INSERT INTO rkeywords(de,uuid) VALUES
('MAPK','51b7d331-5652-4d05-9386-bc4e714b398d');
31715 | <IDLE> in transaction
31749 | <IDLE>
321 | SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
pg_stat_get_backend_activity(s.backendid) AS current_query FROM (SELECT
pg_stat_get_backend_idset() AS backendid) AS s;
(10 rows)

Number 31884 is the problem one. It just sits there everytime I run this
query and it never seems to get completed.

How do I find out what is the problem? And how do I 'push' it to carry on?

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 Alban Hertroys 2013-05-07 09:45:15 Re: Insert not finishing
Previous Message Steve Rogerson 2013-05-07 08:49:16 Re: Composite fields and the query planner