public inbox for [email protected]  
help / color / mirror / Atom feed
From: Hayato Kuroda (Fujitsu) <[email protected]>
To: 'Fujii Masao' <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: [email protected] <[email protected]>
Cc: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: 'vignesh C' <[email protected]>
Subject: RE: pg_recvlogical requires -d but not described on the documentation
Date: Tue, 18 Mar 2025 09:17:21 +0000
Message-ID: <OSCPR01MB149668F472C57FEBDCC480E90F5DE2@OSCPR01MB14966.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <OSCPR01MB14966F6BA7B93EF637D256394F5DE2@OSCPR01MB14966.jpnprd01.prod.outlook.com>
References: <OSCPR01MB14966930B4357BAE8C9D68A8AF5C72@OSCPR01MB14966.jpnprd01.prod.outlook.com>
	<CAExHW5uOprZgj2rVQ0HT3ckr+fVvhG-DvcVT+wfmwnwynH00pw@mail.gmail.com>
	<OSCPR01MB149660D1F436F8B82912FCB53F5C72@OSCPR01MB14966.jpnprd01.prod.outlook.com>
	<CAExHW5v94uRcr4f3+yhLrLX8UeYusJB06mcSqfdvu8fYUmVc=Q@mail.gmail.com>
	<OS7PR01MB14968CC4F20B99B8E1508CE81F5C32@OS7PR01MB14968.jpnprd01.prod.outlook.com>
	<CAKFQuwYWVT84GM2OqRx8EqNrfzNM-zbpQ5Y2bA1dPO9jUgo_Kg@mail.gmail.com>
	<[email protected]>
	<OSCPR01MB14966F6BA7B93EF637D256394F5DE2@OSCPR01MB14966.jpnprd01.prod.outlook.com>

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:

```
@@ -950,7 +950,7 @@ main(int argc, char **argv)
        if (!RunIdentifySystem(conn, NULL, NULL, NULL, &db_name))
                exit(1);
 
-       if (db_name == NULL)
+       if (!do_drop_slot && db_name == NULL)
                pg_fatal("could not establish database-specific replication connection");
```

db_name == NULL means that streaming replication connection has been established,
so other operations are not allowed.

2. Fix documentation

We keep the current restriction and clarify it. For the reportability, it is
OK for me to also modify the code like:

```
@@ -881,7 +881,7 @@ main(int argc, char **argv)
                exit(1);
        }
 
-       if (!do_drop_slot && dbname == NULL)
+       if (dbname == NULL)
```

Thought?

[1]: https://www.postgresql.org/message-id/OSCPR01MB14966C6BE304B5BB2E58D4009F5DE2%40OSCPR01MB14966.jpnpr...

Best regards,
Hayato Kuroda
FUJITSU LIMITED 



view thread (20+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: RE: pg_recvlogical requires -d but not described on the documentation
  In-Reply-To: <OSCPR01MB149668F472C57FEBDCC480E90F5DE2@OSCPR01MB14966.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox