Last month, I create a database on Vercel Postgres to store the data in a wildlife conservation webiste.
However, the free version has monthly limitations on data storage and transfers.
To avoid wasting online resources, I decide to set up a local PostgreSQL environment to facilitate the debugging process for the upcoming web application development.
Install PostgreSQL
To install PostgreSQL server, update your computer's local package cache with the latest set of packages. Afterwards, install the postgresql package:
Login PostgreSQL
By default, PostgreSQL is configured to use peer authentication, which allows users to log in if their operating system user name matches a PostgreSQL internal name.
The installation process created an operating system user called postgres to match the postgres database administrative account.
To log into PostgreSQL with the psql client, use sudo to run the command as the postgres user:
Set User Password in PostgreSQL
Connect PostgreSQL with Connection URIs
After setting password for user postgres, you can connect to postgres with URI: