From: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com> |
---|---|
To: | 'Fujii Masao' <masao(dot)fujii(at)oss(dot)nttdata(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>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, 'vignesh C' <vignesh21(at)gmail(dot)com> |
Subject: | RE: pg_recvlogical requires -d but not described on the documentation |
Date: | 2025-03-18 09:17:21 |
Message-ID: | OSCPR01MB149668F472C57FEBDCC480E90F5DE2@OSCPR01MB14966.jpnprd01.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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?
Best regards,
Hayato Kuroda
FUJITSU LIMITED
From | Date | Subject | |
---|---|---|---|
Next Message | Shlok Kyal | 2025-03-18 09:26:22 | Re: Restrict copying of invalidated replication slots |
Previous Message | Andrei Lepikhov | 2025-03-18 09:12:10 | Re: [PATCH] Optionally record Plan IDs to track plan changes for a query |