This section contains the command-line options for vsql.
This section contains the command-line options for vsql.
- Runs one command and exits. This command is useful in shell scripts.
Variables set with
-vare not processed when referenced in a
-ccommand. To use variables, create a
.sqlfile that references the variable and pass it to vsql with the
- Specifies the name of the database to which you want to connect. Using this command is equivalent to specifying
dbnameas the first non-option argument on the command line.
- Uses the
filenameas the source of commands instead of reading commands interactively. After the file is processed, vsql terminates.
- Displays help about vsql command line arguments and exits.
- Enables the \timing meta-command.
- Returns all available databases, then exits. Other non-connection options are ignored. This command is similar to the internal command
- Performs a variable assignment, like the vsql command
- Prints the vsql version and exits.
- Disables all command line editing and history functionality.
- When resolving hostnames in dual stack environments, prefer IPv4 addresses.
- When resolving hostnames in dual stack environments, prefer IPv6 addresses.
- Sets connection backup server/port. Use comma-separated multiple hosts (default: not set). If using an IPv6 address, enclose the address in brackets ([, ]) and place the port outside of the brackets. For example
- Enables connection load balancing (default: not enabled).
NoteYou can only use load balancing with one address family in dual stack environments. For example, if you've configured load balancing for IPv6 addresses, then when an IPv4 client connects and requests load balancing the server does not allow it.
- Specifies the host name of the machine on which the server is running.
- Provides the service name portion of the Kerberos principal (default: vertica). Using -k is equivalent to using the drivers' KerberosServiceName connection string.
- Provides the instance or host name portion of the Kerberos principal. -K is equivalent to the drivers' KerberosHostName connection string.
- Sets the client label for the connection.
- Specifies the policy for making SSL connections to the server. Options are require, prefer, allow, and disable. You can also set the VSQL_SSLMODE variable to achieve the same effect. If the variable is set, the command-line option overrides it.
- Specifies the TCP port or the local socket file extension on which the server is listening for connections. Defaults to port 5433.
- Connects to the database as the user username instead of the default.
- Specifies the password for a database user.
NoteUsing this command-line option displays the database password in plain text. Use it with care, particularly if you are connecting as the database administrator, to avoid exposing sensitive information.
- Forces vsql to prompt for a password before connecting to a database.The password is not displayed on the screen. This option remains set for the entire session, even if you change the database connection with the meta-command
- Switches to unaligned output mode. (The default output mode is aligned.)
- Beep on command completion.
- Specifies the field separator for unaligned output (default: "|") (-P fieldsep=). (See
-A --no-align.) Using this command is equivalent to
- Turns on HTML tabular output. Using this command is equivalent to using the
format htmlor the
- Lets you specify printing options in the style of
\pseton the command line. You must separate the name and value with an equals (=) sign instead of a space. Thus, to set the output format to LaTeX, you could write
- Turns on trailing record separator. Use
\pset trailingrecordsepto toggle the trailing record separator on or off.
- Uses separator as the record separator. Using this command is equivalent to using the
- Disables printing of column names, result row count footers, and so on. This is equivalent to the vsql meta-command
- Allows you to specify options to be placed within the HTML
- Enables extended table formatting mode. This is equivalent to the vsql meta-command
Input and output options
- Prints all input lines to standard output as they are read. This approach is more useful for script processing than interactive mode. It is the same as setting the variable
- Copies all SQL commands sent to the server to standard output. Using this command is equivalent to setting the variable ECHO to queries.
- Displays queries generated by internal commands.
- Disables command line editing.
- Writes all query output to
filename. Using this command is equivalent to using the vsql meta-command
- Specifies that vsql do its work quietly (without informational output, such as welcome messages). This command is useful with the -c option. Within vsql you can also set the QUIET variable to achieve the same effect.
- Runs in single-step mode for debugging scripts. Forces vsql to prompt before each statement is sent to the database and allows you to cancel execution.
- Runs in single-line mode where a newline terminates a SQL command, as if you are using a semicolon.
NoteThis mode is provided only by customer request. Vertica recommends that you not use single-line mode in cases where you mix SQL and meta-commands on a line. In single-line mode, the order of execution might be unclear to the inexperienced user.
In this section
- -A --no-align
- -a --echo-all
- -c --command
- -d --dbname
- -e --echo-queries
- -F --field-separator
- -f --file
- ? --help
- -H --html
- -h --host
- -i -- timing
- -g --label
- -l --list
- -m --sslmode
- -o --output
- -P --pset
- -p --port
- -q --quiet
- -R --record-separator
- -S --single-line
- -s --single-step
- -T --table-attr
- -t --tuples-only
- -V --version
- -v --variable --set
- -X --no-vsqlrc
- -x --expanded