Difference between revisions of "GRANT SELECT"

From wikieduonline
Jump to navigation Jump to search
 
(33 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
  
  
GRANT SELECT ON ALL TABLES IN [[SCHEMA]] [[public]] TO xxx;
+
==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>
  
GRANT SELECT ON mytable TO xxx;
+
=== [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>
  
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 ==
 +
* <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

Advertising: