Re: update functions locking tables - Mailing list pgsql-general

From Michael Fuhr
Subject Re: update functions locking tables
Date
Msg-id 20050830013500.GA54501@winnie.fuhr.org
Whole thread Raw
In response to update functions locking tables  (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>)
Responses Re: update functions locking tables  (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>)
List pgsql-general
On Mon, Aug 29, 2005 at 09:41:21PM -0300, Clodoaldo Pinto wrote:
>
> 26873 ? S 0:18 postgres: user database 127.0.0.1(38946) SELECT waiting
> 23973 ? S 0:22 postgres: user database 127.0.0.1(43396) SELECT waiting
> 31212 ? S 0:02 postgres: user database 127.0.0.1(60619) SELECT waiting
> 21601 ? S 0:00 postgres: user database 127.0.0.1(46770) SELECT waiting
>
> I've been trying for 3 days to figure out what is happening to no
> avail. What am i missing about transactions and MVCC? What could make
> a plpgsql update function lock a table? The indexes are default btree.

In general, writers shouldn't block readers.  Have you examined
pg_locks?  Do you know exactly what the blocked queries are, or can
you find out from pg_stat_activity (stats_command_string must be
enabled)?  Are you doing any explicit locking (LOCK statement)?

--
Michael Fuhr

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: update functions locking tables
Next
From: wolverine my
Date:
Subject: Access more than one database from pgAdmin III