pgsql: Avoid transient bogus page contents when creating a sequence. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Avoid transient bogus page contents when creating a sequence.
Date
Msg-id E1WcVWC-0008VM-7x@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Avoid transient bogus page contents when creating a sequence.

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8d34f6862853b4b67e29b368dfedf7d4c28d694b

Modified Files
--------------
src/backend/commands/sequence.c |   55 ++++++++++++---------------------------
1 file changed, 16 insertions(+), 39 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: pg_stat_statements forgot to let previous occupant of hook get c
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix rm_desc routine of b-tree page delete records.