Editing PostgreSQL: CREATE USER
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: | ||
<code>[[create user]]</code>, creates a new user in PostgreSQL | <code>[[create user]]</code>, creates a new user in PostgreSQL | ||
− | * Official documentation: https://www.postgresql.org/docs/ | + | * Official documentation: https://www.postgresql.org/docs/13/sql-createuser.html |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Examples == | == Examples == | ||
Line 39: | Line 9: | ||
Output: | Output: | ||
[[CREATE ROLE]] | [[CREATE ROLE]] | ||
− | |||
− | |||
− | |||
− | |||
=== Create a new user with errors === | === Create a new user with errors === | ||
Line 60: | Line 26: | ||
Output: | Output: | ||
ERROR: role "your_username" already exists | ERROR: role "your_username" already exists | ||
− | |||
− | |||
Assign a role with <code>[[GRANT]]</code> command: | Assign a role with <code>[[GRANT]]</code> command: | ||
Line 71: | Line 35: | ||
== Related terms == | == Related terms == | ||
− | |||
* [[Create database (PostgreSQL)]] | * [[Create database (PostgreSQL)]] | ||
* <code>[[ALTER USER]] YOUR_USER WITH PASSWORD 'your_new_password';</code> | * <code>[[ALTER USER]] YOUR_USER WITH PASSWORD 'your_new_password';</code> | ||
* <code>[[sudo]] -u postgres [[psql]]</code> | * <code>[[sudo]] -u postgres [[psql]]</code> | ||
− | * <code>[[ | + | * <code>[[GRANT]]</code> |
− | * | + | * {{TOC operation databases}} |
− | |||
− | |||
== See also == | == See also == | ||
− | * {{ | + | * {{psql}} |
− | |||
* {{SQL}} | * {{SQL}} | ||
+ | * {{PostgreSQL}} | ||
[[Category:PostgreSQL]] | [[Category:PostgreSQL]] |
Advertising: