GaussDB命令行显示设置

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值