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 1rrhGL-0026NU-BK for pgsql-admin@arkaria.postgresql.org; Tue, 02 Apr 2024 16:45:29 +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 1rrhGK-00A0dB-G1 for pgsql-admin@arkaria.postgresql.org; Tue, 02 Apr 2024 16:45:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrhGK-00A0d3-5F for pgsql-admin@lists.postgresql.org; Tue, 02 Apr 2024 16:45:28 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrhGH-000G7E-1J for pgsql-admin@lists.postgresql.org; Tue, 02 Apr 2024 16:45:27 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id 4CB9838089F; Tue, 2 Apr 2024 18:45:23 +0200 (CEST) Received: from rs.plausibolo.de ([IPv6:::1]) by localhost (h2367442.stratoserver.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id cCyph1zhcK1D; Tue, 2 Apr 2024 18:45:23 +0200 (CEST) Received: from [192.168.178.88] (xdsl-84-44-210-131.nc.de [84.44.210.131]) by rs.plausibolo.de (Postfix) with ESMTPSA id CDEEE38033B; Tue, 2 Apr 2024 18:45:22 +0200 (CEST) Message-ID: <58661f82-620c-8116-efe7-23266578289c@jakobs.com> Date: Tue, 2 Apr 2024 18:45:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: Deadlock Content-Language: de-DE To: pgsql-admin@lists.postgresql.org References: From: Holger Jakobs In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------0QHBAlr6ixTlWHnEQV9cVzFQ" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------0QHBAlr6ixTlWHnEQV9cVzFQ Content-Type: multipart/mixed; boundary="------------ICoBYRXCh33yKbXS8E7UvAhH"; protected-headers="v1" From: Holger Jakobs To: pgsql-admin@lists.postgresql.org Message-ID: <58661f82-620c-8116-efe7-23266578289c@jakobs.com> Subject: Re: Deadlock References: In-Reply-To: --------------ICoBYRXCh33yKbXS8E7UvAhH Content-Type: multipart/alternative; boundary="------------5XZPVYlKIcX7uN1ftaK5dJ4V" --------------5XZPVYlKIcX7uN1ftaK5dJ4V Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 QW0gMDIuMDQuMjQgdW0gMTg6NDAgc2NocmllYiBSYWplc2ggS3VtYXI6DQo+IEhpDQo+DQo+ IElmIEkgcmVjZWl2ZSBhbiBhbGVydCBmb3IgZGVhZGxvY2ssIHdoYXQgc2hvdWxkIEkgZG8/ IExpa2Ugd2hhdCANCj4gYW5hbHlzaXMgc2hvdWxkIEkgZG8/IE5vIHdheSB0byBmaW5kIGEg cm9vdCBjYXVzZT8NCj4gVW5kZXIgcGdfbG9ja3MsIHdoYXQgSSBjYW4gYW5hbHlzZT8NCj4N CklmIHlvdSByZWNlaXZlIGFuIGVycm9yIHdpdGggYSBkZWFkbG9jaywgdGhlIGN1cnJlbnQg dHJhbnNhY3Rpb24gaXMgDQpkZWFkLiBZb3UgaGF2ZSB0byBkZWNpZGUgd2hldGhlciB0byB0 cnkgYWdhaW4uDQoNCldpdGhpbiB0aGUgZXJyb3IgbWVzc2FnZSB5b3UgZmluZCBhIGhpbnQg d2hpY2ggb3RoZXIgKG5vdCBhYm9ydGVkKSANCnRyYW5zYWN0aW9uIHdhcyBpbnZvbHZlZCBp biB0aGUgZGVhZGxvY2suIFNvIHlvdSBoYXZlIGFsbCB0aGUgDQppbmZvcm1hdGlvbiB5b3Ug bmVlZCB0byBmaW5kIHRoZSBjdWxwcml0Lg0KDQpSZWdhcmRzLA0KDQpIb2xnZXINCg0KLS0g DQoNCkhvbGdlciBKYWtvYnMsIEJlcmdpc2NoIEdsYWRiYWNoLCBUZWwuICs0OS0xNzgtOTc1 OTAxMg0KDQpjaGF0IHdpdGggbWUgb24gU2lnbmFsIG1lc3NlbmdlciANCjxodHRwczovL3Np Z25hbC5tZS8jZXUvR3BJUDI1OWJCbmVfSmlCWUpGdmJaQ0xZSkVMaEItOTJuSmZuY0FDTDFM VWVCT3BoZlhGRmdMWVlWWHZfQUdoZz4NCg0K --------------5XZPVYlKIcX7uN1ftaK5dJ4V Content-Type: multipart/related; boundary="------------X0QIPPXqL7tB9nVWbuFd5twK" --------------X0QIPPXqL7tB9nVWbuFd5twK Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Am 02.04.24 um 18:40 schrieb Rajesh Kumar:
Hi

If I receive an alert for deadlock, what should= I do? Like what analysis should I do? No way to find a root cause?
Under pg_locks, what I can analyse?=C2=A0
=

If you receive an error with a deadlock, the current transaction is dead. You have to decide whether to try again.

Within the error message you find a hint which other (not aborted) transaction was involved in the deadlock. So you have all the information you need to find the culprit.

Regards,

Holger

--

Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
3D""
chat with me on Signal messenger

--------------X0QIPPXqL7tB9nVWbuFd5twK Content-Type: image/png; name="TapMuhNyQVuzuVPA.png" Content-Disposition: inline; filename="TapMuhNyQVuzuVPA.png" Content-Id: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAIcAAACHAQMAAAAGKdhJAAAABlBMVEUAAAD///+l2Z/dAAAA AnRSTlP//8i138cAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAG5SURBVEiJ3da7bcMwEAbgM1iw kxYQwDXYcSVpAT0WkFdixzUIcAGqY0Hw8suJHSCNzkCKIIKg4isI3tMm/vnQP5FMtIQ4lbr4 SmSEcnCdHa/W7FQXFosfcEjvK76jfkNmp+6Bm35XqNOxs+8II8ahsxEXeEVxKcjPFIbP95Wx S8FzFN5dJP1dnUvJmm5sVocviiIV5pStyna4FcRrhJItTQUpqrMeehaLVk3TaIlcHZ1Umq2o wsQ0OvrMqkQOhEn1Fs5I+yCVRnEJidHSIZKVChdeiXer2nkTFko7a2cOTluJX1EIJGtzLwqz s7q6BKngnNtjEJp+RiGQrNN61kLt1qDZhMIlzrb2xdwx5l/5uZaMWmOHWLOFODupsI/kUnao hWpWKkdJ94L+xM2xTFgojQY0f3Np47gUIxT2iYvKp6RdS+Xw1PthdI9ZIKk0m45AHSHM550F chSaPGqhDsYgSAVPxuwU9BjqboRy7jpO6OfshtFKBXt1tKh+ajiHxXImxzCrHeuuvCEzqc2r VfP22JBCwa7DT+GIIj7PuRY+V1ZHmAU0AAvlzA9qwQYLeXpl9Up+61/B35IPLEvZkYbCln8A AAAASUVORK5CYII= --------------X0QIPPXqL7tB9nVWbuFd5twK-- --------------5XZPVYlKIcX7uN1ftaK5dJ4V-- --------------ICoBYRXCh33yKbXS8E7UvAhH-- --------------0QHBAlr6ixTlWHnEQV9cVzFQ Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQScuJCxWJK1p5BOebGKV5yTsxlhugUCZgw2IQUDAAAAAAAKCRCKV5yTsxlhumDG AJ9Ne/W6xNlZBN3GgmckEmxg68pVdQCfe5/gLIV+i2Sip7uBpSqNzcm9GO8= =vkmJ -----END PGP SIGNATURE----- --------------0QHBAlr6ixTlWHnEQV9cVzFQ--