Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyhhs-0000LY-Ui for pgsql-general@arkaria.postgresql.org; Wed, 21 Mar 2018 17:39:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eyhhq-0007vC-VS for pgsql-general@arkaria.postgresql.org; Wed, 21 Mar 2018 17:39:22 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyhhq-0007v2-Mf for pgsql-general@lists.postgresql.org; Wed, 21 Mar 2018 17:39:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyhhn-0003Uw-WE for pgsql-general@postgresql.org; Wed, 21 Mar 2018 17:39:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w2LHdGxr023492; Wed, 21 Mar 2018 13:39:16 -0400 From: Tom Lane To: "David G. Johnston" cc: "Battuello, Louis" , "pgsql-general@postgresql.org" Subject: Re: Foreign Key Validation after Reference Table Ownership Change In-reply-to: References: <20180321083033.f495bf0537e129b62c3edf58e37f64ff.23347c6e15.mailapi@email02.godaddy.com> Comments: In-reply-to "David G. Johnston" message dated "Wed, 21 Mar 2018 09:50:23 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <23490.1521653956.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 21 Mar 2018 13:39:16 -0400 Message-ID: <23491.1521653956@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Wed, Mar 21, 2018 at 8:30 AM, Battuello, Louis < > louis.battuello@etasseo.com> wrote: >> So, user_2 needs usage on the schema containing its newly owned reference >> table even though user_1 is performing the insert on a table in the other >> schema? Interesting. I though the validation was only dependent on user_1's >> ACL. > ​It was the only thing that made sense, given the error, though I agree it > seems a bit odd.​ The point is you can't resolve a name like "schema_1.something" unless you have USAGE on schema_1. So the RI-checking query, which is run as the owner of the table, fails at parse time. regards, tom lane