[PostgreSQL] Display privileges and default privileges in schema DDL
See original GitHub issueHello,
Working on PostgreSQL schemas with DBeaver 6.1.4, I noticed that in the generated DDL for schemas the privileges and default privileges are not displayed.
pgAdmin
CREATE SCHEMA <schema> AUTHORIZATION <admin>;
GRANT ALL ON SCHEMA <schema> TO <admin>;
GRANT ALL ON SCHEMA <schema> TO <role_1>;
GRANT USAGE ON SCHEMA <schema> TO <role_2>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema>
GRANT INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON TABLES
TO <role_1>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema>
GRANT SELECT ON TABLES
TO <role_2>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema>
GRANT SELECT, UPDATE, USAGE ON SEQUENCES
TO <role_1>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema>
GRANT SELECT, UPDATE, USAGE ON SEQUENCES
TO <role_2>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema>
GRANT EXECUTE ON FUNCTIONS
TO <role_1>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema>
GRANT EXECUTE ON FUNCTIONS
TO <role_2>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema>
GRANT USAGE ON TYPES
TO <role_1>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema>
GRANT USAGE ON TYPES
TO <role_2>;
DBeaver 6.1.4
CREATE SCHEMA <schema> AUTHORIZATION <admin>;
As I can see, the missing statements are:
GRANT <what> ON SCHEMA <schema> TO <who>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema> GRANT <what-s> ON TABLES TO <who>;
Is it possible to add these informations?
Thanks for your great work.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
15: ALTER DEFAULT PRIVILEGES - PostgreSQL
The privileges can be set globally (i.e., for all objects created in the current database), or just for objects created in specified schemas....
Read more >How to manage DEFAULT PRIVILEGES for USERs on a ...
PostgreSQL grants default privileges on some types of objects to PUBLIC . No privileges are granted to PUBLIC by default on tables, columns, ......
Read more >sql - postgresql - view schema privileges - Stack Overflow
in console util psql: \dn+. will show you. Name | Owner | Access privileges | Description.
Read more >How to Handle Privileges in PostgreSQL | by Shengyu Huang
Yes, when we do not specify any particular schema in ALTER DEFAULT PRIVILEGES , the changes apply to the whole database. So one...
Read more >Postgres: Display granted permissions on objects : DBE-2629
We currently default for the most part to Navicat, which has been very problematic in a number of ways, but in order to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @usless,
thanks for your reply. Unfortunately not. There are only visible the “GRANT …” entries:
Entries starting with “ALTER DEFAULT PRIVILEGES …” are missing completely:
Same for functions, sequences, etc.
Hello @uslss @serge-rider
I’ve downloaded v7.1.0 and I still cannot see what I’m looking for…
Maybe something is not clear between us, I’m trying to see rights and default priviliges on schema in the source tab, like in PgAdmin (see my initial post). Or maybe it is avalaible somewhere else?
Thanks for your feedback.