当前位置:网站首页>Preliminary understanding of PostgreSQL (I)
Preliminary understanding of PostgreSQL (I)
2022-06-21 12:36:00 【2022 Chongya】
Due to the needs of the recent work business , Study PG, By my colleague Amway 《PostgreSQL The way of cultivation The Pragmatic Programmer 》, Extract what you find useful from the book .
It is similar to what I have been exposed to before Oracle Medium sqlplus , A terminal tool
1.psql Tools
\d View all tables in the current database
\d + Show more details
\d t Display the table structure definition
\d tablename_pkey Show index information
\timing on
select count(*) from temp;
Show SQL Executed time
\dn Show all schema
\db Show table spaces
Specify the command for character set compilation :
When the client character set encoding is inconsistent with the server , It will show a jumble ,
Server side :\encoding gbk; \encoding utf8
client : gbk utf8
\pset command Set the output format
\pset border 0; The output has no border
\pset border 1; Output content only in content
\pset border 1; The output has borders inside and outside
\x Split each row of data in the table into single rows
\i File name Execute... Stored in an external file SQL file
\echo Used to output a line of information
psql Using skills
psql Things in are automatically submitted , Finish one delete perhaps updata sentence , Things are submitted automatically , If you don't want to submit a solution :
1.begin -> dml sentence -> commit/rollback
2. Use the command line to turn off \set AUTOCOMMIT off (AUTOMINT Must be bigger , Although not wrong , But this does not work )
边栏推荐
猜你喜欢
随机推荐
DVWA configuration tutorial
LeetCode-高度检查器
Version number naming convention
Workbench常见网格划分方法讲解
Common instructions for five basic data types in redis
Educator web exercise - grouping form elements
~~~~配置
Standing at the digital tuyere, how can tooling enterprises "fly"
PingCAP 入选 2022 Gartner 云数据库“客户之声”,获评“卓越表现者”最高分
4. 程序流程结构
RPC (remote procedure call protocol)
EasyUI-input取/赋值
[100 unity pit knowledge points] | unity uses quaternion Angleaxis random one direction
理解RESTful架构
Why are there only 13 root domain name servers in the world
Educoder Web练习题---结构元素
配電室環境監控系統技術方案
Educoder web exercise - validating forms
Add a description to the form component
愿山河无恙








