ALTER CONNECTION

Syntax

ALTER {      
        ELASTICSEARCH |
        GLUE_CATALOG | 
        ICEBERG_REST_CATALOG |
        KAFKA | 
        KINESIS |      
        MSSQL |
        MONGODB |
        MYSQL |
        POSTGRES |
        REDSHIFT |
        S3 |  
        SNOWFLAKE 
        } CONNECTION <connection_identifier>
    SET <connection_option> = <value>
    [ SET <connection_option2> = <value2> ... ]; 

Note that not all connection options are mutable.

Connection options

Cloud storage

Metastores

Streaming systems

Databases

Rename connection

You can rename a connection with immediate effect using the following syntax:

ALTER CONNECTION <old_conn_name> RENAME TO <new_conn_name>;

Example

In the following example, the mssql_prod connection is renamed to mssql_prod_emea to clarify which server this connects to:

ALTER CONNECTION mssql_prod RENAME TO mssql_prod_emea; 

To view the details for a connection before or after you rename it, you can query the system.information_schema.connections table.

The following query performs a wildcard search to find all connections with a name prefix of mssql_.

SELECT * 
FROM system.information_schema.connections
WHERE name LIKE 'mssql_%';

This enables you to check the connection details to ensure you rename the correct object, or to find all connections you want to rename.

Last updated