SELECT Generating Row Exclusive Locks?

From: "Thomas F(dot) O'Connell" <tfo(at)sitening(dot)com>
To: PgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: SELECT Generating Row Exclusive Locks?
Date: 2005-12-01 03:22:04
Message-ID: BA003D8E-8297-44C3-A9FE-6BC39C01D5CF@sitening.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm monitoring locks using this query:

SELECT pgsa.procpid, pgsa.current_query, pgsa.query_start,
pgc.relname, pgl.mode, pgl.granted
FROM pg_catalog.pg_class pgc, pg_locks AS pgl, pg_stat_activity AS pgsa
WHERE pgl.pid = pgsa.procpid
AND current_query <> '<IDLE>'
AND pgl.relation = pgc.oid
ORDER BY pgsa.query_start DESC;

which was built as an extension of this information:

http://archives.postgresql.org/pgsql-novice/2004-08/msg00291.php

Interestingly, I'm seeing evidence that SELECTs are occasionally
taking Row Exclusive locks. Should this surprise me?

PostgreSQL 8.0.3 on i686-pc-linux-gnu, compiled by GCC 2.95.4

--
Thomas F. O'Connell
Database Architecture and Programming
Co-Founder
Sitening, LLC

http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005 (cell)
615-469-5150 (office)
615-469-5151 (fax)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ken Winter 2005-12-01 03:38:03 How to run a stored PL/pgSQL function?
Previous Message John D. Burger 2005-12-01 01:44:30 Re: Finding uniques across a big join