- CREATE USER <name> WITH PASSWORD '<password>';
- GRANT ALL PRIVILEGES ON DATABASE "database_name" to <name>;
- GRANT CONNECT ON DATABASE database_name TO <name>;
- GRANT ALL ON SCHEMA schema_name TO <name>;
- --Conectado a la base de datos
- DO $$
- DECLARE
- r RECORD;
- BEGIN
- FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = schema_name) LOOP
- BEGIN
- EXECUTE 'GRANT ALL PRIVILEGES ON TABLE public.' || quote_ident(r.tablename) || ' TO <name>';
- EXCEPTION
- WHEN insufficient_privilege THEN
- RAISE NOTICE 'Insufficient privileges to grant on table: %', r.tablename;
- WHEN OTHERS THEN
- RAISE NOTICE 'Skipping table: %, Error: %', r.tablename, SQLERRM;
- END;
- END LOOP;
- END $$;
[text] asdas
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: