Appearance
ybsql Environment Variables
You can set the following environment variables in two ways:
- When starting a session:
NAME=VALUE [NAME=VALUE] ybsql- Inside a session:
\setenv NAME [VALUE]- COLUMNS
If
\psetcolumns is zero, controls the width for thewrappedformat, and also the width for determining if wide output requires the pager or should be switched to the vertical format in expanded mode.- PAGER
Name of an external pager command. If query results do not fit on the screen, they are piped through this command (for example,
moreorless). The default is platform-dependent. You can disable the pager by settingPAGERto empty or by using pager-related options of the\psetcommand.- SHELL
Shell used by the
\!command.- TMPDIR
Directory for temporary files. The default is
/tmp.- YBAPPNAME
Equivalent to the
application_nameconnection parameter. The Yellowbrick tools set appropriate names for themselves, such asybsql. The value ofYBAPPNAMEmay be used as the name for a custom application that does not set its own default name.- YBDATABASE
Name of the destination database. Default:
yellowbrick. See ybsql Connections.- YBHOST
Name of the destination server host. Default:
localhost. See ybsql Connections.- YBPASSFILE
Name of a file where passwords are stored. The default file is in the user's home directory on Linux platforms and is named
.ybpass. On Windows platforms, the file is:%APPDATA%\yellowbrick\ybpass.confwhere
%APPDATA%refers to the Application Data subdirectory in the user's profile.The file itself should contain entries like this:
hostname:port:database:username:password- YBPASSWORD
Interactive prompt for the database user's password. No default. See ybsql Connections.
- YBPORT
The destination server port number. Default:
5432. See ybsql Connections.- YBSSLMODE
Determines whether or not SSL/TLS is used when connecting to the server and, if so, how. See ybsql Connections.
- YBSQL_EDITOR, EDITOR, VISUAL
Editor used by the
\ecommand. Default editors arevion Linux andnotepad.exeon Windows.- YBSQL_EDITOR_LINENUMBER_ARG
The command-line argument that passes the starting line number to the editor when the
\ecommand specifies a line number. The value of this variable must be a valid argument for the editor being used. For editors such asEmacsorvi, this value is a plus sign. Include a trailing space in the value of the variable if a space is required between the option name and the line number.- YBSQL_HISTORY
Alternative location for the command history file.
- YBSQLRC
Alternative location for the user's
.ybsqlrcorybsqlrc.conffile. See ybsql Startup File.- YBUSER
The database login username. No default. See ybsql Connections.
Examples
$ YBDATABASE=premdb YBUSER=bobr SHELL=bash ./ybsql
Password:
Null display is "[NULL]".
Expanded display is used automatically.
ybsql (1.2.1.5007)
Type "help" for help.
premdb=>premdb=> \setenv YBUSER bobr
premdb=> \! env
...
COLUMNS=136
YBUSER=bobr
SHELL=bash
PWD=/usr/bin
YBDATABASE=premdb
premdb=>premdb=# \setenv YBSQL_EDITOR 'emacs'
\setenv YBSQL_EDITOR_LINENUMBER_ARG '+'
premdb=# \e /home/premdb/match.csv 8500
...Parent topic:ybsql Reference