Re: BUG #15833: defining a comment on a domain constraint fails with wrong OID

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: clemens(at)ladisch(dot)de, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15833: defining a comment on a domain constraint fails with wrong OID
Date: 2019-06-07 05:42:33
Message-ID: 20190607054233.GG1736@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jun 05, 2019 at 02:15:02PM -0400, Alvaro Herrera wrote:
> Confirmed. It works for superusers, which explains why the existing
> regression tests pass -- and that's because check_object_ownership()
> (which is handing the OBJECT_DOMCONSTRAINT case wrongly) is bypassed for
> superusers. Annoyingly, get_object_address does not return the type's
> OID, only the domain's.

Well, it wouldn't be a problem to do a syscache lookup and then use
the type from contypid, no? It seems to me that it would be more
consistent to just add a pg_domain_constraint_ownercheck() in aclchk.c
as all the syscache lookups happen their for all the other objects
types. What do you think?
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-06-07 06:15:30 BUG #15838: [contrib] vacuumlo: schema variable checked for NULL three times
Previous Message Alvaro Herrera 2019-06-06 14:40:11 Re: Test suite fails on macOS after update to 9.6.13 and 11.3