Обсуждение: pgsql: Avoid transient bogus page contents when creating a sequence.

Поиск
Список
Период
Сортировка

pgsql: Avoid transient bogus page contents when creating a sequence.

От
Heikki Linnakangas
Дата:
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(-)