pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: clemens@ladisch.de
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15833: defining a comment on a domain constraint fails with wrong OID
Date: Fri, 7 Jun 2019 14:42:33 +0900
Message-ID: <20190607054233.GG1736@paquier.xyz> (raw)
In-Reply-To: <20190605181502.GA10753@alvherre.pgsql>
References: <15833-808e11904835d26f@postgresql.org>
	<20190605181502.GA10753@alvherre.pgsql>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (11+ messages)  latest in thread

Message-ID: <20190607054233.GG1736@paquier.xyz>
Permalink:  ../20190607054233.GG1736@paquier.xyz/
Also on:    postgresql.org/message-id/20190607054233.GG1736@paquier.xyz

 · 

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: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, alvherre@2ndquadrant.com, clemens@ladisch.de, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15833: defining a comment on a domain constraint fails with wrong OID
  In-Reply-To: <20190607054233.GG1736@paquier.xyz>

* 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