Difference between revisions of "GRANT SELECT"
Jump to navigation
Jump to search
↑ https://stackoverflow.com/questions/760210/how-do-you-create-a-read-only-user-in-postgresql
(30 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | <code>[[GRANT]] SELECT</code> in [[Amazon RedShift]] and [[PostgreSQL]]. | ||
+ | * https://www.postgresql.org/docs/current/sql-grant.html | ||
− | + | ==Examples == | |
+ | === PostgreSQL === | ||
+ | * <code>[[GRANT SELECT ON ALL TABLES]] IN [[SCHEMA]] your_schema TO your_user;</code> | ||
+ | * <code>[[GRANT SELECT ON ALL TABLES IN SCHEMA public TO your_user;]]</code> | ||
− | + | === [https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT-examples.html Amazon RedShift] === | |
+ | * <code>[[GRANT SELECT ON ALL TABLES IN SCHEMA]] your_schema TO your_user;</code> | ||
+ | * <code>[[GRANT SELECT ON ALL TABLES IN SCHEMA]] your_schema [[TO GROUP]] your_group;</code> | ||
+ | * <code>[[GRANT SELECT ON]] mytable TO xxx;</code> | ||
− | + | * <code>GRANT SELECT ON mytable TO xxx;</code><ref>https://stackoverflow.com/questions/760210/how-do-you-create-a-read-only-user-in-postgresql</ref> | |
− | + | * <code>[[ALTER DEFAULT PRIVILEGES]] IN SCHEMA public [[GRANT SELECT ON TABLES TO]] xxx;</code> | |
== Related == | == Related == | ||
* <code>[[GRANT USAGE]]</code> | * <code>[[GRANT USAGE]]</code> | ||
+ | * [[Amazon Redshift]]: <code>[[has_table_privilege]]</code> | ||
+ | * [[GRANT ALL PRIVILEGES ON]] | ||
+ | * <code>[[GRANT EXECUTE]] ON ALL FUNCTIONS IN SCHEMA public TO user;</code> | ||
+ | * <code>[[community.postgresql.postgresql_privs]]</code> | ||
+ | |||
+ | |||
+ | == Errors == | ||
+ | * [[ERROR: permission denied for schema public]] | ||
+ | |||
+ | == Activities == | ||
+ | * [[Amazon Redshift: grant read only privileges to user]] | ||
== See also == | == See also == | ||
+ | * {{SELECT}} | ||
* {{GRANT}} | * {{GRANT}} | ||
[[Category:Redshift]] | [[Category:Redshift]] |
Latest revision as of 15:50, 5 July 2023
GRANT SELECT
in Amazon RedShift and PostgreSQL.
Examples[edit]
PostgreSQL[edit]
GRANT SELECT ON ALL TABLES IN SCHEMA your_schema TO your_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO your_user;
Amazon RedShift[edit]
GRANT SELECT ON ALL TABLES IN SCHEMA your_schema TO your_user;
GRANT SELECT ON ALL TABLES IN SCHEMA your_schema TO GROUP your_group;
GRANT SELECT ON mytable TO xxx;
GRANT SELECT ON mytable TO xxx;
[1]
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO xxx;
Related[edit]
GRANT USAGE
- Amazon Redshift:
has_table_privilege
- GRANT ALL PRIVILEGES ON
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO user;
community.postgresql.postgresql_privs
Errors[edit]
Activities[edit]
See also[edit]
- SELECT, GRANT SELECT ON
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: