Difference between revisions of "PostgreSQL read only user"
Jump to navigation
Jump to search
(Created page with " == See also == * {{postgreSQL users}} * {{GRANT}} Category:PostgreSQL") |
|||
(14 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | * <code>[[CREATE ROLE]] my_[[readonly]] WITH LOGIN PASSWORD '123456';</code> | ||
+ | * <code>[[GRANT CONNECT on database]] YourDB to my_[[readonly]];</code> | ||
+ | * <code>[[GRANT]] [[pg_read_all_data]], [[pg_monitor]] TO my_readonly;</code> | ||
+ | select * from your_table; | ||
+ | value | ||
+ | ------- | ||
+ | (0 rows) | ||
+ | |||
+ | |||
+ | == Related == | ||
+ | * [[GRANT CONNECT]] | ||
+ | * [[PostgreSQL predefined roles]] | ||
== See also == | == See also == | ||
* {{postgreSQL users}} | * {{postgreSQL users}} | ||
+ | * {{create role}} | ||
* {{GRANT}} | * {{GRANT}} | ||
[[Category:PostgreSQL]] | [[Category:PostgreSQL]] |
Latest revision as of 11:17, 23 September 2024
CREATE ROLE my_readonly WITH LOGIN PASSWORD '123456';
GRANT CONNECT on database YourDB to my_readonly;
GRANT pg_read_all_data, pg_monitor TO my_readonly;
select * from your_table; value ------- (0 rows)
Related[edit]
See also[edit]
- PostgreSQL users, predefined roles:
pg_read_all_data, pg_monitor
,create role
,.pgpass
, PostgreSQL read only user CREATE ROLE
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: