Obtaining Help Information
Procedure
When connecting to the database, run the following command to obtain the help information:
gsql --help
The following help information is displayed:
...... Usage: gsql [OPTION]... [DBNAME [USERNAME]] General options: -c, --command=COMMAND run only single command (SQL or internal) and exit -d, --dbname=DBNAME database name to connect to (default: "omm") -f, --file=FILENAME execute commands from file, then exit ......
When connecting to the database, run the following command to obtain the help information:
help
The following help information is displayed:
You are using gsql, the command-line interface to gaussdb. Type: \copyright for distribution terms \h for help with SQL commands \? for help with gsql commands \g or terminate with semicolon to execute query \q to quit
Examples
Run the following command to connect to the database:
gsql -d postgres -p 8000
postgres is the name of the database to be connected, and 8000 is the port number of the database primary node.
If information similar to the following is displayed, the connection succeeds:
gsql ((openGauss VxxxRxxxCxx build 290d125f) compiled at 2020-05-08 02:59:43 commit 2143 last mr 131) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help.
View the gsql help information. For details, see Table 1.
Table 1 gsql online help
Feedback