Difference between revisions of "PostgreSQL: CREATE USER"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 14: Line 14:
 
  Output:
 
  Output:
 
  [[CREATE ROLE]]
 
  [[CREATE ROLE]]
 +
 +
Assign a role with: <code>[[GRANT]]</code> command.
  
 
* [[List users]]: <code>[[\du]]</code>
 
* [[List users]]: <code>[[\du]]</code>

Revision as of 09:09, 9 September 2021

create user, creates a new user in PostgreSQL

Examples

  • create user your_username

Create a new user:

create user your_username;
Output:
CREATE ROLE

Create a new user and assign a password:

CREATE USER your_username WITH ENCRYPTED PASSWORD 'your_pass';
Output:
CREATE ROLE
Assign a role with: GRANT command.

Related terms

See also

Advertising: