The Fedora PostgreSQL guide, while technically correct, is written in a very strange manner with numerous dead ends and wrong commands in my opinion. I’ve just signed up and failed to gain edit access to the wiki for the second time, so I’m documenting here in the hopes that the lonely Googler/Searcher will find this ranking on the first page too. The correct commands to set up postgres on Fedora are:
su - postgres (You then need to non-optionally create your databases under the postgres user)
CREATE USER lenny WITH PASSWORD 'leonard'; (you can also create a password for your PSQL user with \password your_password )
CREATE DATABASE carl OWNER lenny;
\q to get out of postgres and back to shell. Now you can switch back to your main account and start using your database.
su giannidunk (in my case)
psql carl and go for it!
Please feel free to post your improvements below! I hope someone with Wiki permissions sees this and re-orders that horrible document. See the original document for explanation of what these commands do!
Yours truly – A developer who’s just trying to get some work done.
sudo gedit /var/lib/pgsql/data/pg_hba.conf - If you’re getting ident errors from your app you’ll probably need to perform the accepted solution described here (tldr: edit host all all 127.0.0.1/32 ident to host all all 127.0.0.1/32 md5 )
Hello @nikodunk, welcome, and thank you.
This is not the purpose of this category, but it doesn’t matter.
The Fedora wiki contains a lot of outdated documents. Nowadays it’s more a scratch-board than a documentation source.
It would be nice if you propose what you wrote here as a quick doc. And subsequently fix the wiki page by redirecting it to the new document. If you would like to participate, here you can find how to contribute to quick-docs: Contribute to Quick Docs :: Fedora Docs
By the way, thanks to @alciregi s efforts, I’ve re-routed the old Wiki to the new Quick Docs. So once/if the changes are merged into the Quick Docs, we’ll have a fully updated guide at the correct address