| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Marc <pgsql-general(at)mbreslow(dot)net> |
| Cc: | "Richard Huxton" <dev(at)archonet(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Exclusive Locks Taken on User Tables? |
| Date: | 2007-11-06 20:01:47 |
| Message-ID: | 28413.1194379307@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Marc <pgsql-general(at)mbreslow(dot)net> writes:
> This is the query that I'm running to view locks:
> SELECT pg_class.relname AS table,
> pg_database.datname AS database,
> transaction, pid, mode, granted
> FROM pg_locks, pg_class, pg_database
> WHERE pg_locks.relation = pg_class.oid
> AND pg_locks.database = pg_database.oid
> ORDER BY pg_class.relname, mode
> I'm pretty sure this filters out transactionid lock types because I'm
> joining to pg_database and pg_class. Pls correct me if I'm wrong though.
It won't filter out row-level locks on rows within tables. You're
probably looking at a transient row lock taken by a blocked SELECT FOR
UPDATE. You didn't show exactly what the real problem was, but I'm
wondering if this is foreign-key conflicts in a pre-8.1 PG version.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2007-11-06 20:21:15 | Re: Syntax error in a large COPY |
| Previous Message | Scott Marlowe | 2007-11-06 19:38:56 | Re: Syntax error in a large COPY |