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

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Avoid transient bogus page contents when creating a sequence.
Дата
Msg-id E1WcVWC-0008VM-7x@gemulon.postgresql.org
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: pg_stat_statements forgot to let previous occupant of hook get c
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix rm_desc routine of b-tree page delete records.