I'm doing DB migration and I would need to disable the foreign key constraints on a table in order to migrate peacefully.
From this: How do I temporarily disable triggers in PostgreSQL?
I've gathered that I would need superuser permissions to run:
SET session_replication_role = replica;
and
SET session_replication_role = DEFAULT;
However; on google cloud platform it is impossible to get those privileges as detailed in the docs:
The postgres user is part of the cloudsqlsuperuser role and has the following attributes (privileges): CREATEROLE, CREATEDB, and LOGIN. It does not have the SUPERUSER or REPLICATION attributes
and to this StackOverflow question: upgrade user to superuser in postgres google cloud
I also tried to disable triggers via:
alter table orders.orders disable trigger all;
However; for this it seems to me, that I also need su rights:
ERROR: permission denied: "RI_ConstraintTrigger_a_25017" is a system trigger
So then, what is the solution, can I even disable triggers // foreign key constraints on this particular table or not?