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.

Copy and export operations can fail if either side of the connection is a single-node cluster installed to localhost.

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 ImportExportTLSMode for this connection to PREFER. If ImportExportTLSMode is set to *_FORCE you 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 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 configuration parameter ImportExportTLSMode to require encryption for plan metadata.

Example

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