Is there an efficient way to bulk import data into a PostgreSQL 9.4 database on RDS that makes extensive use of foreign key constraints? The standard method of using pg_restore fails because RDS does not appear to allow you to disable system triggers.
For example, using the command:
pg_restore --host foo.rds.amazonaws.com --port 5432 --username "bar" --role=rds_superuser --dbname "baz" --data-only --disable-triggers --no-owner --no-privileges --no-tablespaces --verbose --exit-on-error "baz.dump"
Results in error messages such as:
pg_restore: [archiver (db)] could not execute query: ERROR: permission denied: "RI_ConstraintTrigger_a_30548" is a system trigger
Command was: ALTER TABLE xxxx DISABLE TRIGGER ALL;