0% found this document useful (0 votes)
10 views

Postgres

Uploaded by

Phantom dancer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Postgres

Uploaded by

Phantom dancer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

POSTGRESQL

Workshop

18 DE OCTUBRE DE 2022
IES FRANCISCO ROMERO VARGAS
PostgreSQL | oscar alvarez lucas

POSTGRES INSTALLATION 1
First of all, we have to install the package to work with postgresql, to do that introduce the
following command in CLI.

We can see the version of the postgres which we’ve installed.

Let’s set a password for the postgres user.

COMMANDS AND ENVIRONMENT


We can list the databases with “\l”

We can create a database from outside the database on the Debian’s CLI
PostgreSQL | oscar alvarez lucas

To connect to another database which is not postgres database we can use “\c database”

Create a table is the same as MariaDB’s method

CREATION OF USER AND REMOTE ACCESS


To create a user in Postgres we just have to be inside postgres software and we can create it by this
way with the following command. We are going to add the privileges to the database as well to be
able to do things at the database.
PostgreSQL | oscar alvarez lucas

We can list the users by using the command “\du”

To allow the remote access on our postgres database we need to listen all the addresses, we can
change it on the postgresql.conf file which is located in the postgres directory.

To allow al the IPv4 connection, not only localhost, we have to change in the pg_hba.conf file the
line under “IPv4 local connections:” and change the range of IPs to 0.0.0.0/0 to make it works.
PostgreSQL | oscar alvarez lucas

Now we are going to try connecting from other Debian VM with postgresql-client installed.

You might also like