| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix handling of COMMENT for domain constraints |
| Date: | 2019-06-12 02:35:31 |
| Message-ID: | [email protected] |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Fix handling of COMMENT for domain constraints
For a non-superuser, changing a comment on a domain constraint was
leading to a cache lookup failure as the code tried to perform the
ownership lookup on the constraint OID itself, thinking that it was a
type, but this check needs to happen on the type the domain constraint
relies on. As the type a domain constraint relies on can be guessed
directly based on the constraint OID, first fetch its type OID and
perform the ownership on it.
This is broken since 7eca575, which has split the handling of comments
for table constraints and domain constraints, so back-patch down to
9.5.
Reported-by: Clemens Ladisch
Author: Daniel Gustafsson, Michael Paquier
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 9.5
Branch
------
REL9_5_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/13f4b462dbe87996321c601d46acf2fad39628d0
Modified Files
--------------
src/backend/catalog/objectaddress.c | 24 +++++++++++++++++++++++-
src/test/regress/input/constraints.source | 15 +++++++++++++++
src/test/regress/output/constraints.source | 14 ++++++++++++++
3 files changed, 52 insertions(+), 1 deletion(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2019-06-12 16:30:15 | pgsql: Fix ALTER COLUMN TYPE failure with a partial exclusion constrain |
| Previous Message | Tom Lane | 2019-06-11 20:41:39 | Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.) |