I have a table with a foreign key type which links to table wp_types. Whenever I try and insert a row into that table I get the error:
ERROR: permission denied for schema base
LINE 1: SELECT 1 FROM ONLY "base"."wp_types" x WHERE "id" OPERATOR(p...
^
QUERY: SELECT 1 FROM ONLY "base"."wp_types" x WHERE "id" OPERATOR(pg_catalog.=) $1 FOR SHARE OF x
The query is being executed as postgres. Also I do not understand what this query is trying to do, it is clearly linked with checking the foreign key constraints but I don't understand how.
From postgresql docs:
If ONLY is specified, only that table is scanned. If ONLY is not specified, the table and all its descendant tables (if any) are scanned.
As you mentioned error is connected with checking foreign keys. When ONLY is specified postgres can not check them and it may cause an error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With