How to CREATE USER in PostgreSQL

CREATE USER adds a new user to a PostgreSQL database cluster. You must be a database superuser to use this command.

Examples

1. Create a user with no password:
   CREATE USER jonathan;

2. Create a user with a password:
   CREATE USER davide WITH PASSWORD 'jw8s0F4';

3. Create a user with a password that is valid until the end of        2004. After one second has ticked in 2005, the password is no        longer valid.
  CREATE USER xen WITH PASSWORD 'jw8s0F4' VALID UNTIL '2005-01-01';

4. Create an account where the user can create databases:
   CREATE USER manuel WITH PASSWORD 'jw8s0F4' CREATEDB;


Compatibility
The CREATE USER statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation.

Comments

Popular posts from this blog

[FATAL] [DBT-10503] Template file is not specified

Resolving ORA-10635 and ORA-39171 Errors During BLOB Tablespace Maintenance

How to resolve RMAN-06035: wrong version of recover.bsq, expecting 11.2.0.4, found 11.2.0.2