• Heikki Linnakangas's avatar
    Avoid transient bogus page contents when creating a sequence. · 8d34f686
    Heikki Linnakangas authored
    Don't use simple_heap_insert to insert the tuple to a sequence relation.
    simple_heap_insert creates a heap insertion WAL record, and replaying that
    will create a regular heap page without the special area containing the
    sequence magic constant, which is wrong for a sequence. That was not a bug
    because we always created a sequence WAL record after that, and replaying
    that overwrote the bogus heap page, and the transient state could never be
    seen by another backend because it was only done when creating a new
    sequence relation. But it's simpler and cleaner to avoid that in the first
    place.
    8d34f686
sequence.c 42.3 KB