Editing GRANT
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
* PostgreSQL Documentation: https://www.postgresql.org/docs/current/sql-grant.html | * PostgreSQL Documentation: https://www.postgresql.org/docs/current/sql-grant.html | ||
− | + | Example: | |
* <code>[[GRANT ALL PRIVILEGES]] ON DATABASE YOUR_DB_NAME TO YOUR_USERNAME;</code> | * <code>[[GRANT ALL PRIVILEGES]] ON DATABASE YOUR_DB_NAME TO YOUR_USERNAME;</code> | ||
− | * <code> | + | * <code>[[GRANT USAGE]]</code> |
+ | * <code>GRANT USAGE ON [[ALL SEQUENCES IN SCHEMA]] your_schema TO mygrp; </code><ref>https://stackoverflow.com/a/10353730</ref> | ||
− | |||
− | + | GRANT your_defined_role TO your_username; | |
− | + | GRANT ROLE | |
− | |||
− | |||
− | |||
− | |||
− | |||
SELECT * FROM your_table_name; | SELECT * FROM your_table_name; | ||
[[ERROR: permission denied for table]] your_table_name | [[ERROR: permission denied for table]] your_table_name | ||
− | + | [[GRANT SELECT ON mytable TO xxx]] | |
− | + | * List roles: <code>[[\du]]</code> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | System information functions: | |
− | |||
− | |||
− | |||
− | |||
* <code>[[HAS_TABLE_PRIVILEGE]]</code> | * <code>[[HAS_TABLE_PRIVILEGE]]</code> | ||
* <code>[[HAS_SCHEMA_PRIVILEGE]]</code> | * <code>[[HAS_SCHEMA_PRIVILEGE]]</code> | ||
Line 40: | Line 25: | ||
* <code>[[HAS_DATABASE_PRIVILEGE]]</code> | * <code>[[HAS_DATABASE_PRIVILEGE]]</code> | ||
− | |||
− | |||
− | |||
− | |||
* [[View GRANTs on Redshift]]: (<code>[[HAS_TABLE_PRIVILEGE]]</code>) | * [[View GRANTs on Redshift]]: (<code>[[HAS_TABLE_PRIVILEGE]]</code>) | ||
* [[Amazon Redshift: show permissions]]: (<code>[[has_schema_privilege]]</code>) | * [[Amazon Redshift: show permissions]]: (<code>[[has_schema_privilege]]</code>) | ||
− | |||
== Related terms == | == Related terms == | ||
− | |||
* [[Amazon Redshift: GRANT]] | * [[Amazon Redshift: GRANT]] | ||
− | |||
− | |||
* <code>[[\ddp]]</code> <ref>https://dba.stackexchange.com/a/184339</ref> | * <code>[[\ddp]]</code> <ref>https://dba.stackexchange.com/a/184339</ref> | ||
− | |||
* <code>[[CREATE ROLE]]</code> | * <code>[[CREATE ROLE]]</code> | ||
− | * | + | * {{TOC operation databases}} |
− | |||
== See also == | == See also == | ||
− | |||
* {{GRANT}} | * {{GRANT}} | ||
+ | * {{PostgreSQL}} | ||
+ | |||
[[Category:PostgreSQL]] | [[Category:PostgreSQL]] |
Advertising: