pg_replication_slot_advance to return NULL instead of 0/0 if slot not advanced

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_replication_slot_advance to return NULL instead of 0/0 if slot not advanced
Date: 2018-05-25 05:28:05
Message-ID: 20180525052805.GA15634@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
slot-advance-null.patch text/x-diff 1.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2018-05-25 05:54:50 In what range of the code can we read debug_query_string?
Previous Message Kyotaro HORIGUCHI 2018-05-25 04:45:21 XLogWrite uses palloc within a critical section