public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: [email protected]
Subject: pgsql: Fix multiranges to behave more like dependent types.
Date: Wed, 14 Feb 2024 16:30:49 +0000
Message-ID: <[email protected]> (raw)
Fix multiranges to behave more like dependent types.
For most purposes, multiranges act like dependent objects of the
associated range type: you can't create them separately or drop them
separately. This is like the way that autogenerated array types
behave. However, a couple of points were overlooked: array types
automatically track the ownership of their base type, and array types
do not have their own permissions but use those of the base type,
while multiranges didn't emulate those behaviors. This is fairly
broken, mainly because pg_dump doesn't think it needs to worry about
multiranges as separate objects, and thus it fails to dump/restore
ownership or permissions of multiranges.
There's no apparent value in letting a multirange diverge from
its parent's ownership or permissions, so let's make them act like
arrays in these respects. However, we continue to let multiranges
be renamed or moved to a different schema independently of their
parent, since that doesn't break anything.
Discussion: https://postgr.es/m/[email protected]
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3e8235ba4f9cc3375b061fb5d3f3575434539b5f
Modified Files
--------------
src/backend/catalog/aclchk.c | 35 ++++++++++++++++++++++
src/backend/catalog/pg_type.c | 41 ++++++++++++++++++--------
src/backend/commands/typecmds.c | 42 +++++++++++++++++++++++----
src/bin/pg_dump/pg_dump.c | 8 ++---
src/test/regress/expected/dependency.out | 1 -
src/test/regress/expected/multirangetypes.out | 30 +++++++++++++++++++
src/test/regress/sql/multirangetypes.sql | 21 ++++++++++++++
7 files changed, 155 insertions(+), 23 deletions(-)
reply
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: Fix multiranges to behave more like dependent types.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox