GaussDB命令行显示设置
vi ~/gauss_env_file
export PSQLRC=/home/omm/.gsqlrc
vi /home/omm/.gsqlrc
\set PROMPT1 '%`date +%H:%M:%S` %n@%/ > '
\timing on
效果如下:
[omm@gaussdb ~]$ gsql -Uroot -W xxxxxxxxxx -d postgres -p 8000 -ar
\set PROMPT1 '%`date +%H:%M:%S` %n@%/ > '
\timing on
Timing is on.
gsql ((GaussDB Kernel 503.1.0.SPC2000 build 15786b02) compiled at 2023-12-12 22:07:15 commit 5868 last mr 14483 release)
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
09:56:53 root@postgres > select current_database();
current_database
------------------
postgres
(1 row)
Time: 1.938 ms
09:57:00 root@postgres > select current_user;
current_user
--------------
root
(1 row)
Time: 1.622 ms
09:57:02 root@postgres >
其他设置:
\set PROMPT1 '%`date +%H:%M:%S` (%n@%M:%>)%/%R%#%x '
\set PROMPT1 '%[%033[1;33;40m%]%`date +%H:%M:%S` %n@%/ > '
参考链接:
https://www.27ka.cn/299252.htmlhttps://www.modb.pro/db/569888https://support.huawei.com/enterprise/zh/doc/EDOC1100296314?section=k005