Re: Foreign Key Validation after Reference Table Ownership Change

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "Battuello, Louis" <louis(dot)battuello(at)etasseo(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Foreign Key Validation after Reference Table Ownership Change
Date: 2018-03-21 17:39:16
Message-ID: 23491.1521653956@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Wed, Mar 21, 2018 at 8:30 AM, Battuello, Louis <
> louis(dot)battuello(at)etasseo(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Louis Battuello 2018-03-21 17:48:15 Re: Foreign Key Validation after Reference Table Ownership Change
Previous Message Louis Battuello 2018-03-21 17:18:58 Re: Foreign Key Validation after Reference Table Ownership Change