Re: Function to get invalidation cause of a replication slot.

2023-12-27 Thread shveta malik
On Thu, Dec 21, 2023 at 2:59 PM Amit Kapila wrote: > > On Thu, Dec 21, 2023 at 12:07 PM Michael Paquier wrote: > > > > On Thu, Dec 21, 2023 at 11:53:04AM +0530, Amit Kapila wrote: > > > On Thu, Dec 21, 2023 at 11:18 AM Michael Paquier > > > wrote: > > > Yeah, if one uses them independently

Re: Function to get invalidation cause of a replication slot.

2023-12-21 Thread Amit Kapila
On Thu, Dec 21, 2023 at 12:07 PM Michael Paquier wrote: > > On Thu, Dec 21, 2023 at 11:53:04AM +0530, Amit Kapila wrote: > > On Thu, Dec 21, 2023 at 11:18 AM Michael Paquier > > wrote: > > Yeah, if one uses them independently then there is no such guarantee. > > This could be possible in the

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Michael Paquier
On Thu, Dec 21, 2023 at 11:53:04AM +0530, Amit Kapila wrote: > On Thu, Dec 21, 2023 at 11:18 AM Michael Paquier wrote: > Yeah, if one uses them independently then there is no such guarantee. This could be possible in the same query as well, still less likely, as the contents are volatile. >> A

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Amit Kapila
On Thu, Dec 21, 2023 at 11:18 AM Michael Paquier wrote: > > On Thu, Dec 21, 2023 at 09:37:39AM +0530, Amit Kapila wrote: > > It depends on how one uses the function. For example, if one finds > > there is a conflict via pg_get_replication_slots() and wants to check > > the reason for the same via

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Michael Paquier
On Thu, Dec 21, 2023 at 09:37:39AM +0530, Amit Kapila wrote: > It depends on how one uses the function. For example, if one finds > there is a conflict via pg_get_replication_slots() and wants to check > the reason for the same via this new function then it would give the > correct answer. My

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Amit Kapila
On Thu, Dec 21, 2023 at 8:47 AM Michael Paquier wrote: > > On Wed, Dec 20, 2023 at 12:43:45PM +0100, Drouvot, Bertrand wrote: > > + 3 = wal_level insufficient on the primary > > server > > > > "." is missing at the end (to be consistent with 1 and 2). Same > > in the commit message. >

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Michael Paquier
On Wed, Dec 20, 2023 at 12:43:45PM +0100, Drouvot, Bertrand wrote: > + 3 = wal_level insufficient on the primary > server > > "." is missing at the end (to be consistent with 1 and 2). Same > in the commit message. > > + * Returns ReplicationSlotInvalidationCause enum value for valid

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Drouvot, Bertrand
Hi, On 12/20/23 10:55 AM, shveta malik wrote: On Wed, Dec 20, 2023 at 2:20 PM Amit Kapila wrote: PFA v2 patch. Addressed below comments: 1) Added test in 019_replslot_limit.pl 2) 'pg_get_slot_invalidation_cause' now returns error if the given slot does not exist 3) Corrected doc and commit

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Amit Kapila
On Wed, Dec 20, 2023 at 4:10 PM Drouvot, Bertrand wrote: > > On 12/20/23 9:50 AM, Amit Kapila wrote: > > On Wed, Dec 20, 2023 at 12:46 PM Drouvot, Bertrand > > wrote: > >> > > > >> 4 === > >> > >> + * Returns ReplicationSlotInvalidationCause enum value for valid > >> slot_name; > >> > >> I

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Drouvot, Bertrand
Hi, On 12/20/23 10:57 AM, shveta malik wrote: On Wed, Dec 20, 2023 at 12:46 PM Drouvot, Bertrand Worth to add some coverage in 019_replslot_limit.pl and 035_standby_logical_decoding.pl? I have recently added a test in 019_replslot_limit.pl in v2. Thanks! Do you suggest adding in

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Drouvot, Bertrand
Hi, On 12/20/23 9:50 AM, Amit Kapila wrote: On Wed, Dec 20, 2023 at 12:46 PM Drouvot, Bertrand wrote: On 12/20/23 7:01 AM, shveta malik wrote: Hello hackers, Attached is a patch which attempts to implement a new system function pg_get_slot_invalidation_cause('slot_name') to get

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread shveta malik
On Wed, Dec 20, 2023 at 12:46 PM Drouvot, Bertrand wrote: > > Hi, > > On 12/20/23 7:01 AM, shveta malik wrote: > > Hello hackers, > > > > Attached is a patch which attempts to implement a new system function > > pg_get_slot_invalidation_cause('slot_name') to get invalidation cause > > of a

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread shveta malik
On Wed, Dec 20, 2023 at 2:20 PM Amit Kapila wrote: > > On Wed, Dec 20, 2023 at 12:46 PM Drouvot, Bertrand > wrote: > > > > On 12/20/23 7:01 AM, shveta malik wrote: > > > Hello hackers, > > > > > > Attached is a patch which attempts to implement a new system function > > >

Re: Function to get invalidation cause of a replication slot.

2023-12-20 Thread Amit Kapila
On Wed, Dec 20, 2023 at 12:46 PM Drouvot, Bertrand wrote: > > On 12/20/23 7:01 AM, shveta malik wrote: > > Hello hackers, > > > > Attached is a patch which attempts to implement a new system function > > pg_get_slot_invalidation_cause('slot_name') to get invalidation cause > > of a replication

Re: Function to get invalidation cause of a replication slot.

2023-12-19 Thread Drouvot, Bertrand
Hi, On 12/20/23 7:01 AM, shveta malik wrote: Hello hackers, Attached is a patch which attempts to implement a new system function pg_get_slot_invalidation_cause('slot_name') to get invalidation cause of a replication slot. Thanks! +1 for the idea to display this information through an SQL

Function to get invalidation cause of a replication slot.

2023-12-19 Thread shveta malik
Hello hackers, Attached is a patch which attempts to implement a new system function pg_get_slot_invalidation_cause('slot_name') to get invalidation cause of a replication slot. Currently, users do not have a way to know the invalidation cause. One can only find out if the slot is invalidated