Connecting to a PostgreSQL cluster from DataLens
Yandex DataLens is a business intelligence service, that lets you upload, process and visualize data for analysing and testing hypotheses. It can help you make marketing decisions for your product.
To use an existing cluster as a data source for Yandex DataLens:
- Activate DataLens.
- Enable access to the cluster from DataLens.
- Create a cluster connection in DataLens.
Activating DataLens
Limit
You can only create one DataLens instance in the cloud.
- In the management console
, go to the folder page. - Select DataLens.
- Click Activate DataLens.
The DataLens instance will be activated in the selected folder.
Allowing access to a cluster from DataLens
To enable DataLens to connect to your cluster and work with its data, activate the DataLens access option when creating a cluster or updating its settings.
Creating a connection to a cluster
-
Make sure that DataLens is activated in the appropriate folder and you can access the cluster from it.
-
Go to the folder page and select Managed Service for PostgreSQL.
-
Click the cluster name and open the DataLens tab.
-
Click Create connection.
I have no "Create connection" button
If you see a message saying "DataLens not activated" instead of the Create connection button, it means that you either did not activate DataLens or connected it in a different folder. To connect your cluster to a DataLens instance from another folder, follow the guide in the DataLens documentation.
-
Specify the connection settings.
-
In the top-right corner, select the connection scope from the drop-down list:
- Available only to me.
- Available to the company.
-
Check that the settings are correct by clicking Check connection.
-
After successfully checking the connection, click Create connection.
-
In the resulting window, enter a name for the connection and click Create.
Once the connection is created, you can:
- Update or delete the connection.
- Create datasets with cluster data using the connection.
- Visualize the datasets using charts and dashboards.
Viewing a list of cluster connections
- Go to the folder page and select Managed Service for PostgreSQL.
- Click the cluster name and open the DataLens tab.
Updating a cluster connection
- Go to the folder page and select Managed Service for PostgreSQL.
- Click the cluster name and open the DataLens tab.
- Select a connection from the list.
- Edit the connection settings and scope.
- Check that the settings are correct by clicking Check connection.
- After successfully checking the connection, click Save changes.
Deleting a cluster connection
- Go to the folder page and select Managed Service for PostgreSQL.
- Click the cluster name and open the DataLens tab.
- Select a connection from the list.
- Click
at the top of the page and select Delete. - In the window that opens, click Delete.
Connection settings
- Specify a name for the connection.
- If the cluster and DataLens are in the same folder:
- Go to the Select in cloud tab.
- Select the cluster and its host from the drop-down lists or create a new cluster in the folder with DataLens by clicking Create new.
- Leave the Port setting value unchanged.
- Select a database name from the drop-down list.
- Select a user from the drop-down list.
- Enter this user's password.
- Specify the cache time-to-live or leave the default value. The recommended value is 300 seconds (5 minutes).
- Configure a Raw SQL level.
- To explicitly define a collation for DB queries, go to Advanced connection settings. Select a mode to configure Setting collate in a query:
- Auto: Default setting is used, DataLens decides whether to enable the
en_US
locale. - On: 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 on the locale andLC_COLLATE
, see Creating a cluster. - Off: The default setting is used, DataLens only uses the existing parameters of the DB locale.
- Auto: Default setting is used, DataLens decides whether to enable the
- If the cluster and DataLens are in different folders, use the settings from the instructions in the DataLens documentation.