Issue
I'm trying to learn how to configure and setup a Postgres database, I am using WSL/Ubuntu. I am following along with this guide. I'm at the point where I am to create a user but I keep receiving a syntax error and I'm struggling to figure out how I can continue.
postgres=# sudo -u postgres createuser rncongi;
ERROR: syntax error at or near "sudo"
LINE 1: sudo -u postgres createuser rncongi;
Thank you for your help!
Solution
sudo
is a Linux command, not a SQL command that you can run from within psql
.
Additionally createuser
is also a command line tool (that needs to run outside of `psql), not a SQL command
But as you are already logged into psql
as the superuser, use the SQL command create user
to create new user
postgres=# create user rncongi;
Answered By - a_horse_with_no_name