Difference between revisions of "GRANT pg read all data TO xxx;"
Jump to navigation
Jump to search
↑ https://stackoverflow.com/a/67213972
↑ https://stackoverflow.com/a/67213972
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <code>[[GRANT]] [[pg_read_all_data]] TO xxx;</code> | + | <code>[[GRANT]] [[pg_read_all_data]] TO xxx;</code> <ref>https://stackoverflow.com/a/67213972</ref> |
− | Read all data (tables, views, sequences), as if having SELECT rights on those objects, and USAGE rights on all schemas, even without having it explicitly. This role does not have the role attribute BYPASSRLS set. If RLS is being used, an administrator may wish to set BYPASSRLS on roles which this role is GRANTed to. | + | Read all data ([[tables]], [[views]], [[sequences]]), as if having SELECT rights on those objects, and USAGE rights on all schemas, even without having it explicitly. This role does not have the role attribute BYPASSRLS set. If RLS is being used, an administrator may wish to set BYPASSRLS on roles which this role is GRANTed to. |
+ | |||
+ | :<code>[[create role]] USERNAME [[with login password]] 'PASSWORD';</code> | ||
+ | :<code>[[GRANT]] [[pg_read_all_data]] TO xxx;</code> <ref>https://stackoverflow.com/a/67213972</ref> | ||
+ | |||
+ | [[PostgreSQL read only user]]: | ||
+ | :<code>[[create role]] USERNAME [[with login password]] 'PASSWORD';</code> | ||
+ | :<code>[[GRANT]] [[pg_read_all_data]], [[pg_monitor]] TO xxx;</code> | ||
== Related == | == Related == | ||
Line 10: | Line 17: | ||
* [[PostgreSQL predefined roles]] | * [[PostgreSQL predefined roles]] | ||
* [[PostgreSQL users]] | * [[PostgreSQL users]] | ||
+ | * [[pg_monitor]] | ||
== See also == | == See also == | ||
+ | * {{PostgreSQL users}} | ||
* {{ALTER}} | * {{ALTER}} | ||
* {{GRANT}} | * {{GRANT}} | ||
[[Category:PostgreSQL]] | [[Category:PostgreSQL]] |
Latest revision as of 16:15, 20 September 2024
GRANT pg_read_all_data TO xxx;
[1]
Read all data (tables, views, sequences), as if having SELECT rights on those objects, and USAGE rights on all schemas, even without having it explicitly. This role does not have the role attribute BYPASSRLS set. If RLS is being used, an administrator may wish to set BYPASSRLS on roles which this role is GRANTed to.
create role USERNAME with login password 'PASSWORD';
GRANT pg_read_all_data TO xxx;
[2]
create role USERNAME with login password 'PASSWORD';
GRANT pg_read_all_data, pg_monitor TO xxx;
Related[edit]
read-only
GRANT SELECT ON ALL TABLES IN SCHEMA
- PostgreSQL predefined roles
- PostgreSQL users
- pg_monitor
See also[edit]
- PostgreSQL users, predefined roles:
pg_read_all_data, pg_monitor
,create role
,.pgpass
, PostgreSQL read only user ALTER, ALTER DATABASE, ALTER TABLE, ALTER DEFAULT PRIVILEGES, ALTER MATERIALIZED VIEW
GRANT
,\ddp
,GRANT USAGE
,GRANT ALL PRIVILEGES
,GRANT SELECT
, View GRANTs on Redshift,has_table_privilege
,has_schema_privilege
,HAS_DATABASE_PRIVILEGE
,SCHEMA
, Privileges,GRANT EXECUTE
Advertising: