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.html
https://www.modb.pro/db/569888
https://support.huawei.com/enterprise/zh/doc/EDOC1100296314?section=k005

 

posted @   PiscesCanon  阅读(71)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-03-11 Linux双网卡绑定启动网卡报错Error: Connection activation failed: Master connection not found or invalid
点击右上角即可分享
微信分享提示