I use PostgreSQL Logical Decoding functionality for retrieving WAL contents:
SELECT * FROM pg_create_logical_replication_slot(...)
SELECT * FROM pg_logical_slot_get_changes('<my_slot>', NULL, NULL);
These calls are implemented in the SQL interface within a "C" / ODBC programming framework.
This works very nice for me. Data records are fetched one by one in a row - as expected.
Yet - there are certain cases where I need to re-position the slot flow to a past LSN. The Logical Decoding REPLICATION interface provides means for achieving that. For example the PG_RECVLOGICAL program introduces a "--startpos=X/Y" option that works as I expect.
Is there an equivalent option in the "SQL" interface? I guess that both interfaces share much in common. So - I went through the documentation and did not manage to find any equivalent option in the SQL interface. For now - the SQL interface moves forward only and cannot retract back to a past LSN. Did I miss something here? Does any body have any clue or experience with that?
Kindest regards
Hillel.