@@ -203,15 +203,15 @@ Large Objects
203203
204204
205205## 例子
206- ### 列出psql 帮助
206+ ### 1、 列出psql 帮助
207207
208208```
209209 \? [commands] show help on backslash commands
210210 \? options show help on psql command-line options
211211 \? variables show help on special variables
212212```
213213
214- ### 列出SQL COMMAND语法帮助
214+ ### 2、 列出SQL COMMAND语法帮助
215215
216216```
217217 \h [NAME] help on syntax of SQL commands, * for all commands
@@ -227,7 +227,7 @@ LISTEN channel
227227URL: https://www.postgresql.org/docs/12/sql-listen.html
228228```
229229
230- ### 1 、对查询结果进行行列变换
230+ ### 3 、对查询结果进行行列变换
231231
232232```
233233\crosstabview [ colV [ colH [ colD [ sortcolH ] ] ] ]
@@ -300,7 +300,7 @@ postgres=# \crosstabview level class
300300(5 rows)
301301```
302302
303- ### 2 、打印当前query buffer
303+ ### 4 、打印当前query buffer
304304```
305305\p
306306
@@ -335,7 +335,7 @@ postgres=# \! cat '/tmp/abc'
335335select 1;
336336```
337337
338- ### 3 、打印所有query buffer(实际上是.psql_history )
338+ ### 5 、打印所有query buffer(实际上是.psql_history )
339339
340340```
341341 \s [FILE] display history or save it to file
@@ -361,7 +361,7 @@ explain (analyze,verbose,timing,costs,buffers) select * from h where id=2;
361361select * from pg_stat_all_indexes where indexrelname='idx_h_1';
362362```
363363
364- ### 4 、执行SQL
364+ ### 6 、执行SQL
365365
366366```
367367 \g [FILE] or ; execute query (and send results to file or |pipe)
@@ -533,7 +533,7 @@ col1 | abcd
533533col2 | 1
534534```
535535
536- ### 每隔N秒执行一次query buffer中的SQL
536+ ### 7、 每隔N秒执行一次query buffer中的SQL
537537
538538```
539539postgres=# \p
@@ -554,7 +554,7 @@ Sat 08 Jun 2019 10:33:56 AM CST (every 1s)
554554(1 row)
555555```
556556
557- ### 条件判定逻辑
557+ ### 8、 条件判定逻辑
558558gset执行并设置变量到column alias
559559
560560```
@@ -578,7 +578,7 @@ SELECT
578578\endif
579579```
580580
581- ### 大对象操作
581+ ### 9、 大对象操作
582582```
583583postgres=# \lo_import '/tmp/abcd'
584584could not open file "/tmp/abcd": No such file or directory
@@ -630,12 +630,12 @@ postgres=# select * from pg_largeobject;
630630(0 rows)
631631```
632632
633- ### COPY PSQL的客户端服务器上的文件到数据库,或COPY数据库数据(表或者SQL)的结果到执行PSQL的客户端。
633+ ### 10、 COPY PSQL的客户端服务器上的文件到数据库,或COPY数据库数据(表或者SQL)的结果到执行PSQL的客户端。
634634[ 《PostgreSQL 服务端COPY和客户端COPY - 暨PG有哪些服务端操作接口》] ( ../201805/20180516_03.md )
635635
636636[ 《PostgreSQL copy (quote,DELIMITER,...) single byte char 的输入》] ( ../201805/20180510_01.md )
637637
638- ### 连接其他数据库
638+ ### 11、 连接其他数据库
639639
640640```
641641
@@ -652,14 +652,14 @@ postgres=> \c postgres postgres
652652You are now connected to database "postgres" as user "postgres".
653653```
654654
655- ### 列出当前连接信息
655+ ### 12、 列出当前连接信息
656656
657657```
658658postgres=# \conninfo
659659You are connected to database "postgres" as user "postgres" via socket in "/data01/pg12/pg_root12000" at port "12000".
660660```
661661
662- ### 列出对象信息、权限
662+ ### 13、 列出对象信息、权限
663663
664664S包括系统对象
665665
@@ -712,7 +712,7 @@ Informational
712712 \z [PATTERN] same as \dp
713713```
714714
715- ### 执行psql服务器上的文件
715+ ### 14、 执行psql服务器上的文件
716716
717717```
718718 \i FILE execute commands from file
0 commit comments