PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> CREATE TABLE myschema.fktable (customer_id int REFERENCES
> myschema.pktable(id));
> INSERT INTO myschema.pktable VALUES (1);
> DELETE FROM myschema.pktable;
> Expected result: no errors; the row is successfully deleted from
> myschema.pktable.
> Actual result: the final DELETE fails with
> ERROR: permission denied for schema myschema
This is operating as designed: the foreign key enforcement triggers
run as the table owner, not as the calling user. Changing that would
not be a good idea.
regards, tom lane