1

I am trying to create a SUPERUSER PostgreSQL user with an encrypted password using psql.

CREATE USER my_username SUPERUSER WITH ENCRYPTED PASSWORD 'MYPASS';

However the above command results in the following error

ERROR:  syntax error at or near "WITH"
LINE 1: CREATE USER my_username SUPERUSER WITH ENCRYPTED PASSWORD 'M...

But the following command works fine

CREATE USER my_username WITH ENCRYPTED PASSWORD 'MYPASS';

I am using PostgreSQL 13, what am I doing wrong?

Arya
  • 8,473
  • 27
  • 105
  • 175

1 Answers1

2

From here:

https://www.postgresql.org/docs/current/sql-createuser.html

The correct form is:

CREATE USER my_username WITH SUPERUSER ENCRYPTED PASSWORD 'MYPASS';
Adrian Klaver
  • 15,886
  • 2
  • 17
  • 28