Creating postgresql user account by hand

I had no idea where to put this, so I put it here. I apologize if this goes in a more specific category; I couldn't find an appropriate one, so just posted it here (since it does concern a port, but one I built myself). Anyway, I built Postgresql 11.1 from their source code downloads, but have no idea how to create the user account for it to run under. I tried digging through the port to see if that would reveal something I'm missing but no luck there either. So, how do I create the user account that pkg creates without actually installing the package?
 
Build it from ports. You can find it in /usr/ports/databases/postgresql11-server

It will create the user postgres and group postgres UID 770 for you.
 
...
Still, why not rely on databases/postgresql11-server or the binary package instead? No need to build the sourcecode yourself: # pkg install postgresql11-server and done.

Perhaps, because conservative people do like the classic uid 70 for user pgsql so much more compared to the fancy new one 770 for user postgres.

The first thing which I do after installing PostgreSQL > 9 from the ports is:
pw userdel postgres; pw useradd -u 70 -n pgsql -c "PostgreSQL Daemon" -d /usr/local/pgsql -s /bin/sh
 
I built it manually because it wasn't showing up in pkg as a package, and I have the latest pkg repository information. Ill check again but either way, there's no point in building it from ports since I already built it from source. Thank you for the command though -- I'll definitely be using that. Thanks all for your suggestions.
 
Back
Top