Online Help

Procedure

Task Example

  1. View the gsql help information. For details about the commands, see Table 1.

    Table 1 gsql online help

    Description

    Example

    View copyright information.

    \copyright

    View the help information about SQL statements supported by GaussDB(DWS).

    View the help information about SQL statements supported by GaussDB(DWS).

    For example, view all SQL statements supported by GaussDB(DWS).

    1
    2
    3
    4
    5
    6
    \h
    Available help:
      ABORT                            
      ALTER DATABAE
      ALTER DATA SOURCE                 
    ... ...
    

    For example, view parameters of the CREATE DATABASE command:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    \help CREATE DATABASE
    Command:     CREATE DATABASE
    Description: create a new database
    Syntax:
    CREATE DATABASE database_name
         [ [ WITH ] {[ OWNER [=] user_name ]|
               [ TEMPLATE [=] template ]|
               [ ENCODING [=] encoding ]|
               [ LC_COLLATE [=] lc_collate ]|
               [ LC_CTYPE [=] lc_ctype ]|
               [ DBCOMPATIBILITY [=] compatibility_type ]|
               [ TABLESPACE [=] tablespace_name ]|
               [ CONNECTION LIMIT [=] connlimit ]}[...] ];
    

    View help information about gsql commands.

    For example, view commands supported by gsql.

    1
    2
    3
    4
    5
    6
    7
    \?
    General
      \copyright             show PostgreSQL usage and distribution terms
      \g [FILE] or ;         execute query (and send results to file or |pipe)
      \h(\help) [NAME]              help on syntax of SQL commands, * for all commands
      \q                     quit gsql
    ... ...