![]() ![]() To install PostgreSQL on Windows, you need to have administrator privileges. 2) Install PostgreSQL on Window step by step It will take a few minutes to complete the download. Second, click the download link as shown below: Download PostgreSQL installer for Windowsġ) Download PostgreSQL Installer for Windowsįirst, you need to go to the download page of PostgreSQL installers on the EnterpriseDB.There are three steps to complete the PostgreSQL installation: For development purposes, we will install PostgreSQL version 12 on Windows 10. Since version 8.0, PostgreSQL offers an installer for Windows systems that makes the installation process easier and faster. It means that PostgreSQL can also run on other platforms such as macOS, Solaris, and Windows. PostgreSQL was developed for UNIX-like platforms, however, it was designed to be portable. ![]() If you need more information, or have any questions, just comment below and we will be glad to assist you!Ĭheck below for some of our other articles.Summary: in this tutorial, you will step by step learn how to install PostgreSQL on your local system. Psql -d test -f test_backup.sql Comments and ConclusionĪt this point, you learn to set up PostgreSQL 15 on Debian 11. You can also restore a single database using psql command.įor example, to restore a single database named test from a backup file named test_backup.sql, run the following command: su - postgres You can back up and restore a single database using the pg_dump utility.įor example, to back up a single database named test and generate a backup file named test_backup.sql, run the following command: su - postgres To exit from the shell, run the following command: exit 4. You should see all tables in the following output: List of relations To list all tables, run the following command: \dt To create a table (e.g accounts), run the following command: CREATE TABLE accounts ( To switch the database to test, run the following command: \c test You should see all databases in the following output: To list all databases, run the following command: \l To create a database named test, run the following command: CREATE DATABASE test To set the Postgres pasword, run the following command: ALTER USER postgres PASSWORD 'password' Once you have accessed the command shell of Postgres, you can now use SQL queries to perform several database-related operations. In your output you will see: Output psql (15.0 (Debian 15.0-1.pgdg110+1)) Now you can access your PostgreSQL shell with the following command: $ psql To do this run the following command: # su postgres To access your PostgreSQL server, you must log in as a Postgres user. You will get the version in the following output: version You can also check the version using the following command: # sudo -u postgres psql -c "SELECT version() " You can check it with the following command: # ss -antpl | grep 5432 Main PID: 7543 (code=exited, status=0/SUCCESS)īy default, PostgreSQL listens on port 5432. Loaded: loaded (/lib/systemd/system/rvice enabled vendor preset: enabled) Verify that is active and running on your server: # systemctl status postgresql Output Now you can run the following command to install the latest version of the PostgreSQL server: # apt-get install postgresql-15 -yĪfter the successful installation, start the PostgreSQL service and enable it to start after the system reboot: # systemctl start postgresql Update your local package index with the following command: # apt -y update Now import the repository signing key by using the following command: # wget -quiet -O - | sudo apt-key add. To get the latest packages of PostgreSQL, you must add the official repo of PostgreSQL.įirst, install all required dependencies by running the following command: # apt-get install wget sudo curl gnupg2 -yĪfter installing all the dependencies, create the file repository configuration with the following command: # sh -c 'echo "deb $(lsb_release -cs)-pgdg main" > /etc/apt//pgdg.list' PostgreSQL is available in the default Debian repositories but the available versions are not up to date. Install PostgreSQL 15 using the official repository Update your Debian 11 operating system to make sure all existing packages are up to date: # apt update & sudo apt upgrade -y 2. In this guide we are going to install PostgreSQL 15 in Debian 11. It is one of the leading database servers used for production servers. DevOps use it as an alternative to MariaDB. PostgreSQL also known as Postgres, is a free and open source object-relational database system that runs on Client-Server architecture. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |