Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread Louis Battuello
> On Mar 21, 2018, at 2:36 PM, David G. Johnston wrote: > > And altering an owner of a table to one lacking usage and create permissions > on the schema is possible but unadvisible. > > David J. Exactly. The cause of my mistake was changing the REFERENCED table ownership to a role without g

Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread David G. Johnston
On Wednesday, March 21, 2018, Tom Lane wrote: > Louis Battuello writes: > >> 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. > > > That certainly m

Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread Tom Lane
Louis Battuello writes: >> 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. > That certainly makes sense for user_2 that owns the reference table and is

Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread Adrian Klaver
On 03/21/2018 10:48 AM, Louis Battuello wrote: 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. That certainly makes sense for user_2 that owns the refere

Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread Louis Battuello
> > 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. That certainly makes sense for user_2 that owns the reference table and is blocked by not having usa

Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread Tom Lane
"David G. Johnston" writes: > On Wed, Mar 21, 2018 at 8:30 AM, Battuello, Louis < > louis.battue...@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.

Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread Louis Battuello
Agreed. It would certainly make sense that user_2 have usage on the schema in order to operate against the table owned by user_2. I just found it confusing that the discrepancy would cause an issue for user_1, which had all necessary privileges on the schema and references on the reference table

Re: Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread David G. Johnston
On Wed, Mar 21, 2018 at 8:30 AM, Battuello, Louis < louis.battue...@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 de

RE: Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread Battuello, Louis
n Key Validation after Reference Table Ownership Change From: "David G. Johnston" Date: 3/21/18 11:23 am To: "Battuello, Louis" Cc: "pgsql-gene...@postgresql.org" On Wednesday, March 21, 2018, Battuello, Louis wrote: What permission is being violated a

Re: Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread David G. Johnston
On Wednesday, March 21, 2018, Battuello, Louis wrote: > What permission is being violated at the schema level? > USAGE https://www.postgresql.org/docs/10/static/sql-grant.html David J.

Foreign Key Validation after Reference Table Ownership Change

2018-03-21 Thread Battuello, Louis
This should be simple, but I must be missing something obvious. Running a change of table ownership on PostgreSQL 9.4.16. I changed the owner of a reference table in another, yet, after granting references to the referencing table owner, the key validation encounters an error. create role user