Thread

  1. Re: Elimination of the repetitive code at the SLRU bootstrap functions.

    Alvaro Herrera <alvherre@alvh.no-ip.org> — 2025-07-07T15:01:52Z

    On 2025-Jul-02, Evgeny wrote:
    
    > Álvaro, Andrey, Alexander, hello!
    > 
    > Since the master branch became the PG19dev and PG18 is now stable, I have
    > directed this patch into PG19. Could we continue with it now?
    
    Sure, I pushed your patch now.
    
    > Álvaro, should I rename the SimpleLruZeroPageExt function?
    
    Well, I didn't like that name -- normally, names ending in Ext represent
    a version of the routine named without the "Ext" that has some additions
    to its argument list, so the Ext is an extended version or something
    like that.  That pattern does not fit this case.  I used the name
    "SimpleLruZeroAndWritePage" instead, and rewrote the comment to explain
    that it's a simple wrapper that does exactly what the name says.
    Because of this I also removed some comments in the callsites, because
    those would have been redundant with the new name.  So, no you don't
    need to do anything, because I already did it.
    
    I also went back and accepted Andrey's suggestion to have Int64 in the
    name of the XLogSimpleInsert routine, because it's not totally
    unthinkable that we'll have some other simple wrapper in the future.
    I made it return the LSN, because while no current caller needs it, some
    external caller might want to have that.
    
    I also moved each routine to a more natural place, namely just below the
    function they wrap.  The pattern of adding stuff at the end of the file
    just results in messy code, so don't do that.
    
    -- 
    Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
    "Tiene valor aquel que admite que es un cobarde" (Fernandel)