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 1thnTs-006y0B-F6 for pgsql-docs@arkaria.postgresql.org; Tue, 11 Feb 2025 10:27:04 +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 1thnSs-009WG3-T2 for pgsql-docs@arkaria.postgresql.org; Tue, 11 Feb 2025 10:26:02 +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 1thnSs-009WFu-KM for pgsql-docs@lists.postgresql.org; Tue, 11 Feb 2025 10:26:02 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1thnSq-000CAQ-2b for pgsql-docs@lists.postgresql.org; Tue, 11 Feb 2025 10:26:01 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id 19C0813801E1; Tue, 11 Feb 2025 05:26:00 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Tue, 11 Feb 2025 05:26:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1739269560; x=1739355960; bh=i 2orp1WC2ID20mKkB+AlgXHY3HtMb0wmyq0qEsq539E=; b=lkCm5YBdE/qH9RlWj /9fY87OrkFLFlD2SCtlWVVViYneCQOhKgUBVdF7n76a9fX1I4BwOHl6wLYxseITT XB1R/PDG8aVHQ0mNk4hnIUYTzleGmeBb1rEddU1Un9pzkwyeSdK0usvW5sNXplLn qKxYcGfkJCn30+MTHb3L9BelZ/JfWHtA1UeFX9M4I0rhdQMdt2Mp9JlVKBNjdsi3 suabhhEa5PmEr5ttHN8EYvg/C4HS6FdkJ9Eog2qgDhPOkk1PYj7uEyH81PSOLq/p ZFR4yM643j0P4cPoo4uDQZadJe2JAdeYP24D15juo+LO5SkV0wPwpw+1dd5O4PPp NJqaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegtdejiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdej necuhfhrohhmpemllhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvheeuffehgfeukeeufeeh hefghfeugfefudekjeevudffgeffkeegffffveegheenucffohhmrghinhepvghnthgvrh hprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspg hrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepsghlvghsshih geehiegsthhhohhmrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqug hotghssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Feb 2025 05:25:59 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1739269557; bh=Wl8SAKSzBcFY9fL8RFxdKeDzLsH7pE3JKuPVf6ZOQCs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=nZmOBL7Ko3Y4wa6WgLwa19sGNwYh+pKu0ywEslvklb979p/ASW1Wsy4Y34MNutRJ8 F0j+REMwlADIRrMjDbdKMC3JxwEUtWZiSF5oWarem+lKQvoewVIMe8NUennhaqsnTj +y8zANuWEjPkSRyjfhDPeQaqB+YwAjwe36eFez4o1hMWq7OqU8G1+B19QTSbJ0Xbxi Jm2i4F4ehDgU5AbcWL17olQrqWahhZo6LdPwDUaztZE1kiNAlXE/Df68RJzNUD5Khz nsolGDAdKNJaV4hyBNxd9U1UCWA+EC0V84QgOJkbjWQmxk2MV5Jxw64PObQZjjM9+P Y6SBxFAWEx7cw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 8FAF68D; Tue, 11 Feb 2025 11:25:57 +0100 (CET) Date: Tue, 11 Feb 2025 11:25:57 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Blessy Thomas Cc: pgsql-docs@lists.postgresql.org Subject: Re: Regarding experiencing Message-ID: <202502111025.yhnpf7xy4bqz@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Feb-11, Blessy Thomas wrote: > These are the commands I have run in the terminal > psql (17.0) > Type "help" for help. > > postgres=# SELECT pg_advisory_lock_shared(1001); //initialising the shared > lock > pg_advisory_lock_shared > ------------------------- > > (1 row) > > postgres=# SELECT pg_advisory_lock(1001); //exclusive lock > pg_advisory_lock > ------------------ > > (1 row) Ah yes, there's no conflict in this case because the holder of both locks is the same session. You'd have to request the exclusive lock in another psql session and you should see it block. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/