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 1uqn4z-00DCFP-BL for pgsql-general@arkaria.postgresql.org; Tue, 26 Aug 2025 06:22:50 +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 1uqn4y-001ewB-Lg for pgsql-general@arkaria.postgresql.org; Tue, 26 Aug 2025 06:22:49 +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 1uqn4y-001ew3-A0 for pgsql-general@lists.postgresql.org; Tue, 26 Aug 2025 06:22:48 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uqn4w-001tpy-0m for pgsql-general@lists.postgresql.org; Tue, 26 Aug 2025 06:22:48 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-afcb7a0550cso901506866b.2 for ; Mon, 25 Aug 2025 23:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1756189365; x=1756794165; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Jn7fZ8Noj3IG3O/E10NFhCSSRQLzBXHu4IWAI8dJOrE=; b=SVuda5kt7s26QK5Box20XBPfaIhyXhkWWbeXY/OwQie3DGEcAAA0OCTvw7yaOrZjqb TXz9SkovBCxDkofG8RcfhK72Z1ekBrr+CXsdmG0b8b3oluIayewZUxzyojaO4+zzQXQd PffRiE/EqDNeKmL+/UOHLIcQOtTkCDSUNmeuTbj+TdcQ0LOFJAe4kY+Ik5aQZ8ycieP7 Bmf1aDv6DX+1H8hOwvYN2TDYG/dB8ElZfLhGQootQ0JI8/lRyx3rOvlnFP6IoZSkIwzr VQxBQ+f13Kh2ZpNd5d4lfKIeOB7wz0h7/cm8ElqwtHVAwG755TayF33RTKTAXOmHzJKx Enyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756189365; x=1756794165; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Jn7fZ8Noj3IG3O/E10NFhCSSRQLzBXHu4IWAI8dJOrE=; b=vdREK0UDMy7QuMG6WraWcZ13xk2sGVv+NVqte+MQCCB2w0KAnnV7XdvXkj2PAl6WVJ TiTpOWtlF8ujhTCr25a6TXuZL09RzotGxfoI/wV+LVlPmgKsh7j4x//dDjXIOJ6H5NRI B/vyc5OtV4j93zc6hnCPfYBxjfFiFI/jCVexum7mkBEJA7JTSDLhXAqgxk2Ov1ArragE bAFSJNtiNbWiMOAPPeu2UKLXARkYhhQu4KYZNq3KiliAALAD3zgegLFlr1MWdfZVusgd dAQY/0b+MIqcbwjST5Su2SXHi+mgpyOz6HR7qR3eLqLG7fj+CZjdgPsuQfO+LR7DhJTK DQbQ== X-Forwarded-Encrypted: i=1; AJvYcCW7oLOToUavhyzAgDFcYceGiLjfH1o2nL+RJXvjI4bTH7b3aMAHRBF9y+z+cV9l8naoWyif7vUKhL7c/TH5@lists.postgresql.org X-Gm-Message-State: AOJu0YwjX0iJE8hqy4ZNUIEW8sN95Fb7MbDnsMmZy4za81Zxf1yGpOwj egKmp+AfmDc3EGEVY39iYspWF6wBGtDa6Fbaq9oIWNaE4EbmBU2xQWEogGXXwSfz6lE= X-Gm-Gg: ASbGncsoysE/h3BMxoZVTL/IQgPvvEJxOTHtmO546G8euyUE72VFzy6uqaa3ZO6EL3g NtogarOZpC/9vXbkMN28PJWbJYf7KCp5pbwdqGbR4rQL1kIIIdUja8+6kLVw3Oplh1gwsEdIF2C IwGQn/OYAyumGWdML4MUUrSJbtrgSzUa4LY8ZlPzOLyJAQGBha0E9eDw5VMYos0/q20P62MVhrX uh/78njMQrRzbutiTQamXAwQ+KcdPAT9ZL19CeWGVc85fdKySjmm/oZFzSzMpQRmh8XRYp1ZHsZ NQrqKVcB070K1zzlnC+1cNJdAZvgnJd4pz5EngUUzcgX0yY9XiuxaXjxFRVWrH2z/80Q3jLXAXx zjG/QZP+YF5Z2BNsRyVCidoQ= X-Google-Smtp-Source: AGHT+IEy9esc34m14720d182pKVB/zeVDKFQ+1x5iB7tYdzlH7CIAanWAoBIoUeyz6x+3WxWItpXFA== X-Received: by 2002:a17:907:1ca7:b0:ae3:6d27:5246 with SMTP id a640c23a62f3a-afe2954f4a2mr1403998666b.48.1756189364639; Mon, 25 Aug 2025 23:22:44 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([213.208.157.87]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe73cf6d76sm450511566b.83.2025.08.25.23.22.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Aug 2025 23:22:44 -0700 (PDT) Message-ID: <0b74ce6492f901730776a620ff411b8369dc443d.camel@cybertec.at> Subject: Re: Strange deadlock with object/target of lock : transaction From: Laurenz Albe To: Achilleas Mantzios , pgsql-general@lists.postgresql.org Date: Tue, 26 Aug 2025 08:22:42 +0200 In-Reply-To: <01f1e49c-50ac-4aa8-9b82-b73fddbda8ef@cloud.gatewaynet.com> References: <0c474bc1-e7d6-4d7f-88ad-5284f89c997b@cloud.gatewaynet.com> <48a32f45-57f2-4560-ae94-3488b3568c8a@cloud.gatewaynet.com> <1fff675a-61a7-4ad7-8871-7ae7f5bb7ac7@cloud.gatewaynet.com> <01f1e49c-50ac-4aa8-9b82-b73fddbda8ef@cloud.gatewaynet.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2025-08-25 at 15:40 +0100, Achilleas Mantzios wrote: > > > > > We've been hit by a weird deadlock which it took me some days to = isolate and replicate. > > > > > It does not have to do with order of updates or any explicit TABL= E-level locking, > > > > > the objects/targets of the deadlock in question are transactions.= =20 >=20 > Hi I reproduced without the triggers, I understood the problem, I believe= the system's > behavior is the intended, I am sorry for the false alarm. The thing is th= at it takes >=3D3 > transactions to happen . That was the tricky part, up to now in all cases= of deadlocks > we had two transactions involved, this one needed three or more. Yes, waiting for a transaction means that you are waiting for a row lock. See https://www.cybertec-postgresql.com/en/row-locks-in-postgresql/ Yours, Laurenz Albe