Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYaRP-0000FN-AU for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Jun 2019 18:15:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hYaRM-00057j-RA for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Jun 2019 18:15:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYaRM-00057c-Jn for pgsql-bugs@lists.postgresql.org; Wed, 05 Jun 2019 18:15:12 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYaRI-00007U-VM for pgsql-bugs@lists.postgresql.org; Wed, 05 Jun 2019 18:15:11 +0000 Received: by mail-qk1-x743.google.com with SMTP id d15so5756947qkl.4 for ; Wed, 05 Jun 2019 11:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=gsdGESvi1FIjp1jDcXHFJDHWIRjJZCXv192fD/qkkrM=; b=CmmOSPAfV8AzEu1ah9DOoGzjfudHfVSHCod/LKWUdajrwa/y6jW1vPdU3hcibVu+/h mc1g+ffMyoU/T8Z73BnKsHROuEqBif8r+DrQ4L/lTmrar6XZIB7ZXYELWyK2OUFJImHp Dya/Y0vlZktRp+UfMQwpXLQpgOsMZvYCjzRb9N7LLKB01lid47sJk4xUhJuTE2LR16Dj XmZ+llu6qv6vdKA+W7Y5/wfYZ9I8d8u4Asy3g8ddVgtPfuWTCHCjbrPfoopUc1GNNTGa QGQDKwwBj1Hfqs5wBx+pwwXcdUZiFsdnq7WD3IzeZXr9bw3jBkUUNqpzgB7KH9nEc1ja KeMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=gsdGESvi1FIjp1jDcXHFJDHWIRjJZCXv192fD/qkkrM=; b=hOQZr0YH2mtR2zGTH58FpajtCQHzm5YT74j4HhkHdnLPxVNGTqhuCnaGWvWPz8uNp2 z7virPIhwM1qA6YovFf6m+OzZYRCUrM/xWhU6dTq0jkMKgQWbhhTpKQBn87ZvJVTt031 3aFAyrYWDD4ycQYISwshxcETpqkalborCU98/7CXvqbJ7Ukxn1dPH/LTcZ03p2WtQysI 1vOHChuhKo26baNAbbr7oWlfdBh7ANBYOHl5XcQeEZ2WbF6P/CAVV/r/2MFMAefyxgzD 1mKGjF5pFrWT+z0Vi0XW+nD/98RQezD15lXieBUArzaq39/jyvGw9bVLYMlBiI/5cV/y SY/w== X-Gm-Message-State: APjAAAXKn63WvfavLu6WwO6ggjK+vi9FzIiICWZPgjh1koAZML6DxYJr 8rYbupO3tgfXX/Uq1mEeZbR8HWbhclqinA== X-Google-Smtp-Source: APXvYqx+gpJSWDvv4TWRA95itcV/TQZSji9kIEf75A+Gl5jr4LWdobviX9QJDGmx3eVxq8qGzEhq/Q== X-Received: by 2002:a37:a094:: with SMTP id j142mr34833149qke.2.1559758506414; Wed, 05 Jun 2019 11:15:06 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([177.154.139.202]) by smtp.gmail.com with ESMTPSA id j22sm6300811qtp.0.2019.06.05.11.15.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2019 11:15:05 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 90D3A12099B; Wed, 5 Jun 2019 14:15:02 -0400 (-04) Date: Wed, 5 Jun 2019 14:15:02 -0400 From: Alvaro Herrera To: clemens@ladisch.de, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15833: defining a comment on a domain constraint fails with wrong OID Message-ID: <20190605181502.GA10753@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <15833-808e11904835d26f@postgresql.org> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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