Difference between revisions of "GRANT"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
* <code>GRANT [[pg_read_all_data]] TO xxx;</code>
 
* <code>GRANT [[pg_read_all_data]] TO xxx;</code>
 +
* <code>GRANT pg_read_all_data, [[pg_monitor]] TO xxx;</code>
  
  
* <code>[[SELECT]], INSERT, UPDATE, [[DELETE]], TRUNCATE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, [[USAGE]]</code>
+
* <code>[[SELECT]], INSERT, UPDATE, [[DELETE]], TRUNCATE, REFERENCES, TRIGGER, CREATE, [[CONNECT]], TEMPORARY, EXECUTE, [[USAGE]]</code>
  
 
* [[GRANT SELECT]]: <code>[[GRANT SELECT ON mytable TO xxx]]</code>
 
* [[GRANT SELECT]]: <code>[[GRANT SELECT ON mytable TO xxx]]</code>
Line 58: Line 59:
 
* <code>[[CREATE ROLE]]</code>
 
* <code>[[CREATE ROLE]]</code>
 
* [[DELETE PostgreSQL]]
 
* [[DELETE PostgreSQL]]
* [[Privileges]]
+
* [[PostgreSQL Privileges]]
  
 
== See also ==
 
== See also ==

Latest revision as of 16:18, 20 September 2024

Examples[edit]


GRANT USAGE
GRANT USAGE ON ALL SEQUENCES IN SCHEMA your_schema TO mygrp; [1]

Command: GRANT "your-defined_role" TO "your_username";

Output: GRANT ROLE
SELECT * FROM your_table_name;
ERROR: permission denied for table your_table_name
psql -h you_dp_ip -U postgres -p 5432  << EOF
CREATE DATABASE "yourdbname";
CREATE USER "yourusername" WITH PASSWORD yourpassword;
GRANT ALL PRIVILEGES ON DATABASE "yourdbname" to "yourusername";
GRANT ALL PRIVILEGES ON SCHEMA public to "yourusername";
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "yourdbname";
EOF


GRANT CONNECT

Amazon Redshift[edit]

Amazon Redshift system information functions:

AWS RDS[edit]

Activities[edit]

Related terms[edit]

\dt *.*

See also[edit]

  • https://stackoverflow.com/a/10353730
  • https://dba.stackexchange.com/a/184339
  • Advertising: