Difference between revisions of "GRANT"

From wikieduonline
Jump to navigation Jump to search
Line 47: Line 47:
 
* <code>[[\dn+]]</code>
 
* <code>[[\dn+]]</code>
 
* <code>[[\ddp]]</code> <ref>https://dba.stackexchange.com/a/184339</ref>
 
* <code>[[\ddp]]</code> <ref>https://dba.stackexchange.com/a/184339</ref>
 +
[[\dt *.*]]
 
* <code>[[CREATE ROLE]]</code>
 
* <code>[[CREATE ROLE]]</code>
 
* {{TOC operation databases}}
 
* {{TOC operation databases}}

Revision as of 09:01, 10 October 2022

Examples

SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, USAGE
GRANT SELECT ON mytable TO xxx
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

Amazon Redshift

Amazon Redshift system information functions:

AWS RDS

Activities

Related terms

\dt *.*

See also

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