Hi dott-nagayama,
Azure Database for PostgreSQL Flexible Server sets default_transaction_read_only and transaction_read_only to ON for new connections when entering a protective read-only mode, typically triggered by storage nearing 95% utilization during heavy operations like your terminated UPDATEs. This overrides portal settings (even OFF) and persists beyond restarts, as it's an instance-level safeguard against corruption.
Issue Cause:
Check PostgreSQL server logs (Azure Portal > Diagnostics settings > Logs) for "storage full" or threshold warnings around the admin termination timestamp—this matches known patterns from heavy writes. Query current storage: SELECT pg_database_size(current_database()) / 1024.0^3 AS size_gb; and compare to allocated via Metrics blade.
Reset Steps:
Reclaim space to exit read-only:
Run VACUUM FULL or pg_repack on bloated tables (use Azure Data Studio).
Drop unused indexes/objects or partition large tables.
Scale storage up (Portal > Compute + storage > Enable auto-grow). Verify post-fix: New connections show SHOW default_transaction_read_only; as OFF.
Prevent Recurrence:
Set Azure Monitor alerts for storage >85%; enable HA zone-redundancy if not active for failover resilience. For zone-redundant setups like yours, check node health in Portal post-incident.