PostgreSQL operations-Basic psql commands and postgresql operations-psql
1. Establish a database connection----------------Access PostgreSQL database: psql-h IP address-p port-U Database Name
Enter the Database Password.
2. Access the database
1. List databases: \ l2. Select Database: \ c Database Name3. view all tables in a database: \ dt4. Switch Database
The method for installing only the PostgreSQL client tool psql recently has a project. the customer uses ppas of edb and does not only install the psql installation package. the customer said that there was some inconvenience and the following DIY was available, green. Postgresql should be the same without testing. The idea is to combine the packages on which psql
I. INTRODUCTION to psql is a PostgreSQL command line interactive client tool, similar to the command line tool sqlplus: 1 in Oracle allows you to interactively type SQL or commands, then they are sent to the PostgreSQL server, and then the SQL or command results are displayed; 2 input
I. INTRODUCTION to psql
Psql is a PostgreSQL command line interactive client to
Operating system: DEBIAN8
There may be a warning error when you log in to PG:
$ psql -U user1 -d exampledb
psql: fatal error: peer authentication failed for user "user1"
Open the following file,
$ sudo vi /etc/postgresql/9.4/main/pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer # IPv4 local connections:
Tags: res a user error user line RMI set root pathAfter installing PostgreSQL, the normal user executes Psql error:‘‘‘Can ' t locate strict.pm:/usr/local/lib/x86_64-linux-gnu/perl/5.22.1/strict.pm:permission denied At/usr/bin/psql line 19.BEGIN failed--compilation aborted At/usr/bin/psql line 19.‘‘‘While the strict.pm is under/usr/lib instead of/usr/local/lib, th
When Psql is executed, no password is set.
The customer sent a lot of *. SQL files for creating database tables. If you run them one by one, it will be a waste of time. In this way, I implemented a batch processing file (BAT file) to operate multiple *. SQL statements at a time. However, this problem occurs because my batch processing is written like this:@ Echo offFor % C in (*. SQL) Do Psql-D ucom-u ucom
/window\ubuntu\ shared\ Folder/vendemo. SqlPg_restore: [archiver] Input file appears to BES a text format dump. Please use Psql.Pg_restore and archive file formats use the Rebuild database together.1. Backup First:Pg_dump-u postgres-f t-f/vendemo.tar Vendemo back up with more than 800 K. Recovery:Pg_restore-u postgres-d Bk01/vendemo.tar2. Backup First:Pg_dump-u postgres-f c-f/vendemo.tar Vendemo back up with more than 300 K. Recovery:Pg_restore-u postgres-d Bk01/vendemo.tar three, compressed ba
Tags: creating exists func event Tin mod edit page Execution timePsql powerful, skills how to use only follow-up slowly supplemented, see a tool first see how to use Help$ psql #连接到数据库服务器, in which you can enter the appropriate SQL statement or PSQL command, psql command starts with \$ \l #列出所有的数据库$ \d #查看表的结构$ \d Table name #查看指定表的具体结构$ CREATE DATABASE name #创建新
The command syntax for Psql is:psql [Options] [dbname [username]]The Psql command-line options and their meanings are listed in table 1-1. Use the following command to see a complete list of options for Psql:$ psql--helpTable 1-1 psql command-line Options
Optio
Tags: des c a file data usageD:\Program files\postgresql\9.3\scriptsThis is the default buffer position of the psql;Psql's command: D:\Program files\postgresql\9.3\scripts\runpsql.bat--Query buffer\e [file] [line] Edit query buffer (or file) using external editor\EF [FUNCNAME [line]] Edit function definition using external editor\p Display the contents of the query buffer\ r Reset (clear) the query bufferThe \w file writes the contents of the query bu
Common Psql commands
Source: http://www.cnblogs.com/happyhotty/articles/1920455.html
\ D[
Table]
List tables in the database or (if declared) tables
TableIf the table name is declared with a wildcard ("*"), it lists the column/field information of all tables and tables.
\ Da
Lists all available aggregates.
\ Dd
Object
List
Pg_descriptionDescription of the declared object. The object can be a table, column/
Rails connection PostgreSQL error: psql: Fatal error: User Login sident authentication failed
Rails connection PostgreSQL error: psql: Fatal error: User's ipvs Ident authentication failed
Psql: Fatal error: User "s" Ident authentication failed
1. After the postgresql database is installed, you must initialize and configure some rails projects to connect to p
Log in to the PostgreSQL database console
Psql database name
Login successful Display
[zpf@kevin ~]$ psql postgrespsql (9.4.1)Type"help"for help.postgres=#
Create DATABASE User xxx
CREATE USER xxx WITH PASSWORD ‘xxxxxx‘;
Create a database yyy and specify all of them as xxx
CREATE DATABASE yyy OWNER xxx;
To the database yyy all operation permissions assigne
Psql: Fatal error: User "Postgres" Ident authentication failed1 after installing the PostgreSQL database, you need to initialize and some configuration rails project to connect PostgreSQL.After the PostgreSQL data is installed (the Yum command is installed directly)First step: Initialize the database#service PostgreSQL Initdb(Description: After initialization the default PostgreSQL database has a default user postgres (password is empty) and a default
Rails connection postgresql error: psql: Fatal error: User "s" Ident authentication failed, psqlpostgresPsql: Fatal error: User "s" Ident authentication failed
1. After the postgresql database is installed, you must initialize and configure some rails projects to connect to postgresql.
After postgresql data is installed (the yum command is directly installed)
Step 1: Initialize the database
# Service postgresql initdb
(Note: After initialization, the
Psql is a command-line interactive client tool in PostgreSQL.See which databases: Psql-l or use "\l" in the Psql command lineOnce installed, the default is a database called Postgres, and there are two template database template0,template1.When a user is building a database, it is cloned from the template database temolate1 by default , so the content in the TEMP
Issue: During initialization, the following issues are:gpadmin-[fatal]:-failed to complete obtain psql count Master gp_segment_configuration Script exiting!Script have left Greenplum Database in an incomplete stateWorkaround:echo "Removeipc=no" >>/etc/systemd/logind.conf/bin/systemctl Restart Systemd-logind.serviceThis solution is as available under Ubuntu Greenplum-db-oss 5.4.1 ScenarioReference URL: https://github.com/greenplum-db/gpdb/issues/197Fai
Tags: os SP data bs nbsp Database sql Res BRFirst, establish a database connection----------------Access PostgreSQL database: PSQL-H IP address-P Port-U database nameYou will then be asked to enter the database passwordSecond, access to the database1. List database: \l2. Select database: \c database name3. View all tables in a library: \DT4. Switch database: \c interface5. View a table structure in a library: \d table name6. View records for a table i
Click Vi/opt/metasploit/properties.ini on the command line to view the username and password650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4D/8A/wKiom1RS-jvjoL6jAAD5wCRpCu4639.jpg "title=" QQ picture 20141031105521.jpg "alt=" Wkiom1rs-jvjol6jaad5wcrpcu4639.jpg "/>In MSF type650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4D/8A/wKioL1RS-xqCiY8bAADH78EsyzU136.jpg "title=" QQ picture 20141031105752.jpg "alt=" Wkiol1rs-xqciy8baadh78esyzu136.jpg "/>This makes the connection suc
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.