Skip to main content

Connect to a PostgreSQL for 1C cluster

You can connect to a PostgreSQL for 1C cluster:

  • via the psql console client;
  • using the pgAdmin graphical database management tool;
  • using 1C:Enterprise and other office suites or applications with ODBC or JDBC support;
  • using programming code.

Connection with an SSL certificate is unavailable.

When connecting, specify the port and address.

Connection ports

Use these ports to connect to PostgreSQL for 1C:

  • 5432 — the port for direct connection to the PostgreSQL for 1C process;
  • 6432 — the port for connection to the master node.

Connection addresses

The connection address depends on the cluster subnet and where you are connecting from. You can choose an address based on one of the scenarios:

Connecting to a cluster in a public subnet

If a cluster is in a public subnet, you can connect to the nodes using a DNS address or an IP address from the public subnet.

We recommend connecting using a DNS address. DNS addresses use the master discovery mechanism in the cluster—the address is tied to the node role rather than the node itself. If a master becomes unavailable, one of the replicas becomes the new master, and the address moves to the new node along with the role.

The master discovery mechanism is not used when connecting via an IP address from a public subnet. If one of the replicas becomes the new master, the master's IP address will change, and the connection using the old IP address will stop working.

You can view the connection address in the Dashboard.

Connecting from a private subnet to a cluster in a private subnet

If you are connecting from a private subnet to a cluster in a private subnet, you can use a DNS address or a private IP address.

We recommend connecting using a DNS address. DNS addresses use the master discovery mechanism in the cluster—the address is tied to the node role rather than the node itself. If a master becomes unavailable, one of the replicas becomes the new master, and the address moves to the new node along with the role.

The master discovery mechanism is not used when connecting via a private IP address. If one of the replicas becomes the new master, the master's IP address will change, and the connection using the old IP address will stop working.

To connect from another private subnet, first connect both private subnets to a cloud router.

You can view the connection address in the Dashboard.

Connecting from the Internet to a cluster in a private subnet

If you are connecting to a cluster in a private subnet from the Internet, you can only use a public IP address (Floating IP). The private subnet must meet the requirements. If the subnet does not meet the requirements, prepare it for a public IP address (Floating IP).

Public IP addresses (Floating IPs) use the master discovery mechanism—the address is tied to the node role rather than the node itself. If a master becomes unavailable, one of the replicas becomes the new master, and the address moves to the new node along with the role.

You can view the connection address in the Dashboard.

View the connection address

  1. In the Dashboard, in the top menu click Products and select Managed Databases.
  2. Open the Active tab.
  3. Open the database cluster page → Connection tab.
  4. In the Connection addresses block, view the address.

Connect to a cluster

To connect a PostgreSQL for 1C database as a 1C infobase, use the following parameters in the infobase addition form in 1C:Enterprise:

  • Secure connection — disabled;
  • DBMS type — PostgreSQL;
  • Database server — node DNS name or public IP address (Floating IP);
  • Database name — the name of the created database;
  • Database user — the database username;
  • User password — password.