URL: http://www.phpfreaks.com/postgresqlmanual/page/app-createuser.html

PostgreSQL This took some time to figure out (found answer here)and it might come in handy sometime in the far future so I write it down here and now.
To create a user for the postgresql database on linux you have to do that from the linux user called postgres.

This would not work:


peterbe@computer:~$ createuser peterbe

What you need to do is this:


peterbe@computer:~$ su -
...log in as root...
computer:~# su postgres
computer:/root$ createuser peterbe

Now I know!

Comments

Peter Bengtsson

Test comment. Please ignore.

Anonymous

TESTING

Your email will never ever be published.

Previous:
Vivisimo - clustered searching January 8, 2004 Misc. links
Next:
PythonPoint January 10, 2004 Python
Related by category:
How to find which git SHA it was when you merged in the default branch February 26, 2026 Linux
hylite as an executable October 15, 2025 Linux
Elasticsearch memory usage December 11, 2025 Linux
How to count the number of non-blank lines with Bash September 3, 2025 Linux
Related by keyword:
Adding client-to-server sync to PissueTracker March 20, 2025 React, JavaScript, Bun
Connecting with psycopg2 without a username and password February 24, 2011 Python
How I performance test PostgreSQL locally on macOS December 10, 2018 Web development, PostgreSQL, macOS
When Docker is too slow, use your host January 11, 2018 Web development, Django, Docker, macOS