wiki:mysql:postgresql_chage_db_owner
Смена пользователя БД в postgresql
DO $$ DECLARE tbl RECORD; BEGIN -- Loop through each table in the specified schemes FOR tbl IN SELECT tablename,schemaname FROM pg_catalog.pg_tables WHERE schemaname IN ( 'api', 'help', 'hotel', 'log', 'public', 'samosad', 'whatsapp') -- Добавьте ваши схемы в список LOOP -- Alter the owner of each table EXECUTE 'ALTER TABLE ' || quote_ident(tbl.schemaname) || '.' || quote_ident(tbl.tablename) || ' OWNER TO diman'; -- Replace all your schemes and 'diman' with the new owner's name END LOOP; END; $$;
wiki/mysql/postgresql_chage_db_owner.txt · Последнее изменение: 2025/04/23 21:02 — Diman