Setting Redshift Isolation Level

Viewed 23

I'm attempting to set the isolation level in redshift and I'm getting an error that there are users connected.

Database "db" is being accessed by other users,so the database isolation level cannot be altered.

I (superuser) have tried setting the db connection limit to 0, done a soft_reboot, killed pids manually, but that error persists. Has anyone tried this successfully? Below is my last code block:

ALTER DATABASE db CONNECTION LIMIT 0 ; -- no non-superuser conns
ALTER USER etl_user NOCREATEUSER; -- stop etl superuser conns
SELECT reboot_cluster();
ALTER DATABASE BI ISOLATION LEVEL SNAPSHOT; -- why not try here
SELECT * FROM SVV_TRANSACTIONS; -- catch any other pids
-- terminate all pids
SELECT pg_terminate_backend(...);

ALTER DATABASE BI ISOLATION LEVEL SNAPSHOT; -- set new snapshot isolation
ALTER USER etl_user CREATEUSER; -- restore etl superuser conns
ALTER DATABASE db CONNECTION LIMIT UNLIMITED; -- restore non-superuser conns

0 Answers
Related