Difference between revisions of "GRANT SELECT"

From wikieduonline
Jump to navigation Jump to search
 
(7 intermediate revisions by 3 users not shown)
Line 4: Line 4:
  
 
==Examples ==
 
==Examples ==
PostgreSQL:
+
=== PostgreSQL ===
[[GRANT SELECT ON ALL TABLES]] IN [[SCHEMA]] your_schema TO your_user;
+
* <code>[[GRANT SELECT ON ALL TABLES]] IN [[SCHEMA]] your_schema TO your_user;</code>
[[GRANT SELECT ON ALL TABLES]] IN [[SCHEMA]] [[public]] TO your_user;
+
* <code>[[GRANT SELECT ON ALL TABLES IN SCHEMA public TO your_user;]]</code>
  
[[Amazon RedShift]]: https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT-examples.html
+
=== [https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT-examples.html Amazon RedShift] ===
[[GRANT SELECT ON ALL TABLES IN SCHEMA]] your_schema TO your_user;
+
* <code>[[GRANT SELECT ON ALL TABLES IN SCHEMA]] your_schema TO your_user;</code>
[[GRANT SELECT ON ALL TABLES IN SCHEMA]] your_schema [[TO GROUP]] your_group;
+
* <code>[[GRANT SELECT ON ALL TABLES IN SCHEMA]] your_schema [[TO GROUP]] your_group;</code>
  
[[GRANT SELECT ON]] mytable TO xxx;
+
* <code>[[GRANT SELECT ON]] mytable TO xxx;</code>
  
GRANT SELECT ON mytable TO xxx;<ref>https://stackoverflow.com/questions/760210/how-do-you-create-a-read-only-user-in-postgresql</ref>
+
* <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>
  
[[ALTER DEFAULT PRIVILEGES]] IN SCHEMA public [[GRANT SELECT ON TABLES TO]] xxx;
+
* <code>[[ALTER DEFAULT PRIVILEGES]] IN SCHEMA public [[GRANT SELECT ON TABLES TO]] xxx;</code>
  
 
== Related ==
 
== Related ==
 
* <code>[[GRANT USAGE]]</code>
 
* <code>[[GRANT USAGE]]</code>
 +
* <code>[[GRANT SELECT ON]]</code>
 
* [[Amazon Redshift]]: <code>[[has_table_privilege]]</code>
 
* [[Amazon Redshift]]: <code>[[has_table_privilege]]</code>
 
* [[GRANT ALL PRIVILEGES ON]]
 
* [[GRANT ALL PRIVILEGES ON]]
[[GRANT EXECUTE]] ON ALL FUNCTIONS IN SCHEMA public TO user;
+
* <code>[[GRANT EXECUTE]] ON ALL FUNCTIONS IN SCHEMA public TO user;</code>
 +
* <code>[[community.postgresql.postgresql_privs]]</code>
  
[[community.postgresql.postgresql_privs_module]]
+
== Errors ==
 +
* [[ERROR: permission denied for schema public]]
  
 
== Activities ==
 
== Activities ==

Latest revision as of 08:05, 18 July 2024

Advertising: