Using Postgresql in non-daemon way

I don't like to install servers on my local and run these as a systemd service. This is why i am a big fan of the Docker.

But sometimes i just want to use servers as a specific app. Without install system-wide.

You know that, as instance; when you install #postgresql, it is create a user, installs files to your root directories, changes the ownerships and creates service files bla bla bla.

Today, i wanted to run postgresql as not a systemd service. Its easier than you think.

adduser postgres #create user from ui in macos
su postgres
mkdir ./var/data
./psql/initdb ./var/data -U postgres -W
#write password
./bin/postgres -D var/pgsql/data -k .
./bin/psql -h
#its ok now, let create a db
./bin/createdb hedefim -h
#you can create another super user
./bin/createuser -s hedefim_user -W -h
#write new password

#you can now connect the database with your new user
./bin/psql -U hedefim_user -W hedefim -h

how its easy, right.

talk soon.

#en #postgresql