diff --git a/lib/srv/db/postgres/sql/update-permissions.sql b/lib/srv/db/postgres/sql/update-permissions.sql index 50a50e32cd62d..16a564146d13d 100644 --- a/lib/srv/db/postgres/sql/update-permissions.sql +++ b/lib/srv/db/postgres/sql/update-permissions.sql @@ -7,8 +7,7 @@ DECLARE diff_count_1 INTEGER; diff_count_2 INTEGER; BEGIN - - grant_data = COALESCE(permissions_->'tables', '[]'::JSONB); + grant_data = COALESCE(NULLIF(permissions_->'tables', 'null'), '[]'::JSONB); -- If the user has active connections to current database, verify that permissions haven't changed. IF EXISTS (SELECT usename FROM pg_stat_activity WHERE usename = username AND datname = current_database()) THEN