Creating a PostgreSQL connection
Warning
When connecting to an external data source (that's not a Yandex.Cloud resource), grant access to the source for the DataLens IP address ranges.
178.154.242.176/28
178.154.242.192/28
178.154.242.208/28
178.154.242.128/28
178.154.242.144/28
178.154.242.160/28
Connecting to PostgreSQL
To create a PostgreSQL connection:
-
Go to the connections page.
-
Click Create connection.
-
Select the PostgreSQL connector.
-
Enter a Connection name. You can set any name.
-
Select the connection type:
Select in Yandex.CloudSpecify manuallySpecify the connection parameters for the PostgreSQL DB available in Yandex.Cloud:
-
Cluster. Specify a cluster from the list of available PostgreSQL clusters. If you don't have an available cluster, click Create new.
Note
The PostgreSQL clusters are shown in the list of clusters:
- With the permissions for the user that creates the connection.
- Created in the same folder with the DataLens instance.
-
Hostname. Select the host name from the list of hosts available in the PostgreSQL cluster.
-
Port. Specify the PostgreSQL connection port. The default port is 6432.
-
Database name. Specify the name of the database to connect to.
-
Username. Specify the username for the PostgreSQL connection.
-
Password. Enter the password for the user.
Specify the connection parameters for the external PostgreSQL database:
- Hostname. Specify the PostgreSQL host path or IP address.
- Port. Specify the PostgreSQL connection port. The default port is 6432.
- Database name. Specify the name of the database to connect to.
- Username. Specify the username for the PostgreSQL connection.
- Password. Enter the password for the user.
-
-
Click Save. The connection appears in the list.
Note
You can check the host connection before creating it. To do this, click Check connection.
Additional settings
To explicitly define a collation for DB queries, go to Advanced connection settings.
Select a mode to configure Specifying collate in the request:
- Auto: The default setting is used, DataLens decides whether to enable the
en_US
locale. - On: The DataLens setting is used, the
en_US
locale is specified for individual expressions in a query. This makes the server use the appropriate sorting logic, regardless of the server settings and specific tables. Use the DataLens setting if the DB locale is incompatible with DataLens performance. For more information about the locale andLC_COLLATE
, see How to create a PostgreSQL cluster. - Off: The default setting is used, DataLens only uses the existing parameters of the DB locale.