Created
June 16, 2025 20:24
-
-
Save diodonfrost/c2dacb15a147edf65aa00e762df8d184 to your computer and use it in GitHub Desktop.
Revisions
-
diodonfrost created this gist
Jun 16, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ -- 1. Create the user role CREATE USER app_user PASSWORD 'secure_password'; -- 2. Give them access to the database GRANT CONNECT ON DATABASE ma_base TO app_user; -- 3. Give them access to the schema GRANT USAGE ON SCHEMA public TO app_user; -- 4. Give them privileges on the tables GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO app_user; -- 5. For future tables ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO app_user;