Categories:

Account & Session DDL

CREATE CONNECTION

Creates a new connection in the account. For more details, see Redirecting Client Connections.

See also:

ALTER CONNECTION , DROP CONNECTION , SHOW CONNECTIONS

In this Topic:

Syntax

Primary Connection

CREATE [ OR REPLACE ] CONNECTION [ IF NOT EXISTS ] <name>
  [ COMMENT = '<string_literal>' ]

Secondary Connection

CREATE [ OR REPLACE ] CONNECTION [ IF NOT EXISTS ] <name>
  AS REPLICA OF <organization_name>.<account_name>.<name>
  [ COMMENT = '<string_literal>' ]

Required Parameters

name

String that specifies the identifier (i.e. name) for the connection. The identifier must start with an alphabetic character and can only contain alphanumeric characters.

The name of each primary connection must be unique across connection names and account names in the organization.

The name of each secondary connection must match the name of its primary connection.

Secondary Connection Parameters

AS REPLICA OF organization_name.account_name.name

Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection).

Optional Parameters

COMMENT = 'string_literal'

Specifies a comment for the connection.

Default: No value

Usage Notes

  • Only account administrators (users with the ACCOUNTADMIN role) can execute this SQL command.

Examples

Create a connection for your account:

CREATE OR REPLACE CONNECTION myconnection;

Create a secondary connection as a replica of its primary connection:

CREATE CONNECTION myconnection AS REPLICA OF myorg.myaccount1.myconnection;