Before Starting To Work With PostgreSQL
Who starts to work with PostgreSQL on Linux has a bad initial experience doing the first authentication. The installation process of this database server creates a SO
user, the postgres
, which has super user access, able to do all initial steps of a beginner programmer, like to create users and databases. But, how can we use this user if we don’t know its password?
I followed the steps below, which was compiled from different Google’s sources:
-
change to the root user or a sudo user, who is able to change to another user without informing its password:
# su root
or jump step 2 doing:
# sudo su postgres
-
change to the Postgres user:
# su postgres
-
create a database server user with the same username of yours:
# createuser -d -r -s -P (your_user_name)
This command will create a database server super user, able to create new databases and roles. The command will request a password and then the user will be created.
-
change to your user:
# su (your_user_name)
-
execute the command to create a database:
# createdb (database-name)
Recent Posts
Can We Trust Marathon Pacers?
Introducing LibRunner
Clojure Books in the Toronto Public Library
![](/images/posts/clojure-books-library.jpg)
Once Upon a Time in Russia
![](/images/posts/saint-petersburg.jpg)
FHIR: A Standard For Healthcare Data Interoperability
![](/images/posts/dragon-sketch.png)
First Release of CSVSource
![](https://www.hildeberto.com/csvsource/images/waterloo_tree_inventory.png)
Astonishing Carl Sagan's Predictions Published in 1995
![](/images/posts/carl-sagan-1987.jpg)
Making a Configurable Go App
![](/images/posts/2021-04-11-configurable-go-app.png)
Dealing With Pressure Outside of the Workplace
![](/images/posts/measuring-pressure-golang.png)
Reacting to File Changes Using the Observer Design Pattern in Go
![](/images/posts/observer-design-pattern.png)
Provisioning Azure Functions Using Terraform
![](/images/posts/terraform-azure-function.png)
Taking Advantage of the Adapter Design Pattern
![](/images/posts/2021-02-28-adapter-go-redis.png)
Applying The Adapter Design Pattern To Decouple Libraries From Go Apps
![](/images/posts/adapter-pattern.png)
Using Goroutines to Search Prices in Parallel
![](/images/posts/golang-sync-goroutine.jpg)
Applying the Strategy Pattern to Get Prices from Different Sources in Go
![](/images/posts/golang-strategy-pattern.png)