<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Using vsql</title>
    <link>/en/connecting-to/using-vsql/</link>
    <description>Recent content in Using vsql on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/connecting-to/using-vsql/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Connecting-To: Installing the vsql client</title>
      <link>/en/connecting-to/using-vsql/installing-vsql-client/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/installing-vsql-client/</guid>
      <description>
        
        
        &lt;p&gt;This page covers a non-FIPS installation. To install on a FIPS-compliant system, see &lt;a href=&#34;../../../en/connecting-to/client-libraries/client-drivers/install-config/fips/installing-fips-client-driver-odbc-and-vsql/#&#34;&gt;Installing the FIPS client driver for ODBC and vsql&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;linux-and-macos&#34;&gt;Linux and macOS&lt;/h2&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

For Linux: The vsql client is automatically installed as part of the OpenText™ Analytics Database server &lt;code&gt;.rpm&lt;/code&gt;.

&lt;/div&gt;
&lt;p&gt;To install vsql manually on another system:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://www.vertica.com/download/vertica/client-drivers/&#34;&gt;Download&lt;/a&gt; vsql.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extract or install vsql:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If you downloaded the &lt;code&gt;.tar&lt;/code&gt;, create the &lt;code&gt;/opt/vertica/&lt;/code&gt; directory if it does not already exist, copy the &lt;code&gt;.tar&lt;/code&gt; to it, navigate to it, and extract the &lt;code&gt;.tar&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
$ mkdir -p /opt/vertica/
$ cp driver_name.tar.gz /opt/vertica/
$ tar vzxf driver_name.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you downloaded the &lt;code&gt;.rpm&lt;/code&gt;, install it with:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ rpm -Uvh &lt;span class=&#34;code-variable&#34;&gt;driver_name&lt;/span&gt;.rpm
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optionally add the vsql directory to your PATH. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ export PATH=$PATH:\opt\vertica\bin
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make the vsql client executable. For example, to allow all users to run vsql:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ chmod ugo+x /path/to/vsql
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set your shell locale to a locale supported by vsql (which ones?). For example, in your &lt;code&gt;.profile&lt;/code&gt;, add:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;export LANG=end_US.UTF-8
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;windows&#34;&gt;Windows&lt;/h2&gt;
&lt;p&gt;To install the &lt;code&gt;vsql&lt;/code&gt; client:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://www.vertica.com/download/vertica/client-drivers/&#34;&gt;Download&lt;/a&gt; the Windows client driver installer. For details on the drivers included in this installer, see &lt;a href=&#34;../../../en/connecting-to/client-libraries/client-drivers/install-config/windows/#&#34;&gt;Windows client driver installer&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the installer and follow the prompts to install the drivers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Reboot your system.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After installing the driver, you can optionally add the vsql directory to your PATH. For example, to append the vsql directory to your PATH with Windows PowerShell for the current session:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PS C:\&amp;gt; $Env:PATH += &amp;#34;;C:\Program Files\Vertica Systems\VSQL64\&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can verify that the vsql directory is in your PATH by running &lt;code&gt;vsql -?&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PS C:\&amp;gt; vsql -?
This is vsql, the OpenText&amp;amp;trade; Analytics Database interactive terminal.

Usage:
  vsql [OPTIONS]... [DBNAME [USERNAME]]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For usage details, see &lt;a href=&#34;../../../en/connecting-to/using-vsql/vsql-usage-on-windows/#&#34;&gt;vsql usage on Windows&lt;/a&gt;&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: vsql usage on Windows</title>
      <link>/en/connecting-to/using-vsql/vsql-usage-on-windows/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/vsql-usage-on-windows/</guid>
      <description>
        
        
        &lt;h2 id=&#34;font&#34;&gt;Font&lt;/h2&gt;
&lt;p&gt;The default raster font does not work well with the ANSI code page. Set the console font to &amp;quot;Lucida Console.&amp;quot;&lt;/p&gt;
&lt;h2 id=&#34;console-encoding&#34;&gt;Console encoding&lt;/h2&gt;
&lt;p&gt;&lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/vsql/&#34; title=&#34;For more information, see Installing the vsql Client and the more general topic, Using vsql.&#34;&gt;vsql&lt;/a&gt; is built as a &amp;quot;console application.&amp;quot; The Windows console windows use a different encoding than the rest of the system, so take care when you use 8-bit characters within vsql. If vsql detects a problematic console code page, it warns you at startup.&lt;/p&gt;
&lt;p&gt;To change the console code page, set the code page by entering &lt;code&gt;cmd.exe /c chcp 1252&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

1252 is a code page that is appropriate for European languages. Replace it with your preferred locale code page.

&lt;/div&gt;
&lt;h2 id=&#34;running-under-cygwin&#34;&gt;Running under cygwin&lt;/h2&gt;
&lt;p&gt;Verify that your cygwin.bat file does not include the &amp;quot;tty&amp;quot; flag. If the &amp;quot;tty&amp;quot; flag is included in your cywgin.bat file, then banners and prompts are not displayed in vsql.&lt;/p&gt;
&lt;p&gt;To verify, enter:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;set CYGWIN=binmode tty ntsec&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To remove the &amp;quot;tty&amp;quot; flag, enter:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;set CYGWIN=binmode ntsec&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Additionally, when running under Cygwin, vsql uses Cygwin shell conventions as opposed to Windows console conventions.&lt;/p&gt;
&lt;h2 id=&#34;tab-completion&#34;&gt;Tab completion&lt;/h2&gt;
&lt;p&gt;Tab completion is a function of the shell, not vsql. Because of this, tab completion does not work the same way in Windows vsql as it does on Linux versions of vsql.&lt;/p&gt;
&lt;p&gt;On Windows, instead of using tab-completion, press F7 to pop-up a history window of commands. You can also press F8 after typing a few letters of a command to cycle through commands in the history buffer which begin with the same letters.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Connecting from the administration tools</title>
      <link>/en/connecting-to/using-vsql/connecting-from-admin-tools/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/connecting-from-admin-tools/</guid>
      <description>
        
        
        &lt;p&gt;You can use the &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/admin-tools/&#34; title=&#34;OpenText&amp;amp;trade; Analytics Database Administration Tools provides a graphical user interface for managing the database.&#34;&gt;Administration tools&lt;/a&gt; to connect to a database using vsql on any node in the cluster.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log in as the database administrator user; for example, dbadmin.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

OpenText™ Analytics Database does not allow users with root privileges to connect to a database for security reasons.

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the Administration Tools.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ /opt/vertica/bin/admintools
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the Main Menu, select &lt;strong&gt;Connect to Database&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../images/connect-to-database.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If prompted, enter the database password:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Password:
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When you create a new user with the &lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-user/#&#34;&gt;CREATE USER&lt;/a&gt; command, you can configure the password or leave it empty. You cannot bypass the password if the user was created with a password configured. You can change a user&#39;s password using the &lt;a href=&#34;../../../en/sql-reference/statements/alter-statements/alter-user/#&#34;&gt;ALTER USER&lt;/a&gt; command.&lt;/p&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Administration Tools connect to the database and transfer control to &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/vsql/&#34; title=&#34;For more information, see Installing the vsql Client and the more general topic, Using vsql.&#34;&gt;vsql&lt;/a&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Welcome to vsql, the Vertica Analytic Database interactive terminal.
Type:  \h or \? for help with vsql commands
       \g or terminate with semicolon to execute query
       \q to quit

=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

See &lt;a href=&#34;../../../en/connecting-to/using-vsql/meta-commands/#&#34;&gt;Meta-commands&lt;/a&gt; for the various commands you can run while connected to the database through the Administration Tools.

&lt;/div&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Connecting from the command line</title>
      <link>/en/connecting-to/using-vsql/connecting-from-command-line/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/connecting-from-command-line/</guid>
      <description>
        
        
        &lt;p&gt;You can connect to a database using vsql from the command line on multiple client platforms.&lt;/p&gt;
&lt;p&gt;If the connection cannot be made for any reason—for example, you have insufficient privileges, or the server is not running on the targeted host—vsql returns an error and terminates.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/opt/vertica/bin/vsql [-h &lt;span class=&#34;code-variable&#34;&gt;host&lt;/span&gt;] [ -p &lt;span class=&#34;code-variable&#34;&gt;port&lt;/span&gt; ] [ -O &lt;span class=&#34;code-variable&#34;&gt;TOTP&lt;/span&gt; ] [ &lt;span class=&#34;code-variable&#34;&gt;option&lt;/span&gt;...] [ &lt;span class=&#34;code-variable&#34;&gt;dbname&lt;/span&gt; [ &lt;span class=&#34;code-variable&#34;&gt;username&lt;/span&gt; ] ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;host&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Optional if you connect to a local server. You can provide an IPv4 or IPv6 IP address or a host name.
&lt;p&gt;For OpenText™ Analytics Database servers that have both IPv4 and IPv6 addressed and you have provided a host name instead of an IP address, you can prefer to use an IPv4 address with the &lt;code&gt;-4&lt;/code&gt; option and to use the IPv6 adddress with the &lt;code&gt;-6&lt;/code&gt; option if the DNS is configured to provide both IPv4 and IPv6 addresses. If you are using IPv6 and provide an IP address, you must append the address with an &lt;code&gt;%&lt;/code&gt;&lt;em&gt;&lt;code&gt;interface name&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;port&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The database server port.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 5433&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;TOTP&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specify the current Time-based One-time Password (Totp) value. The Totp is sent to the server in the connection string for validation. If MFA is enforced and you do not provide a Totp, a dialog is displayed. You need to enter the Totp before proceeding with authentication.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;option&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;One or more vsql &lt;a href=&#34;../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/&#34;&gt;command-line options&lt;/a&gt;.
&lt;p&gt;If the database is password protected, you must specify the -w or &lt;code&gt;--password&lt;/code&gt; command line option.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;dbname&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The name of the target database. If unspecified, vsql automatically connects to the database on the specified &lt;em&gt;&lt;code&gt;host&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;port&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;username&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A database username, by default your system username.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;exit-codes&#34;&gt;Exit codes&lt;/h2&gt;
&lt;p&gt;vsql returns 0 to the shell when it terminates normally. Otherwise, it returns one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;1: A fatal error occurred—for example, out of memory or file not found.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;2: The connection to the server went bad and the session was not interactive&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;3: An error occurred in a script and the variable &lt;code&gt;ON_ERROR_STOP&lt;/code&gt; was set.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Unrecognized words in the command line might be interpreted as database or user names.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example shows how to capture error messages by redirecting vsql output to the output file &lt;code&gt;retail_queries.out&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ vsql --echo-all &amp;lt; retail_queries.sql &amp;gt; retail_queries.out 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Connecting-To: Meta-commands</title>
      <link>/en/connecting-to/using-vsql/meta-commands/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/meta-commands/</guid>
      <description>
        
        
        &lt;p&gt;Anything you enter in vsql that begins with an unquoted backslash is a vsql meta-command that is processed by vsql itself. These commands help make vsql more useful for administration or scripting. Meta-commands are more commonly called slash or backslash commands.&lt;/p&gt;
&lt;p&gt;The format of a vsql command is the backslash, followed immediately by a command verb, then any arguments. The arguments are separated from the command verb and each other by any number of whitespace characters.&lt;/p&gt;
&lt;p&gt;To include whitespace into an argument you can quote it with a single quote. To include a single quote into such an argument, precede it by a backslash. Anything contained in single quotes is furthermore subject to C-like substitutions for &lt;code&gt;\n&lt;/code&gt; (new line), &lt;code&gt;\t&lt;/code&gt; (tab), &lt;code&gt;\&lt;/code&gt;&lt;em&gt;digits&lt;/em&gt;, &lt;code&gt;\0&lt;/code&gt;&lt;em&gt;digits&lt;/em&gt;, and &lt;code&gt;\0x&lt;/code&gt;&lt;em&gt;digits&lt;/em&gt; (the character with the given decimal, octal, or hexadecimal code).&lt;/p&gt;
&lt;p&gt;If an unquoted argument begins with a colon (&lt;code&gt;:&lt;/code&gt;), it is taken as a vsql variable and the value of the variable is used as the argument instead.&lt;/p&gt;
&lt;p&gt;Arguments that are enclosed in backquotes (```) are taken as a command line that is passed to the shell. The output of the command (with any trailing newline removed) is taken as the argument value. The above escape sequences also apply in backquotes.&lt;/p&gt;
&lt;p&gt;Some commands take a SQL identifier (such as a table name) as argument. These arguments follow the syntax rules of SQL: Unquoted letters are forced to lowercase, while double quotes (&lt;code&gt;&amp;quot;&lt;/code&gt;) protect letters from case conversion and allow incorporation of whitespace into the identifier. Within double quotes, paired double quotes reduce to a single double quote in the resulting name. For example, &lt;code&gt;FOO&amp;quot;BAR&amp;quot;BAZ&lt;/code&gt; is interpreted as &lt;code&gt;fooBARbaz&lt;/code&gt;, and &lt;code&gt;&amp;quot;A weird&amp;quot;&amp;quot; name&amp;quot;&lt;/code&gt; becomes &lt;code&gt;A weird&amp;quot; name&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Parsing for arguments stops when another unquoted backslash occurs. This is taken as the beginning of a new meta-command. The special sequence &lt;code&gt;\\&lt;/code&gt; (two backslashes) marks the end of arguments and continues parsing SQL commands, if any. That way SQL and vsql commands can be freely mixed on a line. But in any case, the arguments of a meta-command cannot continue beyond the end of the line.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Variables</title>
      <link>/en/connecting-to/using-vsql/variables/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/variables/</guid>
      <description>
        
        
        &lt;p&gt;vsql provides variable substitution features similar to common Linux command shells. Variables are name/value pairs, where the value can be a string of any length. To set variables, use the &lt;a href=&#34;../../../en/connecting-to/using-vsql/meta-commands/meta-commands-quick-reference/&#34;&gt;vsql meta-command &lt;/a&gt;&lt;code&gt;\set&lt;/code&gt;. For example, the following statement sets the variable &lt;code&gt;fact&lt;/code&gt; to the value &lt;code&gt;dim&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \set fact dim
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you call &lt;code&gt;\set&lt;/code&gt; on a variable and supply no value, the variable is set to an empty string.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The arguments of &lt;code&gt;\set&lt;/code&gt; are subject to the same substitution rules as with other commands. For example, &lt;code&gt;\set dim :fact&lt;/code&gt; is a valid way to copy a variable.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;getting-variables&#34;&gt;Getting variables&lt;/h2&gt;
&lt;p&gt;To retrieve the content of a given variable, precede the name with a colon and use it as the argument of any slash command. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \echo :fact
dim
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;An unqualified &lt;code&gt;\set&lt;/code&gt; command returns all current variables and their values:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;dbadmin=&amp;gt; \set
VERSION = &amp;#39;vsql&amp;#39;
AUTOCOMMIT = &amp;#39;off&amp;#39;
VERBOSITY = &amp;#39;default&amp;#39;
PROMPT1 = &amp;#39;%/%R%# &amp;#39;
PROMPT2 = &amp;#39;%/%R%# &amp;#39;
PROMPT3 = &amp;#39;&amp;gt;&amp;gt; &amp;#39;
ROWS_AT_A_TIME = &amp;#39;1000&amp;#39;
DBNAME = &amp;#39;dbadmin&amp;#39;
USER = &amp;#39;dbadmin&amp;#39;
PORT = &amp;#39;5433&amp;#39;
LOCALE = &amp;#39;en_US@collation=binary&amp;#39;
HISTSIZE = &amp;#39;500&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;deleting-variables&#34;&gt;Deleting variables&lt;/h2&gt;
&lt;p&gt;To unset (or delete) a variable, use the &lt;a href=&#34;../../../en/connecting-to/using-vsql/meta-commands/meta-commands-quick-reference/&#34;&gt;vsql meta-command &lt;/a&gt;&lt;code&gt;\unset&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;variable-naming-conventions&#34;&gt;Variable naming conventions&lt;/h2&gt;
&lt;p&gt;vsql internal variable names can contain letters, numbers, and underscores in any order and any number. Some variables are treated specially by vsql. They indicate certain option settings that can be changed at run time by altering the value of the variable or represent some state of the application. Although you can use these variables for any other purpose, this is not recommended. By convention, all specially treated variables consist of all upper-case letters (and possibly numbers and underscores). To ensure maximum compatibility in the future, avoid using such variable names for your own purposes.&lt;/p&gt;
&lt;h2 id=&#34;sql-interpolation&#34;&gt;SQL interpolation&lt;/h2&gt;
&lt;p&gt;You can substitute (&amp;quot;interpolate&amp;quot;) vsql variables into regular SQL statements. You do so by prepending the variable name with a colon (&lt;code&gt;:&lt;/code&gt;). For example, the following statements query the table &lt;code&gt;my_table&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \set fact &amp;#39;my_table&amp;#39;
=&amp;gt; SELECT * FROM :fact;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The value of the variable is copied literally, so it can even contain unbalanced quotes or backslash commands. Make sure that it makes sense where you put it. Variable interpolation is not performed into quoted SQL entities. One exception applies: the contents of backquoted strings (````) are passed to a system shell, and replaced with the shell&#39;s output. See &lt;a href=&#34;#Using&#34;&gt;Using Backquotes to Read System Variables&lt;/a&gt; below.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;Using&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;using-backquotes-to-read-system-variables&#34;&gt;Using backquotes to read system variables&lt;/h2&gt;
&lt;p&gt;In vsql, the contents of backquotes are passed to the system shell to be interpreted (the same behavior as many UNIX shells). This is particularly useful in setting internal vsql variables, since you may want to access UNIX system variables (such as HOME or TMPDIR) rather than hard-code values.&lt;/p&gt;
&lt;p&gt;For example, to set an internal variable to the full path for a file in your UNIX user directory, you can use backquotes to get the content of the system HOME variable, which is the full path to your user directory:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \set inputfile `echo $HOME`/myinput.txt=&amp;gt; \echo :inputfile
/home/dbadmin/myinput.txt
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The contents of the backquotes are replaced with the results of running the contents in a system shell interpreter. In this case, the &lt;code&gt;echo $HOME&lt;/code&gt; command returns the contents of the HOME system variable.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Prompting</title>
      <link>/en/connecting-to/using-vsql/prompting/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/prompting/</guid>
      <description>
        
        
        &lt;p&gt;The prompts vsql issues can be customized to your preference. The three variables &lt;code&gt;PROMPT1&lt;/code&gt;, &lt;code&gt;PROMPT2&lt;/code&gt;, and &lt;code&gt;PROMPT3&lt;/code&gt; contain strings and special escape sequences that describe the appearance of the prompt. Prompt 1 is the normal prompt that is issued when vsql requests a new command. Prompt 2 is issued when more input is expected during command input because the command was not terminated with a semicolon or a quote was not closed. Prompt 3 is issued when you run a SQL &lt;code&gt;COPY&lt;/code&gt; command and you are expected to type in the row values on the terminal.&lt;/p&gt;
&lt;p&gt;The value of the selected prompt variable is printed literally, except where a percent sign (%) is encountered. Depending on the next character, certain other text is substituted instead. Defined substitutions are:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;%M&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The full host name (with domain name) of the database server, or [local] if the connection is over a socket, or [local:/dir/name], if the socket is not at the compiled in default location.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%m&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The host name of the database server, truncated at the first dot, or [local].&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%&amp;gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The port number at which the database server is listening.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%n&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The database session user name.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%/&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The name of the current database.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%~&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Like %/, but the output is ~ (tilde) if the database is your default database.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%#&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;If the session user is a database superuser, then a #, otherwise a &amp;gt;. (The expansion of this value might change during a database session as the result of the command SET SESSION AUTHORIZATION.)&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%R&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;In prompt 1 normally =, but ^ if in single-line mode, and ! if the session is disconnected from the database (which can happen if \connect fails). In prompt 2 the sequence is replaced by -, *, a single quote, a double quote, or a dollar sign, depending on whether vsql expects more input because the command wasn&#39;t terminated yet, because you are inside a /* ... */ comment, or because you are inside a quoted or dollar-escaped string. In prompt 3 the sequence doesn&#39;t produce anything.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%x&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Transaction status: an empty string when not in a transaction block, or * when in a transaction block, or ! when in a failed transaction block, or ? when the transaction state is indeterminate (for example, because there is no connection).&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%digits&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The character with the indicated numeric code is substituted. If digits starts with 0x the rest of the characters are interpreted as hexadecimal; otherwise if the first digit is 0 the digits are interpreted as octal; otherwise the digits are read as a decimal number.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%:name:&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The value of the vsql variable name. See the section Variables for details.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%`command`&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The output of command, similar to ordinary &amp;quot;back- tick&amp;quot; substitution.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;%[ ... %]&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Prompts may contain terminal control characters which, for example, change the color, background, or style of the prompt text, or change the title of the terminal window. In order for the line editing features of Readline to work properly, these non-printing control characters must be designated as invisible by surrounding them with %[ and %]. Multiple pairs of these may occur within the prompt. The following example results in a boldfaced (1;) yellow-on-black (33;40) prompt on VT100-compatible, color-capable terminals:
&lt;p&gt;&lt;code&gt;testdb=&amp;gt; \set PROMPT1 &#39;%[%033[1;33;40m%]%n@%/%R%#%[%033[0m%] &#39;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To insert a percent sign into your prompt, write %%. The default prompts are &#39;%/%R%# &#39; for prompts 1 and 2, and &#39;&amp;gt;&amp;gt; &#39; for prompt 3.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; See the &lt;a href=&#34;http://www.xfree86.org/current/ctlseqs.html&#34;&gt;specification for terminal control sequences&lt;/a&gt; (applicable to gnome-terminal and xterm).&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Command line editing</title>
      <link>/en/connecting-to/using-vsql/command-line-editing/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/command-line-editing/</guid>
      <description>
        
        
        &lt;p&gt;&lt;code&gt;vsql&lt;/code&gt; supports the &lt;a href=&#34;https://sites.astro.caltech.edu/~mcs/tecla/index.html&#34;&gt;tecla&lt;/a&gt; library for line editing and retrieval. You can define a tecla configuration with the following files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;~/.vsqlrc&lt;/code&gt; (user)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;/opt/vertica/config/vsqlrc&lt;/code&gt; (global)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;https://manpages.org/teclarc&#34;&gt;tecla documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Command history is automatically saved in &lt;code&gt;~/.vsql_history&lt;/code&gt; when &lt;code&gt;vsql&lt;/code&gt; exits and is reloaded when &lt;code&gt;vsql&lt;/code&gt; starts.&lt;/p&gt;
&lt;h2 id=&#34;disabling-tab-completion&#34;&gt;Disabling tab completion&lt;/h2&gt;
&lt;p&gt;To disable tab completion, add the following to &lt;code&gt;.vsqlrc&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;\bind ^I
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;key-bindings&#34;&gt;Key bindings&lt;/h2&gt;
&lt;p&gt;Key bindings are read from a global configuration at &lt;code&gt;/opt/vertica/config/vsqlrc&lt;/code&gt;, if present. To override key bindings, add definitions to &lt;code&gt;~/.vsqlrc&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Key bindings must be prefixed with a backslash (&lt;code&gt;\&lt;/code&gt;). For example, the following definition binds the &amp;quot;backward-word&amp;quot; action to Ctrl+B:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;\bind ^B backward-word
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following key bindings are specific to &lt;code&gt;vsql&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Insert&lt;/code&gt; switches between insert mode (the default) and overwrite mode.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Delete&lt;/code&gt; deletes the character to the right of the cursor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Home&lt;/code&gt; moves the cursor to the front of the line.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;End&lt;/code&gt; moves the cursor to the end of the line.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;^R&lt;/code&gt; Performs a history backwards search.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;implementation-differences&#34;&gt;Implementation differences&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;vsql&lt;/code&gt; implementation of the tecla library deviates from the tecla documentation in the following ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Unlike the standard tecla library, which saves all executed lines in the command history, &lt;code&gt;vsql&lt;/code&gt; only saves unique non-empty lines.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;vsql&lt;/code&gt; standardizes the name and location of the history file (&lt;code&gt;~/.vsql_history&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;vsql&lt;/code&gt; does not support 8-bit meta characters. This can affect international character sets, meta keys, and locales. You can verify that a meta character sends an escape by setting the &lt;code&gt;EightBitInput X&lt;/code&gt; resource to &lt;code&gt;False&lt;/code&gt;. You can do this in the following ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Add the following to &lt;code&gt;~/.Xdefaults&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;XTerm*EightBitInput: False
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start an &lt;code&gt;xterm&lt;/code&gt; session with the &lt;code&gt;-xrm &#39;*EightBitInput: False&#39;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: vsql environment variables</title>
      <link>/en/connecting-to/using-vsql/vsql-environment-variables/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/vsql-environment-variables/</guid>
      <description>
        
        
        &lt;p&gt;Set one or more of the following environment variables to be used by the defined properties automatically, each time you start vsql:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;PAGER&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;If the query results do not fit on the screen, they are piped through this command. Typical values are &lt;code&gt;more&lt;/code&gt; or &lt;code&gt;less&lt;/code&gt;. The default is platform-dependent. Use the &lt;a href=&#34;../../../en/connecting-to/using-vsql/meta-commands/pset/&#34;&gt;\pset&lt;/a&gt; command to enable/disable the pager.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_CLIENT_LABEL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The label to identify the &lt;code&gt;vsql&lt;/code&gt; client in various system tables like &lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/sessions/#&#34;&gt;SESSIONS&lt;/a&gt;. This is an alternative to setting the client label with the &lt;a href=&#34;../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/g-label/&#34;&gt;&lt;code&gt;--label&lt;/code&gt;&lt;/a&gt; option or &lt;a href=&#34;../../../en/sql-reference/functions/client-connection-functions/set-client-label/#&#34;&gt;SET_CLIENT_LABEL&lt;/a&gt;, but if either of these is used, they take precedence over &lt;code&gt;VSQL_CLIENT_LABEL&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_DATABASE&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The database to which you are connecting. For example, &lt;code&gt;VMart&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;TMPDIR&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Directory for storing temporary files. The default is platform-dependent. On Unix-like systems the default is &lt;code&gt;/tmp&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_EDITOR&lt;/code&gt;&lt;br /&gt;&lt;code&gt;EDITOR&lt;/code&gt;&lt;br /&gt;&lt;code&gt;VISUAL&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Editor used by the \e command. The variables are examined in the order listed; the first that is set is used.&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/connecting-to/using-vsql/variables/vsql-home/#&#34;&gt;VSQL_HOME&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;By default, the vsql program reads configuration files from the user&#39;s home directory. In cases where this is not desirable, the configuration file location can be overridden by setting the VSQL_HOME environment variable in a way that does not require modifying a shared resource.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_HOST&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Host name or IP address of the OpenText™ Analytics Database node.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_OAUTH_ACCESS_TOKEN&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Holds the OAuth access token and enables users to sign in to the OpenText™ Analytics Database using VSQL client through OAuth authentication.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_PASSWORD&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The database password. Using this environment variable increases site security by precluding the need to enter the database password on the command line.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_PORT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Port to use for the connection.&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;a href=&#34;../../../en/connecting-to/using-vsql/variables/vsql-sslmode/#&#34;&gt;VSQL_SSLMODE&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies whether and how clients such as admintools use SSL when connecting to servers.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_USER&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;User name to use for the connection.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;VSQL_WORKLOAD&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;a href=&#34;../../../en/admin/managing-client-connections/connection-load-balancing/workload-routing/&#34;&gt;workload&lt;/a&gt; to use for the connection.&lt;/dd&gt;
&lt;/dl&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Locales</title>
      <link>/en/connecting-to/using-vsql/locales/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/locales/</guid>
      <description>
        
        
        &lt;p&gt;The default terminal emulator under Linux is gnome-terminal, although xterm can also be used.&lt;/p&gt;
&lt;p&gt;OpenText recommends that you use gnome-terminal with &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/vsql/&#34; title=&#34;For more information, see Installing the vsql Client and the more general topic, Using vsql.&#34;&gt;vsql&lt;/a&gt; in UTF-8 mode, which is its default.&lt;/p&gt;
&lt;h2 id=&#34;to-change-settings-on-linux&#34;&gt;To change settings on Linux&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the tabs at the top of the vsql screen, select Terminal.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Set Character Encoding&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Unicode (UTF-8)&lt;/strong&gt;.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

This works well for standard keyboards. xterm has a similar UTF-8 option.

&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;to-change-settings-on-windows-using-putty&#34;&gt;To change settings on Windows using PuTTy&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Right click the vsql screen title bar and select &lt;strong&gt;Change Settings&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Window&lt;/strong&gt; and click &lt;strong&gt;Translation&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;UTF-8&lt;/strong&gt; in the drop-down menu on the right.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;vsql has no way of knowing how you have set your terminal emulator options.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The tecla library is prepared to do POSIX-type translations from a local encoding to UTF-8 on interactive input, using the POSIX LANG, etc., environment variables. This could be useful to international users who have a non-UTF-8 keyboard. See the tecla documentation for details.&lt;/p&gt;
&lt;p&gt;OpenText recommends the following (or whatever other .UTF-8 locale setting you find appropriate):&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;export LANG=en_US.UTF-8
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The vsql &lt;a href=&#34;../../../en/connecting-to/using-vsql/meta-commands/locale/&#34;&gt;\locale&lt;/a&gt; command invokes and tracks the server &lt;a href=&#34;../../../en/sql-reference/statements/set-statements/set-locale/&#34;&gt;SET LOCALE TO&lt;/a&gt; command, described. vsql itself currently does nothing with this locale setting, but rather treats its input (from files or from tecla), all its output, and all its interactions with the server as UTF-8. vsql ignores the POSIX locale variables, except for any &amp;quot;automatic&amp;quot; uses in &lt;code&gt;printf&lt;/code&gt;, and so on.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Entering data with vsql</title>
      <link>/en/connecting-to/using-vsql/entering-data-with-vsql/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/entering-data-with-vsql/</guid>
      <description>
        
        
        &lt;p&gt;You often need to insert literal data when using vsql. For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Adding a row of data to a table using an &lt;a href=&#34;../../../en/sql-reference/statements/insert/&#34;&gt;INSERT&lt;/a&gt; statement.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Adding multiple rows of data through a &lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt; FROM STDIN statement.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following table lists the data types that OpenText™ Analytics Database supports and the format you use to enter that data in queries when using vsql.

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Data Type&lt;/th&gt; 

&lt;th &gt;
Inserting to vsql using&lt;/th&gt; 

&lt;th &gt;


Example Use in INSERT INTO &lt;em&gt;table&lt;/em&gt;...&lt;/th&gt; 

&lt;th &gt;
For More Information See...&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Binary types, such as BINARY and VARBINARY&lt;/td&gt; 

&lt;td &gt;


Helper functions such as HEX_TO_BINARY, octal strings, specified data format in COPY statements, casting string values to binary.&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;VALUES(HEX_TO_BINARY(&#39;0x3D&#39;), &#39;\\141\\337\\&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;




&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/sql-reference/data-types/binary-data-types-binary-and-varbinary/#&#34;&gt;Binary data types (BINARY and VARBINARY)&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/data-load/data-formats/binary-native-data/#&#34;&gt;Binary (native) data&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
BOOLEAN&lt;/td&gt; 

&lt;td &gt;
Literal values &lt;code&gt;TRUE&lt;/code&gt; and &lt;code&gt;FALSE&lt;/code&gt; or strings such as &lt;code&gt;&#39;y&#39;&lt;/code&gt;, &lt;code&gt;&#39;t&#39;&lt;/code&gt;, &lt;code&gt;&#39;true&#39;&lt;/code&gt;, or &lt;code&gt;&#39;false&#39;&lt;/code&gt;.&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;VALUES(TRUE, &#39;f&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/data-types/boolean-data-type/#&#34;&gt;Boolean data type&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
Character data types such as CHAR or LONG VARCHAR&lt;/td&gt; 

&lt;td &gt;
Strings enclosed in single quotes.&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;VALUES(&#39;my string&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/data-types/character-data-types-char-and-varchar/#&#34;&gt;Character data types (CHAR and VARCHAR)&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
Date and time data types, such as TIMESTAMPTZ&lt;/td&gt; 

&lt;td &gt;
Formatted text string&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;VALUES(&#39;16:43:00&#39;, &#39;2016-09-15 04:55:00 PDT&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;




&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/sql-reference/data-types/datetime-data-types/#&#34;&gt;Date/time data types&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../en/sql-reference/language-elements/expressions/datetime-expressions/#&#34;&gt;Date/time expressions&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
Numeric Data Types&lt;/td&gt; 

&lt;td &gt;
Literal numeric values, including scientific notation, hexadecimal, and BINARY scaling.&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;VALUES(3.1415, 42, 6.0221409e23);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/data-types/numeric-data-types/#&#34;&gt;Numeric data types&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
UUID&lt;/td&gt; 

&lt;td &gt;
Formatted text string&lt;/td&gt; 

&lt;td &gt;
&lt;code&gt;VALUES(&#39;12345678-1234-1234-1234-123456789012&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;a href=&#34;../../../en/sql-reference/data-types/uuid-data-type/#&#34;&gt;UUID data type&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Files</title>
      <link>/en/connecting-to/using-vsql/files/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/files/</guid>
      <description>
        
        
        &lt;p&gt;Before starting up, vsql attempts to read and execute commands from the system-wide &lt;code&gt;vsqlrc&lt;/code&gt; file and the user&#39;s &lt;code&gt;~/.vsqlrc&lt;/code&gt; file. The command-line history is stored in the file &lt;code&gt;~/.vsql_history.&lt;/code&gt;

&lt;div class=&#34;alert admonition tip&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Tip&lt;/h4&gt;

If you want to save your old history file, open another terminal window and save a copy to a different file name.

&lt;/div&gt;&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Exporting data using vsql</title>
      <link>/en/connecting-to/using-vsql/exporting-data-using-vsql/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/exporting-data-using-vsql/</guid>
      <description>
        
        
        &lt;p&gt;You can use &lt;a class=&#34;glosslink&#34; href=&#34;../../../en/glossary/vsql/&#34; title=&#34;For more information, see Installing the vsql Client and the more general topic, Using vsql.&#34;&gt;vsql&lt;/a&gt; for simple data-export tasks by changing its output format options so the output is suitable for importing into other systems (tab-delimited or comma-separated files, for example). These options can be set either from within an interactive vsql session, or through command-line arguments to the vsql command (making the export process suitable for automation through scripting). After you have set vsql&#39;s options so it outputs the data in a format your target system can read, you run a query and capture the result in a text file.&lt;/p&gt;
&lt;p&gt;The following table lists the meta-commands and command-line options that are useful for changing the format of vsql&#39;s output.

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Description&lt;/th&gt; 

&lt;th &gt;
Meta-command&lt;/th&gt; 

&lt;th &gt;
Command-line Option&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Disable padding used to align output.&lt;/td&gt; 

&lt;td &gt;


\a&lt;/td&gt; 

&lt;td &gt;


&lt;a href=&#34;../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/no-align/&#34;&gt;-A&lt;/a&gt; or --no-align&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Show only tuples, disabling column headings and row counts.&lt;/td&gt; 

&lt;td &gt;


\t&lt;/td&gt; 

&lt;td &gt;


&lt;a href=&#34;../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/t-tuples-only/&#34;&gt;-t&lt;/a&gt; or --tuples-only&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Set the field separator character.&lt;/td&gt; 

&lt;td &gt;


&lt;a href=&#34;../../../en/connecting-to/using-vsql/meta-commands/pset/&#34;&gt;\pset&lt;/a&gt; fieldsep&lt;/td&gt; 

&lt;td &gt;


&lt;a href=&#34;../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/f-field-separator/&#34;&gt;-F&lt;/a&gt; or --field-separator&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Send output to a file.&lt;/td&gt; 

&lt;td &gt;


\o&lt;/td&gt; 

&lt;td &gt;


&lt;a href=&#34;../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/o-output/&#34;&gt;-o&lt;/a&gt; or --output&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Specify a SQL statement to execute.&lt;/td&gt; 

&lt;td &gt;


N/A&lt;/td&gt; 

&lt;td &gt;


&lt;a href=&#34;../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/c-command/&#34;&gt;-c&lt;/a&gt; or --command&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;The following example demonstrates disabling padding and column headers in the output, and setting a field separator to dump a table to a tab-separated text file within an interactive session.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM my_table;
 a |   b   | c
---+-------+---
 a | one   | 1
 b | two   | 2
 c | three | 3
 d | four  | 4
 e | five  | 5
(5 rows)
=&amp;gt; \a
Output format is unaligned.
=&amp;gt; \t
Showing only tuples.
=&amp;gt; \pset fieldsep &amp;#39;\t&amp;#39;
Field separator is &amp;#34;    &amp;#34;.
=&amp;gt; \o dumpfile.txt
=&amp;gt; select * from my_table;
=&amp;gt; \o
=&amp;gt; \! cat dumpfile.txt
a       one     1
b       two     2
c       three   3
d       four    4
e       five    5
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

You could encounter issues with empty strings being converted to NULLs or the reverse using this technique. You can prevent any confusion by explicitly setting null values to output a unique string such as NULLNULLNULL (for example, &lt;code&gt;\pset null &#39;NULLNULLNULL&#39;&lt;/code&gt;). Then, on the import end, convert the unique string back to a null value. For example, if you are copying the file back into an OpenText™ Analytics Database, you would give the argument &lt;code&gt;NULL &#39;NULLNULLNULL&#39;&lt;/code&gt; to the &lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt; statement.

&lt;/div&gt;
&lt;p&gt;When logged into one of the database nodes, you can create the same output file directly from the command line by passing the right parameters to vsql:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ vsql -U username -F $&amp;#39;\t&amp;#39; -At -o dumpfile.txt -c &amp;#34;SELECT * FROM my_table;&amp;#34;
Password:
$ cat dumpfile.txt
a       one     1
b       two     2
c       three   3
d       four    4
e       five    5
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you want to convert null values to a unique string as mentioned earlier, you can add the argument &lt;code&gt;-P null=&#39;NULLNULLNULL&#39;&lt;/code&gt; (or whatever unique string you choose).&lt;/p&gt;
&lt;p&gt;By adding the &lt;code&gt;-w&lt;/code&gt; vsql command-line option to the example command line, you could use the command within a batch script to automate the data export. However, the script would contain the database password as plain text. If you take this approach, you should prevent unauthorized access to the batch script, and also have the script use a database user account that has limited access.&lt;/p&gt;
&lt;p&gt;To set the field separator value to a control character, use your shell&#39;s control character escape notation. In Bash, you specify a control character in an argument using a dollar sign ($) followed by a string contained in single quotes. This string can contain C-string escapes (such as \t for tab), or a backslash () followed by an octal value for the character you want to use.&lt;/p&gt;
&lt;p&gt;The following example demonstrates setting the separator character to tab (\t), vertical tab (\v) and the octal value of vertical tab (\013).&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ vsql -At -c &amp;#34;SELECT * FROM testtable;&amp;#34;
A|1|2|3
B|4|5|6

$ vsql -F $&amp;#39;\t&amp;#39; -At -c &amp;#34;SELECT * FROM testtable;&amp;#34;
A       1       2       3
B       4       5       6

$ vsql -F $&amp;#39;\v&amp;#39; -At -c &amp;#34;SELECT * FROM testtable;&amp;#34;
A
 1
  2
   3
B
 4
  5
   6
$ vsql -F $&amp;#39;\013&amp;#39; -At -c &amp;#34;SELECT * FROM testtable;&amp;#34;
A
 1
  2
   3
B
 4
  5
   6
&lt;/code&gt;&lt;/pre&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Copying data using vsql</title>
      <link>/en/connecting-to/using-vsql/copying-data-using-vsql/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/copying-data-using-vsql/</guid>
      <description>
        
        
        &lt;p&gt;You can use vsql to copy data between two OpenText™ Analytics Databases. This technique is similar to the technique explained in &lt;a href=&#34;../../../en/connecting-to/using-vsql/exporting-data-using-vsql/#&#34;&gt;Exporting data using vsql&lt;/a&gt;, except instead of having vsql save data to a file for export, you pipe one vsql&#39;s output to the input of another vsql command that runs a &lt;a href=&#34;../../../en/sql-reference/statements/copy/&#34;&gt;COPY&lt;/a&gt; statement from STDIN. This technique can also work for other databases or applications that accept data from an input stream.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The following technique only works for individual tables. To copy an entire database to another cluster, see &lt;a href=&#34;../../../en/admin/backup-and-restore/copying-db-to-another-cluster/#&#34;&gt;Copying the database to another cluster&lt;/a&gt;.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The easiest way to copy using vsql is to log in to a node of the target database, then issue a vsql command that connects to the source  database to dump the data you want. For example, the following command copies the store.store_sales_fact table from the vmart database on node testdb01 to the vmart database on the node you are logged into:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;vsql -U username -w passwd -h testdb01 -d vmart -At -c &amp;#34;SELECT * from store.store_sales_fact&amp;#34;  \
| vsql -U username -w passwd -d vmart -c &amp;#34;COPY store.store_sales_fact FROM STDIN DELIMITER &amp;#39;|&amp;#39;;&amp;#34;
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The above example copies the data only, not the table design. The target table for the data copy must already exist in the target database. You can export the design of the table using &lt;a href=&#34;../../../en/sql-reference/functions/management-functions/catalog-functions/export-objects/#&#34;&gt;EXPORT_OBJECTS&lt;/a&gt; or &lt;a href=&#34;../../../en/sql-reference/functions/management-functions/catalog-functions/export-catalog/#&#34;&gt;EXPORT_CATALOG&lt;/a&gt;.

&lt;/div&gt;
&lt;p&gt;If you are using the Bash shell, you can escape special delimiter characters. For example, &lt;code&gt;DELIMITER E&#39;\t&#39;&lt;/code&gt; specifies tab. Shells other than Bash may have other string-literal syntax.&lt;/p&gt;
&lt;h2 id=&#34;monitoring-progress-optional&#34;&gt;Monitoring progress (optional)&lt;/h2&gt;
&lt;p&gt;You may want some way of monitoring progress when copying large amounts of data between databases. One way of monitoring the progress of the copy operation is to use a utility such as &lt;a href=&#34;http://www.ivarch.com/programs/pv.shtml&#34;&gt;Pipe Viewer&lt;/a&gt; that pipes its input directly to its output while displaying the amount and speed of data it passes along. Pipe Viewer can even display a progress bar if you give it the total number of bytes or lines you expect to be processed. You can get the number of lines to be processed by running a separate vsql command that executes a &lt;a href=&#34;../../../en/sql-reference/functions/aggregate-functions/count-aggregate/&#34;&gt;SELECT COUNT&lt;/a&gt; query.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

Pipe Viewer isn&#39;t a standard Linux command, so you will need to download and install it yourself. See the &lt;a href=&#34;http://www.ivarch.com/programs/pv.shtml&#34;&gt;Pipe Viewer&lt;/a&gt; page for download packages and instructions. The database does not support Pipe Viewer. Install and use it at your own risk.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The following command demonstrates how you can use Pipe Viewer to monitor the progress of the copy shown in the prior example. The command is complicated by the need to get the number of rows that will be copied, which is done using a separate vsql command within a Bash backquote string, which executes the string&#39;s contents and inserts the output of the command into the command line. This vsql command just counts the number of rows in the store.store_sales_fact table.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;vsql -U username -w passwd -h testdb01 -d vmart -At -c &amp;#34;SELECT * from store.store_sales_fact&amp;#34;  \
| pv -lpetr -s `vsql -U username -w passwd -h testdb01 -d vmart -At -c &amp;#34;SELECT COUNT (*) FROM store.store_sales_fact;&amp;#34;` \
| vsql -U username -w passwd -d vmart -c &amp;#34;COPY store.store_sales_fact FROM STDIN DELIMITER &amp;#39;|&amp;#39;;&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;While running, the above command displays a progress bar that looks like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;0:00:39 [12.6M/s] [=============================&amp;gt;                             ] 50% ETA 00:00:40
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Connecting-To: Output formatting examples</title>
      <link>/en/connecting-to/using-vsql/output-formatting-examples/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/using-vsql/output-formatting-examples/</guid>
      <description>
        
        
        &lt;p&gt;By default, OpenText™ Analytics Database formats query output as follows:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT DISTINCT category_description FROM product_dimension ORDER BY category_description;
       category_description
----------------------------------
 Food
 Medical
 Misc
 Non-food
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can control the format of query output in various ways with the &lt;code&gt;\pset&lt;/code&gt; command—for example, change the border:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \pset border 2
Border style is 2.
=&amp;gt; SELECT DISTINCT category_description FROM product_dimension ORDER BY category_description;
+----------------------------------+
|       category_description       |
+----------------------------------+
| Food                             |
| Medical                          |
| Misc                             |
| Non-food                         |
+----------------------------------+
(4 rows)
=&amp;gt; \pset border 0
Border style is 0.
=&amp;gt; SELECT DISTINCT category_description FROM product_dimension ORDER BY category_description;
      category_description
--------------------------------
Food
Medical
Misc
Non-food
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following sequence of &lt;code&gt;pset&lt;/code&gt; commands change query output in several ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Set border style to 1.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Remove column alignment.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Change the field separator to a comma.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Remove column headings&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \pset border 1
Border style is 1.
=&amp;gt; \pset format unaligned
Output format is unaligned.
=&amp;gt; \pset fieldsep &amp;#39;,&amp;#39;
Field separator is &amp;#34;,&amp;#34;.
=&amp;gt; \pset tuples_only
Showing only tuples.
=&amp;gt; SELECT product_key, product_description, category_description FROM product_dimension LIMIT 10;
1,Brand #2 bagels,Food
1,Brand #1 butter,Food
2,Brand #6 chicken noodle soup,Food
3,Brand #11 vanilla ice cream,Food
4,Brand #14 chocolate chip cookies,Food
4,Brand #12 rash ointment,Medical
6,Brand #18 bananas,Food
7,Brand #25 basketball,Misc
8,Brand #27 french bread,Food
9,Brand #32 clams,Food
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example uses meta-commands to toggle output format—in this case, &lt;code&gt;\a&lt;/code&gt; (alignment), &lt;code&gt;\t&lt;/code&gt; (tuples only), and &lt;code&gt;-x&lt;/code&gt; (extended display):&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \a \t \x
Output format is aligned.
Tuples only is off.
Expanded display is off.
=&amp;gt; SELECT product_key, product_description, category_description FROM product_dimension LIMIT 10;
 product_key |       product_description        |       category_description
-------------+----------------------------------+----------------------------------
           1 | Brand #2 bagels                  | Food
           1 | Brand #1 butter                  | Food
           2 | Brand #6 chicken noodle soup     | Food
           3 | Brand #11 vanilla ice cream      | Food
           4 | Brand #14 chocolate chip cookies | Food
           4 | Brand #12 rash ointment          | Medical
           6 | Brand #18 bananas                | Food
           7 | Brand #25 basketball             | Misc
           8 | Brand #27 french bread           | Food
           9 | Brand #32 clams                  | Food
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example sets output format to HTML, so the database renders query results in HTML markup as a table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; \pset format html
Output format is html.
=&amp;gt; \pset tableattr &amp;#39;border=&amp;#34;2&amp;#34; cellpadding=&amp;#34;3&amp;#34;&amp;#39;
Table attribute is &amp;#34;border=&amp;#34;2&amp;#34; cellpadding=&amp;#34;3&amp;#34;&amp;#34;.
=&amp;gt; SELECT product_key, product_description, category_description FROM product_dimension LIMIT 2;
&amp;lt;table border=&amp;#34;1&amp;#34; border=&amp;#34;2&amp;#34; cellpadding=&amp;#34;3&amp;#34;&amp;gt;
  &amp;lt;tr&amp;gt;
    &amp;lt;th align=&amp;#34;center&amp;#34;&amp;gt;product_key&amp;lt;/th&amp;gt;
    &amp;lt;th align=&amp;#34;center&amp;#34;&amp;gt;product_description&amp;lt;/th&amp;gt;
    &amp;lt;th align=&amp;#34;center&amp;#34;&amp;gt;category_description&amp;lt;/th&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr valign=&amp;#34;top&amp;#34;&amp;gt;
    &amp;lt;td align=&amp;#34;right&amp;#34;&amp;gt;1&amp;lt;/td&amp;gt;
    &amp;lt;td align=&amp;#34;left&amp;#34;&amp;gt;Brand #2 bagels&amp;lt;/td&amp;gt;
    &amp;lt;td align=&amp;#34;left&amp;#34;&amp;gt;Food                            &amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr valign=&amp;#34;top&amp;#34;&amp;gt;
    &amp;lt;td align=&amp;#34;right&amp;#34;&amp;gt;1&amp;lt;/td&amp;gt;
    &amp;lt;td align=&amp;#34;left&amp;#34;&amp;gt;Brand #1 butter&amp;lt;/td&amp;gt;
    &amp;lt;td align=&amp;#34;left&amp;#34;&amp;gt;Food                            &amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;p&amp;gt;(2 rows)&amp;lt;br /&amp;gt;
&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
  </channel>
</rss>
