pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: clemens@ladisch.de
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15833: defining a comment on a domain constraint fails with wrong OID
Date: Wed, 5 Jun 2019 14:15:02 -0400
Message-ID: <20190605181502.GA10753@alvherre.pgsql> (raw)
In-Reply-To: <15833-808e11904835d26f@postgresql.org>

On 2019-Jun-05, PG Bug reporting form wrote:

> postgres=> CREATE DOMAIN ddd AS text CONSTRAINT ccc CHECK (TRUE);
> CREATE DOMAIN
> postgres=> COMMENT ON CONSTRAINT ccc ON DOMAIN ddd IS 'test';
> ERROR:  42704: type with OID 444275 does not exist
> LOCATION:  pg_type_ownercheck, aclchk.c:4585

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.

I'm surprised that this has been broken for so long with no reports ...
I broke it in 7eca575d1c28 (December 2014).

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (11+ messages)  latest in thread

Message-ID: <20190605181502.GA10753@alvherre.pgsql>
Permalink:  ../20190605181502.GA10753@alvherre.pgsql/
Also on:    postgresql.org/message-id/20190605181502.GA10753@alvherre.pgsql

 · 

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: 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: <20190605181502.GA10753@alvherre.pgsql>

* 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