From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add more sanity checks with callers of changeDependencyFor()
Date: Mon, 10 Jul 2023 04:09:10 +0000
Message-ID: <E1qIiD1-002m3x-0g@gemulon.postgresql.org> (raw)
Add more sanity checks with callers of changeDependencyFor()
changeDependencyFor() returns the number of pg_depend entries changed,
or 0 if there is a problem. The callers of this routine expect only one
dependency to change, but they did not check for the result returned.
The following code paths gain checks:
- Namespace for extensions.
- Namespace for various object types (see AlterObjectNamespace).
- Planner support function for a function.
Some existing error messages related to all that are reworded to be more
consistent with the project style, and the new error messages added
follow the same style. This change has exposed one bug fixed a bit
earlier with bd5ddbe.
Reviewed-by: Heikki Linnakangas, Akshat Jaimini
Discussion: https://postgr.es/m/ZJzD/rn+UbloKjB7@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9b286858e3ab1647304c5fbb2b1529de6bead8f7
Modified Files
--------------
src/backend/commands/alter.c | 8 +++++---
src/backend/commands/cluster.c | 4 ++--
src/backend/commands/extension.c | 8 +++++---
src/backend/commands/functioncmds.c | 10 +++++++---
src/backend/commands/tablecmds.c | 2 +-
src/backend/commands/typecmds.c | 2 +-
6 files changed, 21 insertions(+), 13 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Add more sanity checks with callers of changeDependencyFor()
In-Reply-To: <E1qIiD1-002m3x-0g@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox