• Heikki Linnakangas's avatar
    Force a checkpoint in CREATE DATABASE before starting to copy the files, · db31adda
    Heikki Linnakangas authored
    to process any pending unlinks for the source database.
    
    Before, if you dropped a relation in the template database just before
    CREATE DATABASE, and a checkpoint happened during copydir(), the checkpoint
    might delete a file that we're just about to copy, causing lstat() in
    copydir() to fail with ENOENT.
    
    Backpatch to 8.3, where the pending unlinks were introduced.
    
    Per report by Matthew Wakeling and analysis by Tom Lane.
    db31adda
dbcommands.c 48.4 KB