0

I use Postgresql 9.5 in a Vagrant environment: Ubuntu 16.04 Server with the latest updates. I use a Yii2 application. Of course I know there is open issue about this problem, so maybe this is Yii2 related.

I got the following error:

[yii\db\Exception] SQLSTATE[42501]: Insufficient privilege: 7 ERROR:  permission denied: "RI_ConstraintTrigger_c_16773" is a system trigger
The SQL being executed was: ALTER TABLE "public"."address" DISABLE TRIGGER ALL; ALTER TABLE "public"."category" DISABLE TRIGGER ALL; ALTER TABLE "public"."customer" DISABLE TRIGGER ALL;

This error happens when I want to run Codeception tests. But I did not see any config problems. (Because when I use the app as normal user, the database operations works fine.)

I have tried this solution. But it does not work, or this one: but the same, no any effect.

1 Answer 1

0

Only roles with superuser permission can change the foreign key triggers in PostgreSQL as it can tamper data integrity. Using a database user with superuser permission should solve your problem.

Reference: https://www.endpointdev.com/blog/2012/10/postgres-system-triggers-error/

Sign up to request clarification or add additional context in comments.

4 Comments

I have tried this, but the same... no result. The most funny this is a living project, and I did not got any problem during the summers, but now... it just throws these errors. The owner the database (user) and superuser does not matter, still got this problem.
Tried using postgres user?
yes. It seems something wrong with the foreign keys, or I do not get why it is so special in Postgresql
@uglypointer FYI the blog post you reference has moved here: endpointdev.com/blog/2012/10/postgres-system-triggers-error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.