• Tom Lane's avatar
    Improve generation algorithm for database system identifier. · 5035701e
    Tom Lane authored
    As noted some time ago, the original coding had a typo ("|" for "^")
    that made the result less unique than intended.  Even the intended
    behavior is obsolete since it was based on wanting to produce a
    usable value even if we didn't have int64 arithmetic --- a limitation
    we stopped supporting years ago.  Instead, let's redefine the system
    identifier as tv_sec in the upper 32 bits (same as before), tv_usec
    in the next 20 bits, and the low 12 bits of getpid() in the remaining
    bits.  This is still hardly guaranteed-universally-unique, but it's
    noticeably better than before.  Per my proposal at
    <29019.1374535940@sss.pgh.pa.us>
    5035701e
xlog.c 342 KB