Re: Copy function for logical replication slots - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Copy function for logical replication slots
Date
Msg-id 20180828133405.GJ29157@paquier.xyz
Whole thread Raw
In response to Re: Copy function for logical replication slots  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: Copy function for logical replication slots
List pgsql-hackers
On Tue, Aug 28, 2018 at 04:14:04PM +0900, Masahiko Sawada wrote:
> I think the copying from a slot that already reserved WAL would be
> helpful for backup cases (maybe you suggested?). Also, either way we
> need to make a safe logic of acquring and releasing the source slot
> for logical slots cases. Or you meant  to restrict the case where the
> copying a slot that doesn't reserve WAL?

I mean the latter, as-known-as there is no actual point in being able to
copy WAL which does *not* reserve WAL.

>> Does it actually make sense to allow copy of temporary slots or change
>> their persistence?  Those don't live across sessions so they'd need to
>> be copied in the same session which created them.
>
> I think the copying of temporary slots would be an impracticable
> feature but the changing their persistence might be helpful for some
> cases, especially copying from persistent to temporary.

The session doing the copy of a permanent slot to the temporary slot has
to be the one also consuming it as the session which created the slot
owns it, and the slot would be dropped when the session ends.  For
logical slots perhaps you have something in mind?  Like copying a slot
which is not active to check where it is currently replaying, and using
the copy for sanity checks?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Stored procedures and out parameters
Next
From: Michael Paquier
Date:
Subject: Re: Fix help option of contrib/oid2name