gsql命令行客户端工具

gsql命令行客户端工具

gsql 是与 openGauss 数据库配套的命令行工具,我们可以利用它来连接数据库、执行SQL语句和执行一些元命令。

基本操作

1
2
3
4
5
6
7
8
[omm@4ae1997a3f9a ~]$ gsql
gsql ((openGauss 1.1.0 build 392c0438) compiled at 2020-12-31 20:07:42 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

omm=#
omm=# \? # 获取帮助
omm=# \q # 退出

注意,除了执行一些元命令,如 \q 等外,执行 SQL 语句都要记住在末尾加上 ;,以防止和下一条语句冲突。

1
2
omm=# show server_version;
omm=# show all;

参考链接

  1. gsql命令行客户端工具/gsql概述 - 华为云文档