CONNECT TO VERTICA
Connects to another Vertica database to enable importing and exporting data across Vertica databases, with
COPY FROM VERTICA and
EXPORT TO VERTICA, respectively.
After you establish a connection to another database, the connection remains open in the current session until you explicitly close it with
DISCONNECT. You can have only one connection to another database at a time. However, you can establish successive connections to different databases in the same session.
By default, invoking CONNECT TO VERTICA occurs over the Vertica private network. For information about creating a connection over a public network, see Using public and private IP networks.
Important
The following restrictions apply:
-
Copy and export operations can fail if either side of the connection is a single-node cluster installed to
localhost. -
CONNECT TO VERTICA fails if you attempt to connect to a database whose
serverTLS CONFIGURATION uses aTLSMODEofVERIFY_CAorVERIFY_FULL. For details, see Configuring client-server TLS.
Syntax
CONNECT TO VERTICA db-spec USER username PASSWORD 'password' ON 'host', port [TLSMODE PREFER]
Parameters
*db-spec*- The target database, either the database name or
DEFAULT. *username*- The username to use when connecting to the other database.
*password*- A string containing the password to use to connect to the target database.
If the target database has no password, and you supply one, the connection succeeds; however, Vertica returns no indication that you supplied an incorrect password.
*host*- A string containing the host name of one of the nodes in the other database.
*port*- The port number of the other database as an integer.
TLSMODE PREFER- Overrides the value of configuration parameter
ImportExportTLSModefor this connection toPREFER. IfImportExportTLSModeis set to*_FORCEyou cannot override it.
Privileges
None
Security requirements
When importing from or exporting to a Vertica database, you can connect only to a database that uses trusted (username only) or password-based authentication, as described in Security and authentication. SSL, Kerberos, and OAuth authentication methods are not supported.
If configured with a certificate, Vertica encrypts data during transmission using TLS and attempts to encrypt plan metadata. You can set configuration parameter
ImportExportTLSMode to require encryption for plan metadata.
Examples
=> CONNECT TO VERTICA ExampleDB USER dbadmin PASSWORD 'Password123' ON 'VerticaHost01',5433;
CONNECT