You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Grant access to all existing tables/sequences/functions
GRANT ALL PRIVILEGES ON SCHEMA public to api;
GRANT ALL ON ALL TABLES IN SCHEMA public to api;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public to api;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public to api;
Create user and grant role to this user
CREATE ROLE user_api WITH PASSWORD 'password' LOGIN;
GRANT api TO user_api;
Login as user_api and grant all privileges on future tables/sequences/functions
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO api;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO api;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO api;