pgsql: Fix corruption of pg_shdepend when copying deps from template da

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix corruption of pg_shdepend when copying deps from template da
Date: 2021-10-21 01:42:23
Message-ID: E1mdN67-0005M3-O8@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix corruption of pg_shdepend when copying deps from template database

Using for a new database a template database with shared dependencies
that need to be copied over was causing a corruption of pg_shdepend
because of an off-by-one computation error of the index number used for
the values inserted with a slot.

Issue introduced by e3931d0. Monitoring the rest of the code, there are
no similar mistakes.

Reported-by: Sven Klemm
Author: Aleksander Alekseev
Reviewed-by: Daniel Gustafsson, Michael Paquier
Discussion: https://postgr.es/m/CAJ7c6TP0AowkUgNL6zcAK-s5HYsVHVBRWfu69FRubPpfwZGM9A@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5040c96415a062a1016e0a6b9a4dc9f26a7f356e

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2021-10-21 02:52:04 pgsql: Remove unused wait events.
Previous Message Tom Lane 2021-10-20 22:44:44 pgsql: Improve pg_regress.c's infrastructure for issuing psql commands.