Search Postgresql Archives

Re: Foreign Key Validation after Reference Table Ownership Change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Louis Battuello <louis.battuello@xxxxxxxxxxx> 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 blocked by not having usage on the reference table’s schema.

> But, user_1 owns both schemas and has usage on both but no longer owns the reference table in one schema. Why is user_1’s insert on the referencing table failing? Is the validation of the FK no longer done as user_1?

Exactly, it's done as the owner of the referencing table.  (I don't recall
whether that's uniformly true for all types of FK-enforcement queries,
but evidently it's true for this case.)

			regards, tom lane





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux