mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-17 09:25:32 +00:00
21 lines
718 B
Plaintext
21 lines
718 B
Plaintext
-- Grant all permissions on database
|
|
GRANT ALL PRIVILEGES ON DATABASE <db_name> TO <user_name>;
|
|
|
|
-- Grant connection permissions on database
|
|
GRANT CONNECT ON DATABASE <db_name> TO <user_name>;
|
|
|
|
-- Grant permissions on schema
|
|
GRANT USAGE ON SCHEMA public TO <user_name>;
|
|
|
|
-- Grant permissions to functions
|
|
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO <user_name>;
|
|
|
|
-- Grant permissions to select, update, insert, delete, on a all tables
|
|
GRANT SELECT, UPDATE, INSERT ON ALL TABLES IN SCHEMA public TO <user_name>;
|
|
|
|
-- Grant permissions, on a table
|
|
GRANT SELECT, UPDATE, INSERT ON <table_name> TO <user_name>;
|
|
|
|
-- Grant permissions, to select, on a table
|
|
GRANT SELECT ON ALL TABLES IN SCHEMA public TO <user_name>;
|