Psql+Instalation Problem Reference
Psql+Instalation Problem Reference
pgAdmin installation
Installation
Note before you start reading this. I am working on a Linux Mint 19 – 64 bit. This is what
worked for me.
Most straight forward method of making this installation is through the software manager. It
will provide you with the stable version of PostgreSQL 10 and pgAdmin 3.
I personally prefer to get things done over the terminal , as most of the official repositories
are not updated with the latest of the software versions.
So in order to get the latest version we will need to get the postgresql apt repository in the
apt sources list . The command for it is
This will log you in as the postgres user. PostgresSQL comes with a build in command line
server and database management tool called psql. With this you now can access the
server and the databases. The first step is to create a password for the postgres user. This
is needed as for security as well as for later if you need to connect to a GUI management
tool.
$ psql
You will get somenting in your terminal as the code bellow:
$ psql postgres
psql (11.0 (Ubuntu 11.0-1.pgdg18.04+2))
Type "help" for help.
postgres=#
With this steps we covered the postgres user. Please note that if you need you can
change the password to your database admin also. To do this take the following steps.
su – postgres
psql
or if you want you can put it all in one line like this.
$ psql
postgres=# CREATE USER andrei WITH SUPERUSER CREATEDB CREATEROLE PASSWORD 'your-
preferred-password';
The both examples are the same and will do the same thing.
Note in the above terminal session, we specified the postgres default database when we
logged in, because there no other databases to connect to.
Next test is to create test database test using our new super-user account:
postgres=# CREATE DATABASE test WITH OWNER andrei;
CREATE DATABASE
postgres=# \connect test;
test=#
If everything works as shown, then congratulations. Now you have a working installation of
PostgreSQL 11 on Linux Mint 19 Tara.
GUI Administration
I do prefer to have a GUI tool to manipulate the databases. Linux doesn't have a variety of
tools to select from. One of the tools is pgAdmin3 that you can get from the software
manager. It is not a bad tool but it is not so user friendly as some of the others. This is why
I recommend pgAdmin4. Install pgadmin4 by issuing this command:
$ sudo apt-get install pgadmin4
Press "Y" and then "Enter". It will then download all necessary files and continue with
installation.
Important note. When you install pgAdmin 3 or any other similar program it will be shown
in your programming group of applications. PgAdmin4 will not be there. It will be under
administration. My advice is to make a link on the panel for easy access.
The pgAdmin4 works from your web browser. To connect to the server and database click
follow the instructions given here.
Hope that this helps you out. If you have any questions feel free to contact me.