0

I am trying to disable the triggers for one of my PostgreSQL table using the following code

def disable_triggers(self):
    with connection.cursor() as cursor:
        cursor.execute('ALTER TABLE "frontend_awsregions" DISABLE TRIGGER ALL;')

But this is giving me following error

... ...
return self.cursor.execute(sql) django.db.utils.ProgrammingError: permission denied: "RI_ConstraintTrigger_a_25437" is a system trigger

when I execute the same query in PGAdmin, its working properly

Shobi
  • 10,374
  • 6
  • 46
  • 82

1 Answers1

0

I went and turned on the superuser permission from PgAdmin for the current DB user. and it fixed it for me.

Enable superuser permissions from PgAdmin

Shobi
  • 10,374
  • 6
  • 46
  • 82