PostgreSQL DBA(69) - Postgres tips for the average and power user
2019-08-05 17:08
1366 查看
下面是一些有用的tips:
In psql, tag your queries and use Ctrl+R
[local]:5432 pg12@testdb=# select * from t1 limit 1;
id | c1 | c2
----+----+----
4 | 4 | 4
(1 row)
Time: 1.872 ms
[local]:5432 pg12@testdb=# select * from test limit 1;
ERROR: relation "test" does not exist
LINE 1: select * from test limit 1;
^
Time: 0.996 ms
[local]:5432 pg12@testdb=# create table test(id int);
CREATE TABLE
Time: 6.019 ms
[local]:5432 pg12@testdb=# insert into test values(1);
INSERT 0 1
Time: 2.310 ms
[local]:5432 pg12@testdb=# insert into test values(2);
INSERT 0 1
Time: 2.409 ms
这时候使用快捷键Ctrl + R,显示搜索框,输入t1,psql检索t1相关的sql并显示在界面上.
(reverse-i-search)`':
(reverse-i-search)`t1': select * from t1 limit 1;
Better psql output
\x不够强大,可使用pspg.
Get a stack trace for an error
使用gdb在errfinish上设置断点可跟踪错误
郑州妇科医院哪家好:http://jbk.39.net/yiyuanzaixian/sysdfkyy/
[local]:5432 pg12@testdb=# SELECT pg_backend_pid();
pg_backend_pid
----------------
1538
(1 row)
...
(gdb) b errfinish
Breakpoint 1 at 0xa65517: file elog.c, line 412.
(gdb) c
Continuing.
如出现执行错误,会在gdb中停止,利用bt可打印调用栈
相关文章推荐
- ABAP code to find all the User Exits and BADIs for any transaction
- CENTOS针对POSTGRES出现的POSTGRESQL IDENT AUTHENTICATION FAILED FOR USER
- 9 Tips to Use Apachectl and Httpd like a Power User
- centos针对postgres出现的postgresql Ident authentication failed for user
- Tips and Tricks for the Visual Studio .NET IDE
- Knoppix Hacks: Tips and Tools for Using the Linux Live CD to Hack, Repair, and Enjoy Your PC
- How to add a user and set environments for the user?
- PostgreSQL: IDENT authentication failed for user postgres
- Tips and tricks for the Java connector
- How to create fully custom Role, User, Event, Resource classes for use with the Security and Scheduler modules
- How to add a user and set environments for the us
- Tips and Tricks for the Visual Studio .NET IDE
- Tips and Tricks for the Visual Studio .NET IDE
- Google Hacks: Tips & Tools for Finding and Using the World's Information
- sysbench下面测试postgresql遇到IDENT authrntication failed for user postgres
- Please enter the correct username and password for a staff account. Note tha
- postgres-toolkit (A Victorinox for PostgreSQL DBA )
- Oracle Database 11g: The Top Features for DBAs and Developers
- One or more files from the Emulator for Windows CE installation is missing.Please reinstall Emulator for Windows CE and try agai
- eclipse出现The user operation is waiting for “Building workplace” to complete 问题解决办法