YMatrix 在PSQL命令行设置timing

-- 在root下切换到mxadmin用户

[root@mdw home]# su - mxadmin
上一次登录:四 3月 23 13:03:29 CST 2023pts/4 上

********** MatrixDB Administrator **********
  The MatrixDB on 5432 is up for 18:20:27
  Connect matrixdb with
     psql postgres
********************************************

-- 复制psqlrc.sample文件到mxadmin目录下并重名.psqlrc
[mxadmin@mdw ~]$ cp /usr/local/matrixdb/share/postgresql/psqlrc.sample ~/.psqlrc

-- 在.psqlrc文件中追加\timing参数
[mxadmin@mdw ~]$ vim .psqlrc
--
--      system-wide psql configuration file
--
--  This file is read before the .psqlrc file in the user's home directory.
--
--  Copy this to your installation's sysconf directory and rename it psqlrc.
--  The sysconf directory can be identified via "pg_config --sysconfdir".
--
\timing

-- 进行验证
[mxadmin@mdw ~]$ psql postgres
Timing is on.
psql (12)
Type "help" for help.

postgres=# select version();
                                                                                                                                 version

------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
 PostgreSQL 12 (MatrixDB 4.8.1-enterprise) (Greenplum Database 7.0.0+dev.18283.g89aea3d754 build commit:89aea3d7544ec83ba6f5892e69ffdde7498fb8c6) on x86_64-pc-lin
ux-gnu, compiled by gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), 64-bit compiled on Feb 22 2023 02:24:30
(1 row)

Time: 0.993 ms