Vertica Analytics Platform Version 9.2.x Documentation

CONNECT

Connects to another Vertica database to enable data import (using the COPY FROM VERTICA statement) or export (using the EXPORT statement). By default, invoking CONNECT occurs over the Vertica private network. Creating a connection over a public network requires some configuration. For information about using CONNECT to export data to or import data over a public network, see Using Public and Private IP Networks.

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 authentication is not supported.

If configured with a certificate, Vertica encrypts data during transmission using TLS and attempts to encrypt plan metadata. You can set the ImportExportTLSMode configuration parameter to require encryption for plan metadata. See Security Parameters.

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 other database.

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 the ImportExportTLSMode configuration parameter for this connection to PREFER. If ImportExportTLSMode is set to *_FORCE you cannot override it. For more information about this parameter, see Security Parameters.

Privileges

None

Connection Details

After you establish a connection to another database, the connection remains open for the current session. To disconnect a connection, use the DISCONNECT statement.

You can have only one connection to another database at a time. However, you can create connections to multiple different databases in the same session.

If the target database does not have a password, and you specify a password in the CONNECT statement, the connection succeeds, but does not give any indication that you supplied an incorrect password.

Example

=> CONNECT TO VERTICA ExampleDB USER dbadmin PASSWORD 'Password123' ON 'VerticaHost01',5433;
CONNECT