Search Postgresql Archives

Re: Exclusive Locks Taken on User Tables?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marc <pgsql-general@xxxxxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux