postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.alarm_types ADD CONSTRAINT fk_entity_tenant_id FOREIGN KEY (tenant_id) REFERENCES public.tenant(id) ON DELETE CASCADE; pg_restore: creating FK CONSTRAINT "public.device fk_firmware_device" pg_restore: from TOC entry 16324; 2606 482943 FK CONSTRAINT device fk_firmware_device postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.device ADD CONSTRAINT fk_firmware_device FOREIGN KEY (firmware_id) REFERENCES public.ota_package(id); pg_restore: creating FK CONSTRAINT "public.device_profile fk_firmware_device_profile" pg_restore: from TOC entry 16331; 2606 482928 FK CONSTRAINT device_profile fk_firmware_device_profile postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.device_profile ADD CONSTRAINT fk_firmware_device_profile FOREIGN KEY (firmware_id) REFERENCES public.ota_package(id); pg_restore: creating FK CONSTRAINT "public.integration fk_integration_converter" pg_restore: from TOC entry 16326; 2606 28508831 FK CONSTRAINT integration fk_integration_converter postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.integration ADD CONSTRAINT fk_integration_converter FOREIGN KEY (converter_id) REFERENCES public.converter(id); pg_restore: creating FK CONSTRAINT "public.integration fk_integration_downlink_converter" pg_restore: from TOC entry 16327; 2606 28508836 FK CONSTRAINT integration fk_integration_downlink_converter postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.integration ADD CONSTRAINT fk_integration_downlink_converter FOREIGN KEY (downlink_converter_id) REFERENCES public.converter(id); pg_restore: creating FK CONSTRAINT "public.oauth2_mobile fk_mobile_oauth2_params" pg_restore: from TOC entry 16338; 2606 482922 FK CONSTRAINT oauth2_mobile fk_mobile_oauth2_params postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.oauth2_mobile ADD CONSTRAINT fk_mobile_oauth2_params FOREIGN KEY (oauth2_params_id) REFERENCES public.oauth2_params(id) ON DELETE CASCADE; pg_restore: creating FK CONSTRAINT "public.notification_rule fk_notification_rule_template_id" pg_restore: from TOC entry 16347; 2606 34794700 FK CONSTRAINT notification_rule fk_notification_rule_template_id postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.notification_rule ADD CONSTRAINT fk_notification_rule_template_id FOREIGN KEY (template_id) REFERENCES public.notification_template(id); pg_restore: creating FK CONSTRAINT "public.device_group_ota_package fk_ota_package_device_group_ota_package" pg_restore: from TOC entry 16340; 2606 2420371 FK CONSTRAINT device_group_ota_package fk_ota_package_device_group_ota_package postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.device_group_ota_package ADD CONSTRAINT fk_ota_package_device_group_ota_package FOREIGN KEY (ota_package_id) REFERENCES public.ota_package(id) ON DELETE CASCADE; pg_restore: creating FK CONSTRAINT "public.oauth2_registration fk_registration_oauth2_params" pg_restore: from TOC entry 16336; 2606 482895 FK CONSTRAINT oauth2_registration fk_registration_oauth2_params postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.oauth2_registration ADD CONSTRAINT fk_registration_oauth2_params FOREIGN KEY (oauth2_params_id) REFERENCES public.oauth2_params(id) ON DELETE CASCADE; pg_restore: creating FK CONSTRAINT "public.rule_node_state fk_rule_node_state_node_id" pg_restore: from TOC entry 16329; 2606 33246 FK CONSTRAINT rule_node_state fk_rule_node_state_node_id postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.rule_node_state ADD CONSTRAINT fk_rule_node_state_node_id FOREIGN KEY (rule_node_id) REFERENCES public.rule_node(id) ON DELETE CASCADE; pg_restore: creating FK CONSTRAINT "public.device fk_software_device" pg_restore: from TOC entry 16325; 2606 482948 FK CONSTRAINT device fk_software_device postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.device ADD CONSTRAINT fk_software_device FOREIGN KEY (firmware_id) REFERENCES public.ota_package(id); pg_restore: creating FK CONSTRAINT "public.device_profile fk_software_device_profile" pg_restore: from TOC entry 16332; 2606 482933 FK CONSTRAINT device_profile fk_software_device_profile postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.device_profile ADD CONSTRAINT fk_software_device_profile FOREIGN KEY (firmware_id) REFERENCES public.ota_package(id); pg_restore: creating FK CONSTRAINT "public.tenant fk_tenant_profile" pg_restore: from TOC entry 16328; 2606 33310 FK CONSTRAINT tenant fk_tenant_profile postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.tenant ADD CONSTRAINT fk_tenant_profile FOREIGN KEY (tenant_profile_id) REFERENCES public.tenant_profile(id); pg_restore: creating FK CONSTRAINT "public.user_auth_settings fk_user_auth_settings_user_id" pg_restore: from TOC entry 16342; 2606 28508823 FK CONSTRAINT user_auth_settings fk_user_auth_settings_user_id postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.user_auth_settings ADD CONSTRAINT fk_user_auth_settings_user_id FOREIGN KEY (user_id) REFERENCES public.tb_user(id); pg_restore: creating FK CONSTRAINT "public.user_settings fk_user_id" pg_restore: from TOC entry 16348; 2606 34794736 FK CONSTRAINT user_settings fk_user_id postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.user_settings ADD CONSTRAINT fk_user_id FOREIGN KEY (user_id) REFERENCES public.tb_user(id) ON DELETE CASCADE; pg_restore: creating FK CONSTRAINT "public.widgets_bundle_widget fk_widget_type" pg_restore: from TOC entry 16351; 2606 55513891 FK CONSTRAINT widgets_bundle_widget fk_widget_type postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.widgets_bundle_widget ADD CONSTRAINT fk_widget_type FOREIGN KEY (widget_type_id) REFERENCES public.widget_type(id) ON DELETE CASCADE; pg_restore: creating FK CONSTRAINT "public.widgets_bundle_widget fk_widgets_bundle" pg_restore: from TOC entry 16350; 2606 55513886 FK CONSTRAINT widgets_bundle_widget fk_widgets_bundle postgres pg_restore: error: could not execute query: ERROR: cannot execute ALTER TABLE in a read-only transaction Command was: ALTER TABLE ONLY public.widgets_bundle_widget ADD CONSTRAINT fk_widgets_bundle FOREIGN KEY (widgets_bundle_id) REFERENCES public.widgets_bundle(id) ON DELETE CASCADE; pg_restore: creating ACL "SCHEMA public" pg_restore: from TOC entry 18134; 0 0 ACL SCHEMA public postgres pg_restore: error: could not execute query: ERROR: cannot execute REVOKE in a read-only transaction Command was: REVOKE ALL ON SCHEMA public FROM rdsadmin; REVOKE ALL ON SCHEMA public FROM PUBLIC; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC; pg_restore: warning: errors ignored on restore: 4175