pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix handling of COMMENT for domain constraints 5+ messages / 1 participants [nested] [flat]
* pgsql: Fix handling of COMMENT for domain constraints @ 2019-06-12 02:35 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2019-06-12 02:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/15833-808e11904835d26f@postgresql.org Backpatch-through: 9.5 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ceac4505d3428a8414b4f3d6708ea81506811a5f 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(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix handling of COMMENT for domain constraints @ 2019-06-12 02:35 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2019-06-12 02:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/15833-808e11904835d26f@postgresql.org Backpatch-through: 9.5 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/fa5f3a4bcca7c222b4ab5a6aba27373aea49a2ec 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(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix handling of COMMENT for domain constraints @ 2019-06-12 02:35 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2019-06-12 02:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/15833-808e11904835d26f@postgresql.org Backpatch-through: 9.5 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/56a932533aa2de49d654ca401e6593b3228627ce 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(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix handling of COMMENT for domain constraints @ 2019-06-12 02:35 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2019-06-12 02:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/15833-808e11904835d26f@postgresql.org Backpatch-through: 9.5 Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ff1a25601e750e50a77fe09ceb6ed473f93d8e93 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(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix handling of COMMENT for domain constraints @ 2019-06-12 02:35 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2019-06-12 02:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/15833-808e11904835d26f@postgresql.org 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(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2019-06-12 02:35 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-06-12 02:35 pgsql: Fix handling of COMMENT for domain constraints Michael Paquier <michael@paquier.xyz> 2019-06-12 02:35 pgsql: Fix handling of COMMENT for domain constraints Michael Paquier <michael@paquier.xyz> 2019-06-12 02:35 pgsql: Fix handling of COMMENT for domain constraints Michael Paquier <michael@paquier.xyz> 2019-06-12 02:35 pgsql: Fix handling of COMMENT for domain constraints Michael Paquier <michael@paquier.xyz> 2019-06-12 02:35 pgsql: Fix handling of COMMENT for domain constraints Michael Paquier <michael@paquier.xyz>
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