• Tom Lane's avatar
    Be more careful about marking catalog columns NOT NULL by default. · fc032bed
    Tom Lane authored
    The bug fixed in commit 72eab84a would not have occurred if initdb
    had a less surprising rule about which columns should be marked
    NOT NULL by default.  Let's make that rule be strictly that the
    column must be fixed-width and its predecessors must be fixed-width
    and NOT NULL, removing the hacky and unsafe exceptions for oidvector
    and int2vector.
    
    Since we do still want all existing oidvector and int2vector columns
    to be marked NOT NULL, we have to put BKI_FORCE_NOT_NULL labels on
    them.  But making this less magic and more documented seems like a
    good idea, even if it's a shade more verbose.
    
    I didn't bump catversion since the initial catalog contents are
    not actually changed by this patch.  Note however that the
    contents of postgres.bki do change, and feeding an old copy of
    that to a new backend will produce wrong results.
    
    Discussion: https://postgr.es/m/204760.1595181800@sss.pgh.pa.us
    fc032bed
pg_index.h 2.91 KB