![]() To establish a connection with the newly created database, you can utilize the “\c” command as follows: \c example_db The database list proves that the database “example_db” has been created. You can verify the database’s creation through the following command: \l The output indicates that a database named “example_db” has been created. Let’s create a new database named “example_db” using the following command: CREATE DATABASE example_db Now, execute the “\l” command to see the list of available databases: \l To use any Postgres query/command, you need to switch to SQL Shell(psql). Specify the password and hit the “Enter” button to switch the account. To do so, run the below command: sudo -i -u postgres So, you can perform any Postgres task via SQL Shell.įirstly, you need to switch to the Postgres account. Installing Postgres will automatically install the SQL Shell on your system. Specify the password and hit the “enter” button to start the Postgres services. Once Postgres is installed on your ubuntu operating system, execute the below command to start the Postgres Services: sudo systemctl start rvice It will take some time to complete the installation process:įinally, Postgres has been installed on our system successfully. ![]() Type “Y” and hit the “Enter” button to continue the installation: To start Postgres installation on ubuntu, run the below “sudo apt install” command: sudo apt install postgresql postgresql-contrib The above snippet shows that the system packages are being updated. Let’s update the system packages via the below command: sudo apt update How to Install PostgreSQL Database on Ubuntu?įirstly, open the terminal and perform the following steps to install Postgres on Ubuntu. This blog will teach you how to install, use and uninstall the Postgres database from Ubuntu. However, it must be installed on your system in order to access any of its functionality/features. Postgres is becoming increasingly popular due to its enormous features. It allows users to store immense and sophisticated data securely. Postgres assists the developers in building the applications, administrators in protecting data integrity, builts fault tolerance environments, etc. Psql (10.12 (Ubuntu 10.12-0ubuntu0.18.04.One of the most popular open-source relational databases is PostgreSQL which offers numerous features such as security, reliability, extensibility, etc. Main PID: 2783 (code=exited, status=0/SUCCESS)Īpr 06 14:28:06 ip-172-31-84-77 systemd: Starting PostgreSQL RDBMS.Īpr 06 14:28:06 ip-172-31-84-77 systemd: Started PostgreSQL RDBMS.Ĭonnect to the Server using the below command :~$ sudo -u postgres psql ![]() ![]() Loaded: loaded (/lib/systemd/system/rvice enabled vendor preset: enabled)Īctive: active (exited) since Mon 14:28:06 UTC 1min 55s ago Libpq5 libsensors4 postgresql postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common postgresql-contrib ssl-cert sysstatĠ upgraded, 10 newly installed, 0 to remove and 72 not upgraded.Īfter this operation, 21.1 MB of additional disk space will be used.ĭo you want to continue? Validate the Service :~$ sudo service postgresql status The following NEW packages will be installed: Lm-sensors postgresql-doc locales-all postgresql-doc-10 libjson-perl openssl-blacklist isag Libpq5 libsensors4 postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common ssl-cert sysstat The following additional packages will be installed: Install the PostgreSQL package along with a postgresql-contrib package that adds some additional utilities and functionality :~$ sudo apt install postgresql postgresql-contrib Run the update :~$ sudo apt update Install the Package Launch a new instance in AWS EC2 and open the SSH port in the security group inbound rule. We will see how I implemented the Application consistency in my next blog, here we will see how to setup the PostgreSQL in Ubuntu in AWS EC2. It is a popular choice for many small and large projects and has the advantage of being standards-compliant and having many advanced features like reliable transactions and concurrency without read locks.ĭuring the COVID-19 Quarantine days, I started integrating the application consistency backup of PostgreSQL. PostgreSQL, or Postgres, is a relational database management system that provides an implementation of the SQL querying language.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |