Difference between revisions of "PostgreSQL: Database roles"

From wikieduonline
Jump to navigation Jump to search
 
(12 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
Create role:  
 
Create role:  
 
* <code>[[create role]]</code>
 
* <code>[[create role]]</code>
 +
* <code>[[create user]]</code>
 +
 +
* <code>[[PostgreSQL: CREATE USER|CREATE USER]] name WITH Role XXX</code>
  
 
List [[users]] and roles:  
 
List [[users]] and roles:  
Line 8: Line 11:
 
* <code>[[\du+]]</code>
 
* <code>[[\du+]]</code>
 
* <code>[[SELECT rolname FROM pg_roles;]]</code>
 
* <code>[[SELECT rolname FROM pg_roles;]]</code>
* <code>SELECT * FROM [[pg_roles]];</code>
+
* <code>[[SELECT * FROM pg_roles]];</code>
 +
 
 +
Assign roles:
 +
* <code>[[GRANT "your-defined role" TO "your username";]]</code>
  
 
== Related terms ==
 
== Related terms ==
Line 17: Line 23:
 
* <code>[[rds_superuser]]</code> role in [[AWS RDS]]
 
* <code>[[rds_superuser]]</code> role in [[AWS RDS]]
 
* [[Ansible roles]]
 
* [[Ansible roles]]
 +
* [[ALTER USER myuser WITH SUPERUSER;]]
 +
* [[DROP ROLE]]
 +
* [[community.postgresql.postgresql_privs]]
 +
* <code>[[\list+]]</code>
  
 
== See also ==
 
== See also ==
 
* {{Role}}
 
* {{Role}}
* {{SQL}}
+
* {{GRANT}}
 +
* {{PostgreSQL Privileges}}
  
 
[[Category:PostgreSQL]]
 
[[Category:PostgreSQL]]

Latest revision as of 12:07, 16 December 2022

Advertising: