![]() You’ll access the postgres prompt like this: postgres=# Code language: Shell Session ( shell )įrom here, you can interact with the PostgreSQL like issuing a query. Then, you can access the PostgreSQL using the psql by typing the following command: $ psql Code language: Shell Session ( shell ) You need to provide the password and hit the Enter keyboard. It’ll prompt for the password of the current user. To connect to PostgreSQL using the postgres role, you switch over to the postgres account on your server by typing: $ sudo -i -u postgres Code language: Shell Session ( shell ) When you installed PostgreSQL, the installation process created a user account called postgres associated with the default postgres role. If a role exists in PostgreSQL, the same Linux user account with the same name is able to log in as that role. It means that PostgreSQL will associate its roles with the system accounts of Linux. By default, PostgreSQL uses ident authentication. In PostgreSQL, a user account is referred to as a role. ![]() Connect to the PostgreSQL database server via psql It will take few minutes to download and install the PostgreSQL. For example, to install PostgreSQL version 12, you use the following command: $ sudo apt-get install postgresql-12 Code language: Shell Session ( shell ) If you want to install a specific version, you can use postgresql-version instead of postgresql. Third, update the package list: $ sudo apt-get update Code language: Shell Session ( shell )įinally, install the latest version of PostgreSQL: $ sudo apt-get install postgresql Code language: Shell Session ( shell ) Second, import the repository signing key: $ wget -quiet -O - | sudo apt-key add - Code language: Shell Session ( shell ) You need to execute them one by oneįirst, execute the following command to create the file repository configuration: $ sudo sh -c 'echo "deb $(lsb_release -cs)-pgdg main" > /etc/apt//pgdg.list' Code language: Shell Session ( shell ) Once visiting the PostgreSQL download for Ubuntu page, you find the script that allows you to install PostgreSQL on Ubuntu. In this tutorial, we’ll show you how to install PostgreSQL on Ubuntu 20.04. To download and install PostgreSQL on Linux, you visit the download page and select your Linux distribution. It is recommended that you install PostgreSQL this way since it ensures a proper integration with the operating system including automatic patching and other update management functionality. Most Linux platforms such as Debian, Red Hat / CentOS, SUSE, and Ubuntu have PostgreSQL integrated with their package management. Summary: in this tutorial, you will learn how to download and install PostgreSQL on Linux.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |