Re: pg_recvlogical requires -d but not described on the documentation

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, 'vignesh C' <vignesh21(at)gmail(dot)com>
Subject: Re: pg_recvlogical requires -d but not described on the documentation
Date: 2025-03-18 16:37:19
Message-ID: d235c2a6-fe1e-4bd1-96fa-2e2c884f211d@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2025-03-18 16:41:18 Re: Adding skip scan (including MDAM style range skip scan) to nbtree
Previous Message Peter Eisentraut 2025-03-18 16:35:46 Re: dblink: Add SCRAM pass-through authentication