Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qnWqN-00B9kM-V3 for pgsql-general@arkaria.postgresql.org; Tue, 03 Oct 2023 04:17:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qnHGX-00Et6H-Us for pgsql-general@arkaria.postgresql.org; Mon, 02 Oct 2023 11:39:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qnHAz-00EpYN-5g for pgsql-general@lists.postgresql.org; Mon, 02 Oct 2023 11:33:25 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qnH5X-007m7k-4Z for pgsql-general@lists.postgresql.org; Mon, 02 Oct 2023 11:27:48 +0000 Received: from [212.222.85.114] (helo=pureos) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qnH5U-002rtw-98; Mon, 02 Oct 2023 13:27:44 +0200 Date: Mon, 2 Oct 2023 13:27:42 +0200 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: How to investigate deadlocks Message-ID: Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 13.0-CURRENT r368166 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 212.222.85.114 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, One of our clients running our LMS on top of PostgreSQL 13.1 created a ticket with these messages: 2023-09-30 16:50:50.951 CEST [18117] ERROR: deadlock detected 2023-09-30 16:50:50.951 CEST [18117] DETAIL: Process 18117 waits for ShareLock on transaction 150396154; blocked by process 18187. Process 18187 waits for ShareLock on transaction 150396155; blocked by process 18117. Process 18117: fetch hc_d03geb Process 18187: fetch hc_d02ben 2023-09-30 16:50:50.951 CEST [18117] HINT: See server log for query details. 2023-09-30 16:50:50.951 CEST [18117] CONTEXT: while locking tuple (38,57) in relation "d03geb" 2023-09-30 16:50:50.951 CEST [18117] STATEMENT: fetch hc_d03geb The shown PIDs for sure are the ones of the Pos backend proc (on Linux). Is there any chance to investigate it further? Thanks matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub