• Peter Eisentraut's avatar
    pg_controldata: Prevent division-by-zero errors · 4731d848
    Peter Eisentraut authored
    If the control file is corrupted and specifies the WAL segment size
    to be 0 bytes, calculating the latest checkpoint's REDO WAL file
    will fail with a division-by-zero error.  Show it as "???" instead.
    
    Also reword the warning message a bit and send it to stdout, like the
    other pre-existing warning messages.
    
    Add some tests for dealing with a corrupted pg_control file.
    
    Author: Nathan Bossart <bossartn@amazon.com>, tests by me
    4731d848
001_pg_controldata.pl 1.04 KB