MOCKSTACKS
EN
Questions And Answers

More Tutorials









postgreSQL Tutorial

Examples

Installation on GNU+Linux


On most GNU+Linux operating systems, PostgreSQL can easily be installed using the operating system package manager.

Red Hat family


Download the repository to local machine with the command

yum -y install https://download.postgresql.org/pub/repos/yum/X.X/redhat/rhel-7-x86_64/pgdgredhatXX-X.X-X.noarch.rpm

View available packages:

yum list available | grep postgres*

Neccesary packages are: postgresqlXX postgresqlXX-server postgresqlXX-libs postgresqlXXcontrib

These are installed with the following command: yum -y install postgresqlXX postgresqlXX-server postgresqlXX-libs postgresqlXX-contrib

Once installed you will need to start the database service as the service owner (Default is postgres). This is done with the pg_ctl command.

sudo -su postgres
./usr/pgsql-X.X/bin/pg_ctl -D /var/lib/pgsql/X.X/data start

To access the DB in CLI enter psql

Debian family


On Debian and derived operating systems, type:

sudo apt-get install postgresql

This will install the PostgreSQL server package, at the default version offered by the operating system's package repositories.

If the version that's installed by default is not the one that you want, you can use the package manager to search for specific versions which may simultaneously be offered.

You can also use the Yum repository provided by the PostgreSQL project (known as PGDG) to get a different version. This may allow versions not yet offered by operating system package repositories.


Conclusion

In this page (written and validated by ) you learned about postgreSQL Tutorial . What's Next? If you are interested in completing postgreSQL tutorial, your next topic will be learning about: postgreSQL install via MacPorts on OSX.



Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: mockstacks@gmail.com.


Share On:


Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using Mockstacks.com, you agree to have read and accepted our terms of use, cookies and privacy policy.