Re: Python client + select = locked resources???

From: johnf <jfabiani(at)yolo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Python client + select = locked resources???
Date: 2009-07-01 16:21:52
Message-ID: 200907010921.52426.jfabiani@yolo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 29 June 2009 09:26:24 am Craig Ringer wrote:
> Try connecting to the database with psql and running
>   "select * from pg_stat_activity"
> while the web app is running. You should see only "IDLE" or working
> connections, never idle in transaction. If you have anything idle in a
> transaction for more than a few moments you WILL have problems, because
> if those transactions have SELECTed from the table you're trying to
> alter they'll hold share locks that will prevent ALTER TABLE from
> grabbing an exclusive lock on the table.

I used psql to run the query "select * from pg_stat_activity;" and it shows
three (3) lines , the select statement, <IDLE>, and the last one is <IDLE> in
transaction. No one else is using the database because it's a on my machine.
So can you explain why I have an "<IDLE> in transaction" listed and does it
mean I can't alter the table from some other program like pgAdmin3???

Also "commit" or "rollback" gives a warning "there is no transaction in
progress". So what gives?

--
John Fabiani

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Mead 2009-07-01 16:34:15 Re: Python client + select = locked resources???
Previous Message Juan Camilo Marín 2009-07-01 15:57:08 Re: FW: lack in psql console