Thread: Re: protocol-level wait-for-LSN

Re: protocol-level wait-for-LSN

From
Jelte Fennema-Nio
Date:
On Mon, 28 Oct 2024 at 16:51, Peter Eisentraut <peter@eisentraut.org> wrote:
> Thoughts?

+                   snprintf(xloc, sizeof(xloc), "%X/%X",
LSN_FORMAT_ARGS(logptr))
+                   pq_sendstring(&buf, xloc);

nit: I feel that sending the LSN as a string seems unnecessarily
wasteful of bytes. I'd rather send it as its binary representation.



Re: protocol-level wait-for-LSN

From
Peter Eisentraut
Date:
On 30.10.24 10:03, Jelte Fennema-Nio wrote:
> On Mon, 28 Oct 2024 at 16:51, Peter Eisentraut <peter@eisentraut.org> wrote:
>> Thoughts?
> 
> +                   snprintf(xloc, sizeof(xloc), "%X/%X",
> LSN_FORMAT_ARGS(logptr))
> +                   pq_sendstring(&buf, xloc);
> 
> nit: I feel that sending the LSN as a string seems unnecessarily
> wasteful of bytes. I'd rather send it as its binary representation.

My thinking here was: This protocol is also used by things that are not 
PostgreSQL.  They might have other representations for "position to wait 
for".  I don't know, but it's something to think about.