PostgreSQL Deadlock Problem Resolution record

Source: Internet
Author: User
--Query blocked SQL (deadlock, no SQL executed through) SELECT * from Pg_stat_activity AA, (select A.locktype,a.database,a.pid,a.mode,a.relation,  B.relname from Pg_locks a joins Pg_class B on A.relation=b.oid where upper (b.relname) = ' Fx_wdsj_dszh ') Bbwhere aa.pid=bb.pid and aa.waiting= ' t '--release the deadlock Sqlselect pg_cancel_backend (the PID above)--whether the query locks the table with the select OID from Pg_class where Relname= ' The table '--oid that may have been locked is a idselect pid from pg_locks where relation= ' is hidden by each table--If the result is queried, release the lock select Pg_cancel_backend ( PID as found above)

PostgreSQL Deadlock Problem Resolution record

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.