![]() ![]() In this case, the current database is also called postgres, which is the same as the username. The PostgreSQL's prompt is in the format of databaseName=# for superuser or databaseName=> for regular user.\g or terminate with semicolon to execute query You are using psql, the command-line interface to PostgreSQL. ![]() Enter the CURRENT SUPERUSER password for sudo. $ sudo -u postgres psql - Run command "psql" as UNIX USER "postgres". To run psql using "UNIX USER" postgres, you need to invoke " sudo -u postgres psql", which switches to "UNIX USER" postgres and run the psql command. Login as PostgreSQL Superuser " postgres" via " psql" Client The UNIX USER postgres cannot login interactively to the system, as its password is not enabled. The PostgreSQL installation creates a "UNIX USER" called postgres, who is ALSO the "Default PostgreSQL's SUPERUSER". Login to the PostgreSQL Server Default PostgreSQL Superuser " postgres" ![]() I will describe these tools in later sections. share/postgresql-common/pg_wrapper* Graphical ClientsÄ«esides the command-line client psql, many graphical clients are available to access PostgreSQL, e.g., pgAdmin3, PhpPgAdmin (for PHP, model after PhpMyAdmin), etc. Lrwxrwxrwx 1 root root 37 xxx xx xxxx /usr/bin/createuser ->. Lrwxrwxrwx 1 root root 37 xxx xx xxxx /usr/bin/createdb ->. The directory /usr/lib/postgresql/10/bin also contains many utilities such as createdb (create database), dropdb (drop database), createuser (create PostgreSQL user), dropuser (drop PostgreSQL user), among others, with symlinks defined in /usr/bin. ![]() The actual program and utilities are located at /usr/lib/postgresql/10/bin and linked via pg_wrapper. Psql is a symlink located in /usr/bin (a PATH entry). The PostgreSQL installation provides a command-line client program called psql, which can be used to login to the server. c config_file=/etc/postgresql/10/main/nf usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main You could display the PostgreSQL server process via: There is also a symlink called postmaster in the same directory. The PostgreSQL server program is called postgres (in directory /usr/lib/postgresql/10/bin). The PostgreSQL server accepts connection by client program over the TCP/IP network. $ sudo systemctl status postgresql // Show th status $ sudo service postgresql reload // Reload the configuration without stopping the service // OR $ sudo service postgresql restart // Stop and restart the service $ sudo service postgresql start // Start the service $ sudo service postgresql stop // Stop the service The postgresql service is started automatically upon startup. In Ubuntu, the server is run as a service called postgresql (configured in /etc/init.d/postgresql). PostgreSQL runs as a client-server system. Reference: PostgreSQL Documentation - Tutorial. The port directive specifies the TCP port number.ident_file directive specifies the ident authentication file.hba_file directive specifies the host-based authentication file.data_directory directive specifies where the databases are stored.#listen_addresses = 'localhost' # what IP address(es) to listen on Ident_file = '/etc/postgresql/10/main/pg_nf' # ident configuration file Hba_file = '/etc/postgresql/10/main/pg_hba.conf' # host-based authentication file $ less /etc/postgresql/10/main/nfÄata_directory = '/var/lib/postgresql/10/main' The main configuration file is called " nf". The PostgreSQL configuration files are stored in directory /etc/postgresql/10/main (for Ubuntu). postgresql-contrib-10: Additional supplied modules.postgresql-client-common, postgresql-client-10: Client binaries and libraries.postgresql, postgresql-common, postgresql-10: Core database server.The following packages will be installed: Lrwxrwxrwx 1 root root 37 xxx xx xxxx /usr/bin/psql ->. $ which psql // psql is an interactive PostgreSQL client Postgresql: /etc/postgresql /usr/lib/postgresql /usr/share/postgresql. $ sudo apt-get install postgresql postgresql-contrib // Verify the installation $ sudo apt-get update // Install PostgreSQL Installing PostgreSQL 10.6 Ubuntu // Refresh the apt-get repository The mother site for PostgreSQL is with manual. The project started in UC Berkeley in 1986, and is now developed by a group of volunteers called "PostgreSQL Global Development Group". It supports a large part of the SQL standards such as foreign keys, triggers, views and transactions and object-oriented features such as inheritance. PostgreSQL is an open-source Object-Relational Database Management System (ORDBMS). I assume that you are familiar with SQL commands (such as CREATE TABLE, DROP TABLE, INSERT, SELECT, UPDATE and DELETE). ![]()
0 Comments
Leave a Reply. |