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 1tuZwW-009wO8-EM for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 16:37:28 +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 1tuZwV-000WdH-52 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 16:37:27 +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 1tuZwU-000Wam-R1 for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 16:37:26 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tuZwS-003XdG-0H for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 16:37:25 +0000 Received: from [192.168.11.5] (p1695135-ipoe.ipoe.ocn.ne.jp [118.0.92.134]) by oss.nttdata.com (Postfix) with ESMTPSA id B410B618D5; Wed, 19 Mar 2025 01:37:19 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Wed, 19 Mar 2025 01:37:19 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_recvlogical requires -d but not described on the documentation To: "Hayato Kuroda (Fujitsu)" , "David G. Johnston" Cc: Ashutosh Bapat , "pgsql-hackers@lists.postgresql.org" , 'vignesh C' References: Content-Language: en-US From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025/03/18 18:17, Hayato Kuroda (Fujitsu) wrote: > Dear Fujii-san, David, > >>> BTW, I'm curious why --dbname isn't required for the --drop-slot action. >> >> I'm analyzing around here... >> > > Actually, replication slots can be dropped from another database where it created, > or even from the streaming replication connection. > I forked the new thread which fixes the description [1]. > > Based on the fact, there are two approaches to fix: > > 1. Fix not to raise fatal error like: It looks like commit 0c013e08cfb introduced a bug that causes "pg_recvlogical --drop-slot" without --dbname to check whether it's connected to a specific database and fail if it's not. This commit was added before 9.5, while pg_recvlogical was introduced in 9.4. On my env, "pg_recvlogical --drop-slot" without --dbname worked as expected in 9.4 but started failing in 9.5 or later. So, I think the proper fix is to avoid raising a fatal error even when not connected to a specific database in --drop-slot action. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION