pg_replication_slot_advance to return NULL instead of 0/0 if slotnot advanced - Mailing list pgsql-hackers

From Michael Paquier
Subject pg_replication_slot_advance to return NULL instead of 0/0 if slotnot advanced
Date
Msg-id 20180525052805.GA15634@paquier.xyz
Whole thread Raw
Responses Re: pg_replication_slot_advance to return NULL instead of 0/0 if slotnot advanced
List pgsql-hackers
Hi all,

When attempting to use multiple times pg_replication_slot_advance on a
slot, then the caller gets back directly InvalidXLogRecPtr as result,
for example:
=# select * from pg_replication_slot_advance('popo', 'FF/0');
 slot_name |  end_lsn
-----------+-----------
 popo      | 0/60021E0
(1 row)
=# select * from pg_replication_slot_advance('popo', 'FF/0');
 slot_name | end_lsn
-----------+---------
 popo      | 0/0
(1 row)

Wouldn't it be more simple to return NULL to mean that the slot could
not be moved forward?  That would be easier to parse for clients.
Please see the attached.

Thanks,
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: XLogWrite uses palloc within a critical section
Next
From: Kyotaro HORIGUCHI
Date:
Subject: In what range of the code can we read debug_query_string?