{"id":460101,"date":"2025-05-19T09:00:08","date_gmt":"2025-05-19T09:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=460101"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=460101","title":{"rendered":"<span>\u0412\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 target_session_attrs=read-write (\u0438\u043b\u0438 primary) \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443 PostgreSQL \u0432 \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0435<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438 PostgreSQL, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e (High Availability, HA), \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 &#171;cannot execute INSERT in a read-only transaction&#187;. \u042d\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439 (read-only). \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043e\u0441\u0442\u0440\u043e \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430: \u043f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u044b \u043a \u0431\u044b\u0432\u0448\u0435\u043c\u0443 \u043c\u0430\u0441\u0442\u0435\u0440\u0443, \u0441\u0442\u0430\u0432\u0448\u0435\u043c\u0443 \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439, \u0438\u043b\u0438 \u0436\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043a \u0440\u0435\u043f\u043b\u0438\u043a\u0435.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b PostgreSQL \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2013 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u00a0<code>target_session_attrs<\/code>. \u0412 \u0432\u0435\u0440\u0441\u0438\u0438 PostgreSQL 14 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f target_session_attrs: read-only, primary, standby \u0438 prefer-standby. \u042d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0441\u0435\u0441\u0441\u0438\u044e \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>read-write<\/code>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u043e, \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a\u00a0<code>target_session_attrs=read-write<\/code>\u00a0\u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u00a0<code>target_session_attrs=primary<\/code>, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0435\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442\u00a0<code>read-write<\/code>, \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: \u043a\u043b\u0430\u0441\u0442\u0435\u0440 PostgreSQL \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0435<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 PostgreSQL \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0435. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043b\u0435\u0433\u043a\u043e \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Terraform.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434 Terraform (<a href=\"http:\/\/main.tf\" rel=\"noopener noreferrer nofollow\"><code>main.tf<\/code><\/a>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 PostgreSQL \u0441 \u0442\u0440\u0435\u043c\u044f \u0445\u043e\u0441\u0442\u0430\u043c\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u043e\u043d\u0430\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0441\u0435\u0442\u0438, \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>resource \"yandex_mdb_postgresql_cluster\" \"my_cluster\" {   name        = \"ha\"   environment = \"PRESTABLE\"   network_id  = yandex_vpc_network.foo.id    config {     version = 16     resources {       resource_preset_id = \"s2.micro\"       disk_type_id       = \"network-ssd\"       disk_size          = 16     }   }    host {     zone      = \"ru-central1-a\"     subnet_id = yandex_vpc_subnet.baz.id     assign_public_ip = true   }    host {     zone      = \"ru-central1-b\"     subnet_id = yandex_vpc_subnet.foo.id     assign_public_ip = true   }    host {     zone      = \"ru-central1-d\"     subnet_id = yandex_vpc_subnet.bar.id     assign_public_ip = true   }    timeouts {     create = \"1h30m\" # \u041f\u043e\u043b\u0442\u043e\u0440\u0430 \u0447\u0430\u0441\u0430     update = \"2h\"    # 2 \u0447\u0430\u0441\u0430     delete = \"1h\"   # 30 \u043c\u0438\u043d\u0443\u0442   } }  resource \"yandex_mdb_postgresql_user\" \"my_user\" {   cluster_id = yandex_mdb_postgresql_cluster.my_cluster.id   name       = \"test\"   password   = \"\" # \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043a PostgreSQL   conn_limit = 50 }  resource \"yandex_mdb_postgresql_database\" \"my_db\" {   cluster_id = yandex_mdb_postgresql_cluster.my_cluster.id   name       = \"testdb\"   owner      = yandex_mdb_postgresql_user.my_user.name  }  resource \"yandex_vpc_network\" \"foo\" {}  resource \"yandex_vpc_subnet\" \"foo\" {   zone           = \"ru-central1-b\"   network_id     = yandex_vpc_network.foo.id   v4_cidr_blocks = [\"10.1.0.0\/24\"] }  resource \"yandex_vpc_subnet\" \"bar\" {   zone           = \"ru-central1-d\"   network_id     = yandex_vpc_network.foo.id   v4_cidr_blocks = [\"10.2.0.0\/24\"] }  resource \"yandex_vpc_subnet\" \"baz\" {   zone           = \"ru-central1-a\"   network_id     = yandex_vpc_network.foo.id   v4_cidr_blocks = [\"10.3.0.0\/24\"] }  output \"cluster_fqdn\" {   description = \"FQDN for the PostgreSQL cluster\"   value       = \"c-${yandex_mdb_postgresql_cluster.my_cluster.id}.rw.mdb.yandexcloud.net\" }  output \"hosts_fqdns\" {   description = \"FQDNs of all cluster hosts\"   value       = [     for host in yandex_mdb_postgresql_cluster.my_cluster.host : host.fqdn   ] }  resource \"local_file\" \"env_file\" {   filename = \"${path.module}\/.env\"   content  = &lt;&lt;EOT PG_HOST=c-${yandex_mdb_postgresql_cluster.my_cluster.id}.rw.mdb.yandexcloud.net PG_PORT=6432 PG_USER=${yandex_mdb_postgresql_user.my_user.name} PG_PASSWORD=${yandex_mdb_postgresql_user.my_user.password} PG_DB=${yandex_mdb_postgresql_database.my_db.name} POOL_MAX_CONNS=2 POOL_MIN_CONNS=2 POOL_MAX_CONN_LIFETIME=1h POOL_MAX_CONN_IDLE_TIME=30m DEFAULT_QUERY_EXEC_MODE=simple_protocol TARGET_SESSION_ATTRS=any EOT } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u042d\u0442\u043e\u0442 Terraform-\u043a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0441\u0442:<\/p>\n<ul>\n<li>\n<p>VPC (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u043e\u0431\u043b\u0430\u043a\u043e) \u0438 \u0442\u0440\u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u043e\u043d\u0430\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 (<code>ru-central1-a<\/code>,\u00a0<code>ru-central1-b<\/code>,\u00a0<code>ru-central1-d<\/code>).<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0430\u0441\u0442\u0435\u0440 Managed Service for PostgreSQL \u0441 \u0442\u0440\u0435\u043c\u044f \u0445\u043e\u0441\u0442\u0430\u043c\u0438 (\u043e\u0434\u0438\u043d \u043c\u0430\u0441\u0442\u0435\u0440 \u0438 \u0434\u0432\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0438), \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u044d\u0442\u0438\u043c \u0437\u043e\u043d\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e PostgreSQL 16 \u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b (<code>s2.micro<\/code>, 16 \u0413\u0411 SSD) \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00a0<code>test<\/code>\u00a0\u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0<code>testdb<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0444\u0430\u0439\u043b\u00a0<code>.env<\/code>\u00a0\u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<code>TARGET_SESSION_ATTRS<\/code>\u00a0\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u00a0<code>any<\/code>. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e Terraform-\u043a\u043e\u0434\u0430 (<code>terraform apply<\/code>) \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 PostgreSQL.<\/p>\n<h4>\u0412\u044b\u0431\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: Go<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u044f\u0437\u044b\u043a Go (Golang). Go \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u044d\u043a\u0435\u043d\u0434-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043c\u043e\u0449\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0438\u043c\u0435\u0435\u0442 \u0437\u0440\u0435\u043b\u044b\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 PostgreSQL, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<code>pgx<\/code>.<\/p>\n<p>\u041d\u0430\u0448\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (<code>main.go<\/code>) \u0431\u0443\u0434\u0435\u0442 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043b\u043e\u0433\u0438\u0440\u0443\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0443\u043b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u0443\u0437\u043b\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>package main  import ( \"context\" \"fmt\" \"log\" \"net\" \"os\" \"strings\" \"time\"  \"github.com\/joho\/godotenv\" \"github.com\/jackc\/pgx\/v5\/pgconn\" \"github.com\/jackc\/pgx\/v5\/pgxpool\" \"github.com\/jackc\/pgx\/v5\/stdlib\" \"github.com\/jmoiron\/sqlx\" )  func main() { if err := godotenv.Load(); err != nil { log.Println(\"Warning: no .env file found, trying to read env from system\") }  ctx := context.TODO()  connString := buildConnStringFromEnv() log.Println(connString)  db, pool, err := GetDB(ctx, connString) if err != nil { log.Fatal(err) }  log.Println(\"Connected!!\")  if _, err := db.Exec(`create table if not exists test (    id bigint GENERATED BY DEFAULT AS IDENTITY primary key,    created_at timestamptz not null  )`); err != nil { log.Fatalf(\"unable to create table: %v\\n\", err) }  for { result, err := db.Exec( `insert into \"test\" (\"created_at\") values ($1)`, time.Now())  if err != nil { connInfo := GetConnectionInfo(ctx, pool) pgErr, ok := err.(*pgconn.PgError) if ok { log.Printf(\"DB Error [%s] %s (Code: %s): %s\", connInfo, pgErr.Message, pgErr.Code, err) } else { log.Printf(\"DB Error [%s]: %s\", connInfo, err) } time.Sleep(1 * time.Second) continue }  connInfo := GetConnectionInfo(ctx, pool) rowsAffected, _ := result.RowsAffected() log.Printf(\"Successful [%s]: rows affected: %d\", connInfo, rowsAffected) time.Sleep(1 * time.Second) } }  func buildConnStringFromEnv() string { user := os.Getenv(\"PG_USER\") password := os.Getenv(\"PG_PASSWORD\") host := os.Getenv(\"PG_HOST\") port := os.Getenv(\"PG_PORT\") db := os.Getenv(\"PG_DB\")  poolMaxConns := os.Getenv(\"POOL_MAX_CONNS\") poolMinConns := os.Getenv(\"POOL_MIN_CONNS\") poolMaxConnLifetime := os.Getenv(\"POOL_MAX_CONN_LIFETIME\") poolMaxConnIdleTime := os.Getenv(\"POOL_MAX_CONN_IDLE_TIME\") defaultQueryExecMode := os.Getenv(\"DEFAULT_QUERY_EXEC_MODE\") targetSessionAttrs := os.Getenv(\"TARGET_SESSION_ATTRS\")  connString := fmt.Sprintf( \"postgres:\/\/%s:%s@%s:%s\/%s?pool_max_conns=%s&amp;pool_min_conns=%s&amp;pool_max_conn_lifetime=%s\" + \"&amp;pool_max_conn_idle_time=%s&amp;default_query_exec_mode=%s&amp;target_session_attrs=%s\", user, password, host, port, db, poolMaxConns, poolMinConns, poolMaxConnLifetime, poolMaxConnIdleTime, defaultQueryExecMode, targetSessionAttrs, )  return connString }  func GetConnectionInfo(ctx context.Context, pool *pgxpool.Pool) string { var connInfo strings.Builder stat := pool.Stat() connInfo.WriteString(fmt.Sprintf(\"Pool total: %d, acquired: %d, idle: %d | \", stat.TotalConns(), stat.AcquiredConns(), stat.IdleConns()))  conn, err := pool.Acquire(ctx) if err != nil { return connInfo.String() + \"Failed to acquire connection\" } defer conn.Release()  remoteAddr := conn.Conn().PgConn().Conn().RemoteAddr().String() host, _, _ := net.SplitHostPort(remoteAddr)  var readOnly bool err = conn.QueryRow(ctx, \"SELECT pg_is_in_recovery()\").Scan(&amp;readOnly) if err != nil { connInfo.WriteString(fmt.Sprintf(\"IP: %s, Error getting read-only status\", host)) return connInfo.String() }  serverType := \"Master\" if readOnly { serverType = \"Replica\" }  connInfo.WriteString(fmt.Sprintf(\"IP: %s, Type: %s\", host, serverType)) return connInfo.String() }  func GetDB(ctx context.Context, uri string) (*sqlx.DB, *pgxpool.Pool, error) { DB, pool, err := PgxCreateDB(ctx, uri) if err != nil { return nil, nil, err } return DB, pool, nil }  func PgxCreateDB(ctx context.Context, uri string) (*sqlx.DB, *pgxpool.Pool, error) { connConfig, err := pgxpool.ParseConfig(uri) if err != nil { return nil, nil, fmt.Errorf(\"failed to parse connection config: %w\", err) }  pool, err := pgxpool.NewWithConfig(ctx, connConfig) if err != nil { return nil, nil, fmt.Errorf(\"failed to create connection pool: %w\", err) }  if err := pool.Ping(ctx); err != nil { return nil, nil, fmt.Errorf(\"failed to ping DB: %w\", err) }  pgxdb := stdlib.OpenDBFromPool(pool) return sqlx.NewDb(pgxdb, \"pgx\"), pool, nil }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u0434\u0435\u00a0<code>main.go<\/code>:<\/p>\n<ol>\n<li>\n<p><strong>\u0421\u0431\u043e\u0440\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/strong>: \u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>buildConnStringFromEnv<\/code>\u00a0\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437\u00a0<code>.env<\/code>\u00a0\u0444\u0430\u0439\u043b\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e Terraform) \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u00a0<code>target_session_attrs<\/code>\u00a0\u0442\u0430\u043a\u0436\u0435 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438<\/strong>: \u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>GetConnectionInfo<\/code>\u00a0\u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439 (\u0438\u043b\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438) \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0443 \u043f\u0443\u043b\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\u00a0<code>pgxpool.Pool<\/code>\u00a0\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u0443\u043b\u0430. \u0417\u0430\u0442\u0435\u043c \u043e\u043d\u0430 \u0431\u0435\u0440\u0435\u0442 \u043e\u0434\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0443\u043b\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 IP-\u0430\u0434\u0440\u0435\u0441 \u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0443 PostgreSQL, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439 (<code>SELECT pg_is_in_recovery()<\/code>). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0443\u0437\u0435\u043b (\u043c\u0430\u0441\u0442\u0435\u0440 \u0438\u043b\u0438 \u0440\u0435\u043f\u043b\u0438\u043a\u0430) \u043f\u043e\u0448\u043b\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u0426\u0438\u043a\u043b \u0432\u0441\u0442\u0430\u0432\u043e\u043a<\/strong>: \u0412\u00a0<code>main<\/code>\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443\u00a0<code>test<\/code>, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043f\u044b\u0442\u0430\u044f\u0441\u044c \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c. \u041b\u043e\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430, \u043b\u0438\u0431\u043e \u043e\u0448\u0438\u0431\u043a\u0430, \u0432\u0441\u0435\u0433\u0434\u0430 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439\u00a0<code>Makefile<\/code>:<\/p>\n<pre><code>.PHONY: build run tidy  run: go mod tidy go build -o switch-checker *.go .\/switch-checker <\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430\u00a0<code>make run<\/code>\u00a0\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u00a0<code>go mod tidy<\/code>, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u0435\u0440\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b\u00a0<code>switch-checker<\/code>\u00a0\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0435\u0433\u043e.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0411\u0415\u0417\u00a0target_session_attrs\u00a0(\u0438\u043b\u0438 \u0441\u00a0target_session_attrs=any)<\/h4>\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 PostgreSQL \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0435, \u0438 Terraform \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u00a0<code>.env<\/code>\u00a0\u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u00a0<code>TARGET_SESSION_ATTRS<\/code>\u00a0\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u00a0<code>any<\/code>. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0435\u0433\u043e \u0440\u043e\u043b\u0438 (\u043c\u0430\u0441\u0442\u0435\u0440 \u0438\u043b\u0438 \u0440\u0435\u043f\u043b\u0438\u043a\u0430).<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430\u0448\u0435 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<ol>\n<li>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438\u00a0<code>main.go<\/code>,\u00a0<a href=\"http:\/\/main.tf\" rel=\"noopener noreferrer nofollow\"><code>main.tf<\/code><\/a>\u00a0\u0438\u00a0<code>Makefile<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u00a0<code>terraform init<\/code>\u00a0\u0438\u00a0<code>terraform apply<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0444\u0430\u0439\u043b\u0430\u00a0<code>.env<\/code>, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u00a0<code>make run<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u043d\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c INSERT-\u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0412 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0434\u0442\u0438 \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440-\u0443\u0437\u0435\u043b. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u044b\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0431\u043e\u0439 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u043b\u0430\u043d\u043e\u0432\u043e\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0430 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Managed Service for PostgreSQL \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430 (Start Failover).<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0432 \u043b\u043e\u0433\u0430\u0445 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Connected!! Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1 2025\/05\/19 11:41:57 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:41:58 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:41:59 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:01 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:02 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:03 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:04 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:05 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:07 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:08 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:09 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:10 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:12 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:13 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 2025\/05\/19 11:42:14 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused 158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006) ^Cmake: *** [Makefile:6: run] \u041f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 <\/code><\/pre>\n<\/div>\n<\/details>\n<p><strong>\u0427\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0445\u043e\u0441\u0442\u0430 \u0438 IP<\/strong>: \u041d\u0430\u0448 Go-\u043a\u043e\u0434 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0<code>GetConnectionInfo<\/code>\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u00a0<code>SELECT pg_is_in_recovery()<\/code>. \u0415\u0441\u043b\u0438 \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u00a0<code>true<\/code>, \u0443\u0437\u0435\u043b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439, \u0438\u043d\u0430\u0447\u0435 \u2013 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c IP-\u0430\u0434\u0440\u0435\u0441 \u0443\u0437\u043b\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u043e\u043b\u0438 \u0440\u0435\u043f\u043b\u0438\u043a\u0438<\/strong>: \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0432 \u043b\u043e\u0433\u0435\u00a0<code>IP: 89.169.156.108, Type: Replica<\/code>, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0445\u043e\u0441\u0442\u043e\u043c\u00a0<code>89.169.156.108<\/code>, \u0438 \u044d\u0442\u043e\u0442 \u0445\u043e\u0441\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b, \u0447\u0442\u043e \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f (\u0442.\u0435. \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439).<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043f\u0443\u043b\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<\/strong>: \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u00a0<code>pgxpool<\/code>\u00a0(\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0443\u043b\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439) \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u0438\u00a0<code>target_session_attrs=any<\/code>, \u043f\u0443\u043b \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u043a \u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c, \u0442\u0430\u043a \u0438 \u0441 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u0449\u0438\u0439 FQDN \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<a href=\"http:\/\/c-xxxxxxxxx.rw.mdb.yandexcloud.net\" rel=\"noopener noreferrer nofollow\"><code>c-xxxxxxxxx.rw.mdb.yandexcloud.net<\/code><\/a>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0430\u0441\u0442\u0435\u0440, \u043d\u043e \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u0445 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043f\u0440\u044f\u043c\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a FQDN \u0440\u0435\u043f\u043b\u0438\u043a (\u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438) \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0443. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0443\u043b\u0435 \u0431\u044b\u043b\u0438 \u043a \u043c\u0430\u0441\u0442\u0435\u0440\u0443, \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u044d\u0442\u0438 &#171;\u0441\u0442\u0430\u0440\u044b\u0435&#187; \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0434\u0443\u0442 \u043a \u0443\u0437\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u043b \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0431\u0435\u0440\u044f \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0443\u043b\u0430 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<code>INSERT<\/code>, \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439\u00a0<code>cannot execute INSERT in a read-only transaction (Code: 25006)<\/code>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0427\u0435\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0443\u0441\u043f\u0435\u0445\u043e\u0432<\/strong>: \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043b\u043e\u0433\u043e\u0432, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0443. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u043f\u0443\u043b\u0435 (\u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435\u00a0<code>POOL_MAX_CONNS=2<\/code>) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u043c\u0430\u0441\u0442\u0435\u0440 (\u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u043f\u043b\u0438\u043a\u0443), \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0443. \u0414\u0440\u0443\u0433\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0443\u0436\u0435 \u043a \u043d\u043e\u0432\u043e\u043c\u0443 \u043c\u0430\u0441\u0442\u0435\u0440\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>IP: 62.84.123.60, Type: Master<\/code>), \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0442\u0435\u0440\u044e \u0434\u0430\u043d\u043d\u044b\u0445 (\u0438\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043e\u0432 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438).<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443: \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043c\u0430\u0441\u0442\u0435\u0440-\u0443\u0437\u043b\u0443 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u044b\u043c \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0441\u00a0target_session_attrs=read-write<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u041c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<code>TARGET_SESSION_ATTRS<\/code>\u00a0\u0432 \u043d\u0430\u0448\u0435\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<code>.env<\/code>\u00a0\u043d\u0430\u00a0<code>read-write<\/code>. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443\u00a0<code>pgx<\/code>, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0443\u0437\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0447\u0442\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u0438 \u0437\u0430\u043f\u0438\u0441\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u043a \u043c\u0430\u0441\u0442\u0435\u0440\u0443. \u0412\u043e\u0442 \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 PostgreSQL \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <em>target_session_attrs=read-write<\/em>: <a href=\"https:\/\/www.postgresql.org\/docs\/devel\/libpq-connect.html#libpq-connect-target-session-attrs\" rel=\"noopener noreferrer nofollow\">&#171;<em>\u0441\u0435\u0430\u043d\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0447\u0442\u0435\u043d\u0438\u044f-\u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0433\u043e\u0440\u044f\u0447\u0435\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, \u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 default_transaction_read_only \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d)<\/em>&#171;<\/a><\/p>\n<ol>\n<li>\n<p>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0435 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (Ctrl+C).<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b\u00a0<code>.env<\/code>\u00a0\u0432 \u0432\u0430\u0448\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443\u00a0<code>TARGET_SESSION_ATTRS=any<\/code>\u00a0\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0435\u0435 \u043d\u0430\u00a0<code>TARGET_SESSION_ATTRS=read-write<\/code>. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435\u00a0<code>.env<\/code>\u00a0\u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a (FQDN, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u0438\u043c\u044f \u0411\u0414 \u0431\u0443\u0434\u0443\u0442 \u0432\u0430\u0448\u0438\u043c\u0438):<\/p>\n<pre><code>PG_HOST=c-xxxxxxxxx.rw.mdb.yandexcloud.net PG_PORT=6432 PG_USER=test PG_PASSWORD=\u043f\u0430\u0440\u043e\u043b\u044c PG_DB=testdb POOL_MAX_CONNS=2 POOL_MIN_CONNS=2 POOL_MAX_CONN_LIFETIME=1h POOL_MAX_CONN_IDLE_TIME=30m DEFAULT_QUERY_EXEC_MODE=simple_protocol TARGET_SESSION_ATTRS=read-write<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435\u00a0<code>.env<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:\u00a0<code>make run<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u0438\u0441\u043a\u0430\u0442\u044c \u0443\u0437\u0435\u043b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c. \u0414\u0440\u0430\u0439\u0432\u0435\u0440\u00a0<code>libpq<\/code>\u00a0(\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f\u00a0<code>pgx<\/code>\u00a0\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0445\u043e\u0441\u0442\u0430\u043c \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 FQDN, \u043a\u0430\u043a \u0443 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0430) \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0445\u043e\u0441\u0442\u0430. \u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u0434\u0435\u0442 \u043a \u0440\u0435\u043f\u043b\u0438\u043a\u0435, \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c.<\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0430.<\/p>\n<p>\u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0439\u0442\u0435 \u0437\u0430 \u043b\u043e\u0433\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Connected!! Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:04 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:06 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:07 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:08 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:10 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:11 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:12 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:13 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:14 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:16 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:17 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:18 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:19 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:20 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused 2025\/05\/19 11:48:22 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: cb2611129158f: SSL is required (SQLSTATE 08P01) 2025\/05\/19 11:48:24 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: c12600b023fd4: SSL is required (SQLSTATE 08P01) 2025\/05\/19 11:48:26 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: c98b7d276695c: SSL is required (SQLSTATE 08P01) 2025\/05\/19 11:48:27 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: c51f7fd47a785: SSL is required (SQLSTATE 08P01) 2025\/05\/19 11:48:29 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: cf31377107d13: SSL is required (SQLSTATE 08P01) 2025\/05\/19 11:48:31 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: cb461ed639d77: SSL is required (SQLSTATE 08P01) 2025\/05\/19 11:48:32 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`: 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection 158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: c53aa7b735f36: SSL is required (SQLSTATE 08P01) Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1 ^Cmake: *** [Makefile:6: run] \u041f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u043b\u043e\u0433\u0430\u0445 \u0432\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a\u00a0<code>cannot execute INSERT in a read-only transaction<\/code>. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0443\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430, \u043f\u043e\u043a\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043d\u043e\u0432\u044b\u043c \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c, \u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0438. \u041f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u00a0<code>target_session_attrs=read-write<\/code>, \u0431\u0443\u0434\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c. \u041b\u044e\u0431\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043a \u0440\u0435\u043f\u043b\u0438\u043a\u0435, \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b.<\/p>\n<h4>\u041e\u0441\u043e\u0431\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439:\u00a0target_session_attrs=primary\u00a0\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435<\/h4>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e\u00a0<code>read-write<\/code>, \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f\u00a0<code>target_session_attrs<\/code>, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>primary<\/code>. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a\u00a0<code>read-write<\/code>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0433\u043e\u0440\u044f\u0447\u0435\u0433\u043e \u0440\u0435\u0437\u0435\u0440\u0432\u0430 (<code>hot standby<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c\u00a0<code>pg_is_in_recovery()<\/code>\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u00a0<code>false<\/code>), \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00a0<code>primary<\/code>\u00a0\u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u0442\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 (primary). \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0448\u0442\u0430\u0442\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u043e\u0431\u0430 \u044d\u0442\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u043c\u0430\u0441\u0442\u0435\u0440-\u0441\u0435\u0440\u0432\u0435\u0440\u0443.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0436\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u0432 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439:<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u043d\u0430 \u0434\u0438\u0441\u043a\u0430\u0445 PostgreSQL \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430.<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438\u00a0<code>target_session_attrs=read-write<\/code>: \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0445\u043e\u0442\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0441\u0435 \u0435\u0449\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c (\u043d\u0435 \u0432\u00a0<code>hot standby<\/code>\u00a0\u0438\u00a0<code>pg_is_in_recovery()<\/code>\u00a0\u0434\u043b\u044f \u043d\u0435\u0433\u043e\u00a0<code>false<\/code>), \u0435\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0442\u0440\u0430\u0447\u0435\u043d\u0430 \u0438\u0437-\u0437\u0430 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043c\u0435\u0441\u0442\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u2014 \u0431\u0443\u0434\u044c \u0442\u043e \u0441\u0430\u043c\u00a0<code>libpq<\/code>\u00a0\u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0445\u043e\u0441\u0442\u043e\u0432 \u0438\u043b\u0438 \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e FQDN \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>*.rw.mdb.yandexcloud.net<\/code>) \u2014 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0441\u0443\u043c\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0441\u0435\u0441\u0441\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u043a \u0437\u0430\u043f\u0438\u0441\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c &#171;\u0437\u0434\u043e\u0440\u043e\u0432\u043e\u0433\u043e&#187; \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043d\u0430\u0439\u0442\u0438 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e &#171;\u0433\u043e\u0442\u043e\u0432 \u043a \u0437\u0430\u043f\u0438\u0441\u0438&#187; \u0438\u0437-\u0437\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u0438, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0435\u0433\u043e \u043b\u043e\u0433\u0438\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438\u00a0<code>target_session_attrs=primary<\/code>: \u042d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u044f\u043c\u043e\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0438 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c.\u00a0<code>libpq<\/code>\u00a0\u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u0442\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0433\u043b\u0430\u0432\u043d\u044b\u043c (primary). \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u043e\u043d \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u043e\u043b\u044c\u00a0<code>primary<\/code>. \u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043d\u0438\u043c, \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e, \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>INSERT<\/code>,\u00a0<code>UPDATE<\/code>,\u00a0<code>DELETE<\/code>), \u043e\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442 \u0421\u0423\u0411\u0414 PostgreSQL, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u043d\u0430 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0443 \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. \u041a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u044b\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u043c \u0437\u0434\u0435\u0441\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0441\u0435\u0440\u0432\u0438\u0441) \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u041e\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043e\u0442 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e) \u0438\u043b\u0438 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c\u00a0<\/strong><code><strong>target_session_attrs=primary<\/strong><\/code><strong>?<\/strong><\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u00a0<code>target_session_attrs=primary<\/code>\u00a0\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 &#171;\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u043c&#187; \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 (\u0442\u043e \u0435\u0441\u0442\u044c, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c) \u0438 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b (\u043a\u0430\u043a \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0430 \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430) \u0434\u0435\u043b\u0430\u044e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0430\u0436\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043e\u0442 PostgreSQL \u043e \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0435 \u043c\u0435\u0441\u0442\u0430 \u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0437\u0430\u043f\u0438\u0441\u0438, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c &#171;\u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435&#187; \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f), \u0447\u0435\u043c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043b\u043d\u043e\u0439 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c &#171;\u043f\u0438\u0448\u0443\u0449\u0443\u044e&#187; \u0441\u0435\u0441\u0441\u0438\u044e \u0447\u0435\u0440\u0435\u0437\u00a0<code>read-write<\/code>\u00a0\u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u0441 \u0411\u0414 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0442\u043e\u00a0<code>primary<\/code>\u00a0\u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c,\u00a0<code>target_session_attrs=primary<\/code>\u00a0\u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u0443\u0437\u043b\u0443, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0449\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430). \u042d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 \u043d\u0435\u0433\u043e \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u043c \u0438 \u043e\u0441\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044b\u043c \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0421\u0423\u0411\u0414.<\/p>\n<h4>\u0412\u044b\u0432\u043e\u0434<\/h4>\n<p>\u041a\u0430\u043a \u043c\u044b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u00a0<code>target_session_attrs<\/code>\u00a0\u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c\u00a0<code>read-write<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u044b\u043c \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438 PostgreSQL \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0433\u043b\u0430\u0434\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043c\u0430\u0441\u0442\u0435\u0440\u0430.<\/p>\n<p><strong>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u00a0<\/strong><code><strong>target_session_attrs=read-write<\/strong><\/code><strong>:<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u0423\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u043a \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043c\u0430\u0441\u0442\u0435\u0440\u0430<\/strong>: \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0441\u0442\u0435\u0440-\u0443\u0437\u0435\u043b, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044f \u043e\u0448\u0438\u0431\u043a\u0438 &#171;read-only transaction&#187; \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u0423\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong>: \u041d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0438\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0421\u0423\u0411\u0414.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0443\u043b\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<\/strong>: \u041f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 (master) \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f\u00a0<code>target_session_attrs<\/code>\u00a0\u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442:<\/p>\n<ul>\n<li>\n<p><code>any<\/code>\u00a0(\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e): \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443. \u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438, \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p><code>read-only<\/code>: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0445\u043e\u0441\u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439. \u041f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><code>primary<\/code>: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443. \u041a\u0430\u043a \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432\u044b\u0448\u0435, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0443\u044e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443, \u0447\u0435\u043c\u00a0<code>read-write<\/code>, \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u0441 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p><code>standby<\/code>: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 (\u0441\u0438\u043d\u043e\u043d\u0438\u043c\u00a0<code>read-only<\/code>).<\/p>\n<\/li>\n<li>\n<p><code>prefer-standby<\/code>: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0435\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0438\u043d\u0430\u0447\u0435 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445 \u043a\u0430\u043a \u0447\u0442\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u0438 \u0437\u0430\u043f\u0438\u0441\u044c,\u00a0<code>target_session_attrs=read-write<\/code>\u00a0\u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0445 \u043c\u0430\u0441\u0442\u0435\u0440\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043a\u0440\u0430\u0439\u043d\u0435 \u0432\u0430\u0436\u043d\u0430 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0442 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043c\u0430\u0441\u0442\u0435\u0440-\u0443\u0437\u0435\u043b \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0430 \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430), \u0442\u043e\u00a0<code>target_session_attrs=primary<\/code>\u00a0\u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c. \u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443\u00a0<code>read-write<\/code>\u00a0\u0438\u00a0<code>primary<\/code>\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0432 \u0442\u0430\u043a\u0438\u0445 \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c PostgreSQL,\u00a0<strong>\u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043c\u0435\u0436\u0434\u0443\u00a0<\/strong><code><strong>target_session_attrs=read-write<\/strong><\/code><strong>\u00a0\u0438\u00a0<\/strong><code><strong>target_session_attrs=primary<\/strong><\/code>\u00a0\u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u043d\u0438\u043c\u0430\u044f \u0438\u0445 \u043d\u044e\u0430\u043d\u0441\u044b. \u042d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435, \u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434:\u00a0<a href=\"https:\/\/github.com\/patsevanton\/yacloud-golang-pg-switch-test\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/patsevanton\/yacloud-golang-pg-switch-test<\/a><\/p>\n<h3>Telegram \u043a\u0430\u043d\u0430\u043b:<\/h3>\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043c\u043e\u0439 telegram \u043a\u0430\u043d\u0430\u043b\u00a0<a href=\"https:\/\/t.me\/notes_devops_engineer\" rel=\"noopener noreferrer nofollow\">https:\/\/t.me\/notes_devops_engineer<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/910508\/\"> https:\/\/habr.com\/ru\/articles\/910508\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438 PostgreSQL, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e (High Availability, HA), \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 &#171;cannot execute INSERT in a read-only transaction&#187;. \u042d\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439 (read-only). \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043e\u0441\u0442\u0440\u043e \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u0430: \u043f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u044b \u043a \u0431\u044b\u0432\u0448\u0435\u043c\u0443 \u043c\u0430\u0441\u0442\u0435\u0440\u0443, \u0441\u0442\u0430\u0432\u0448\u0435\u043c\u0443 \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439, \u0438\u043b\u0438 \u0436\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043a \u0440\u0435\u043f\u043b\u0438\u043a\u0435.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b PostgreSQL \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2013 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u00a0<code>target_session_attrs<\/code>. \u0412 \u0432\u0435\u0440\u0441\u0438\u0438 PostgreSQL 14 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f target_session_attrs: read-only, primary, standby \u0438 prefer-standby. \u042d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0441\u0435\u0441\u0441\u0438\u044e \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>read-write<\/code>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u043e, \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a\u00a0<code>target_session_attrs=read-write<\/code>\u00a0\u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u00a0<code>target_session_attrs=primary<\/code>, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0435\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442\u00a0<code>read-write<\/code>, \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: \u043a\u043b\u0430\u0441\u0442\u0435\u0440 PostgreSQL \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0435<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 PostgreSQL \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0435. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043b\u0435\u0433\u043a\u043e \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Terraform.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434 Terraform (<a href=\"http:\/\/main.tf\" rel=\"noopener noreferrer nofollow\"><code>main.tf<\/code><\/a>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 PostgreSQL \u0441 \u0442\u0440\u0435\u043c\u044f \u0445\u043e\u0441\u0442\u0430\u043c\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u043e\u043d\u0430\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0441\u0435\u0442\u0438, \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>resource \"yandex_mdb_postgresql_cluster\" \"my_cluster\" {   name        = \"ha\"   environment = \"PRESTABLE\"   network_id  = yandex_vpc_network.foo.id    config {     version = 16     resources {       resource_preset_id = \"s2.micro\"       disk_type_id       = \"network-ssd\"       disk_size          = 16     }   }    host {     zone      = \"ru-central1-a\"     subnet_id = yandex_vpc_subnet.baz.id     assign_public_ip = true   }    host {     zone      = \"ru-central1-b\"     subnet_id = yandex_vpc_subnet.foo.id     assign_public_ip = true   }    host {     zone      = \"ru-central1-d\"     subnet_id = yandex_vpc_subnet.bar.id     assign_public_ip = true   }    timeouts {     create = \"1h30m\" # \u041f\u043e\u043b\u0442\u043e\u0440\u0430 \u0447\u0430\u0441\u0430     update = \"2h\"    # 2 \u0447\u0430\u0441\u0430     delete = \"1h\"   # 30 \u043c\u0438\u043d\u0443\u0442   } }  resource \"yandex_mdb_postgresql_user\" \"my_user\" {   cluster_id = yandex_mdb_postgresql_cluster.my_cluster.id   name       = \"test\"   password   = \"\" # \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043a PostgreSQL   conn_limit = 50 }  resource \"yandex_mdb_postgresql_database\" \"my_db\" {   cluster_id = yandex_mdb_postgresql_cluster.my_cluster.id   name       = \"testdb\"   owner      = yandex_mdb_postgresql_user.my_user.name  }  resource \"yandex_vpc_network\" \"foo\" {}  resource \"yandex_vpc_subnet\" \"foo\" {   zone           = \"ru-central1-b\"   network_id     = yandex_vpc_network.foo.id   v4_cidr_blocks = [\"10.1.0.0\/24\"] }  resource \"yandex_vpc_subnet\" \"bar\" {   zone           = \"ru-central1-d\"   network_id     = yandex_vpc_network.foo.id   v4_cidr_blocks = [\"10.2.0.0\/24\"] }  resource \"yandex_vpc_subnet\" \"baz\" {   zone           = \"ru-central1-a\"   network_id     = yandex_vpc_network.foo.id   v4_cidr_blocks = [\"10.3.0.0\/24\"] }  output \"cluster_fqdn\" {   description = \"FQDN for the PostgreSQL cluster\"   value       = \"c-${yandex_mdb_postgresql_cluster.my_cluster.id}.rw.mdb.yandexcloud.net\" }  output \"hosts_fqdns\" {   description = \"FQDNs of all cluster hosts\"   value       = [     for host in yandex_mdb_postgresql_cluster.my_cluster.host : host.fqdn   ] }  resource \"local_file\" \"env_file\" {   filename = \"${path.module}\/.env\"   content  = &lt;&lt;EOT PG_HOST=c-${yandex_mdb_postgresql_cluster.my_cluster.id}.rw.mdb.yandexcloud.net PG_PORT=6432 PG_USER=${yandex_mdb_postgresql_user.my_user.name} PG_PASSWORD=${yandex_mdb_postgresql_user.my_user.password} PG_DB=${yandex_mdb_postgresql_database.my_db.name} POOL_MAX_CONNS=2 POOL_MIN_CONNS=2 POOL_MAX_CONN_LIFETIME=1h POOL_MAX_CONN_IDLE_TIME=30m DEFAULT_QUERY_EXEC_MODE=simple_protocol TARGET_SESSION_ATTRS=any EOT } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u042d\u0442\u043e\u0442 Terraform-\u043a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0441\u0442:<\/p>\n<ul>\n<li>\n<p>VPC (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u043e\u0431\u043b\u0430\u043a\u043e) \u0438 \u0442\u0440\u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u043e\u043d\u0430\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 (<code>ru-central1-a<\/code>,\u00a0<code>ru-central1-b<\/code>,\u00a0<code>ru-central1-d<\/code>).<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0430\u0441\u0442\u0435\u0440 Managed Service for PostgreSQL \u0441 \u0442\u0440\u0435\u043c\u044f \u0445\u043e\u0441\u0442\u0430\u043c\u0438 (\u043e\u0434\u0438\u043d \u043c\u0430\u0441\u0442\u0435\u0440 \u0438 \u0434\u0432\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0438), \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u044d\u0442\u0438\u043c \u0437\u043e\u043d\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e PostgreSQL 16 \u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b (<code>s2.micro<\/code>, 16 \u0413\u0411 SSD) \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00a0<code>test<\/code>\u00a0\u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0<code>testdb<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0444\u0430\u0439\u043b\u00a0<code>.env<\/code>\u00a0\u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<code>TARGET_SESSION_ATTRS<\/code>\u00a0\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u00a0<code>any<\/code>. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e Terraform-\u043a\u043e\u0434\u0430 (<code>terraform apply<\/code>) \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 PostgreSQL.<\/p>\n<h4>\u0412\u044b\u0431\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: Go<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u044f\u0437\u044b\u043a Go (Golang). Go \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u044d\u043a\u0435\u043d\u0434-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043c\u043e\u0449\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0438\u043c\u0435\u0435\u0442 \u0437\u0440\u0435\u043b\u044b\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 PostgreSQL, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<code>pgx<\/code>.<\/p>\n<p>\u041d\u0430\u0448\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (<code>main.go<\/code>) \u0431\u0443\u0434\u0435\u0442 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043b\u043e\u0433\u0438\u0440\u0443\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0443\u043b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u0443\u0437\u043b\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>package main  import ( \"context\" \"fmt\" \"log\" \"net\" \"os\" \"strings\" \"time\"  \"github.com\/joho\/godotenv\" \"github.com\/jackc\/pgx\/v5\/pgconn\" \"github.com\/jackc\/pgx\/v5\/pgxpool\" \"github.com\/jackc\/pgx\/v5\/stdlib\" \"github.com\/jmoiron\/sqlx\" )  func main() { if err := godotenv.Load(); err != nil { log.Println(\"Warning: no .env file found, trying to read env from system\") }  ctx := context.TODO()  connString := buildConnStringFromEnv() log.Println(connString)  db, pool, err := GetDB(ctx, connString) if err != nil { log.Fatal(err) }  log.Println(\"Connected!!\")  if _, err := db.Exec(`create table if not exists test (    id bigint GENERATED BY DEFAULT AS IDENTITY primary key,    created_at timestamptz not null  )`); err != nil { log.Fatalf(\"unable to create table: %v\\n\", err) }  for { result, err := db.Exec( `insert into \"test\" (\"created_at\") values ($1)`, time.Now())  if err != nil { connInfo := GetConnectionInfo(ctx, pool) pgErr, ok := err.(*pgconn.PgError) if ok { log.Printf(\"DB Error [%s] %s (Code: %s): %s\", connInfo, pgErr.Message, pgErr.Code, err) } else { log.Printf(\"DB Error [%s]: %s\", connInfo, err) } time.Sleep(1 * time.Second) continue }  connInfo := GetConnectionInfo(ctx, pool) rowsAffected, _ := result.RowsAffected() log.Printf(\"Successful [%s]: rows affected: %d\", connInfo, rowsAffected) time.Sleep(1 * time.Second) } }  func buildConnStringFromEnv() string { user := os.Getenv(\"PG_USER\") password := os.Getenv(\"PG_PASSWORD\") host := os.Getenv(\"PG_HOST\") port := os.Getenv(\"PG_PORT\") db := os.Getenv(\"PG_DB\")  poolMaxConns := os.Getenv(\"POOL_MAX_CONNS\") poolMinConns := os.Getenv(\"POOL_MIN_CONNS\") poolMaxConnLifetime := os.Getenv(\"POOL_MAX_CONN_LIFETIME\") poolMaxConnIdleTime := os.Getenv(\"POOL_MAX_CONN_IDLE_TIME\") defaultQueryExecMode := os.Getenv(\"DEFAULT_QUERY_EXEC_MODE\") targetSessionAttrs := os.Getenv(\"TARGET_SESSION_ATTRS\")  connString := fmt.Sprintf( \"postgres:\/\/%s:%s@%s:%s\/%s?pool_max_conns=%s&amp;pool_min_conns=%s&amp;pool_max_conn_lifetime=%s\" + \"&amp;pool_max_conn_idle_time=%s&amp;default_query_exec_mode=%s&amp;target_session_attrs=%s\", user, password, host, port, db, poolMaxConns, poolMinConns, poolMaxConnLifetime, poolMaxConnIdleTime, defaultQueryExecMode, targetSessionAttrs, )  return connString }  func GetConnectionInfo(ctx context.Context, pool *pgxpool.Pool) string { var connInfo strings.Builder stat := pool.Stat() connInfo.WriteString(fmt.Sprintf(\"Pool total: %d, acquired: %d, idle: %d | \", stat.TotalConns(), stat.AcquiredConns(), stat.IdleConns()))  conn, err := pool.Acquire(ctx) if err != nil { return connInfo.String() + \"Failed to acquire connection\" } defer conn.Release()  remoteAddr := conn.Conn().PgConn().Conn().RemoteAddr().String() host, _, _ := net.SplitHostPort(remoteAddr)  var readOnly bool err = conn.QueryRow(ctx, \"SELECT pg_is_in_recovery()\").Scan(&amp;readOnly) if err != nil { connInfo.WriteString(fmt.Sprintf(\"IP: %s, Error getting read-only status\", host)) return connInfo.String() }  serverType := \"Master\" if readOnly { serverType = \"Replica\" }  connInfo.WriteString(fmt.Sprintf(\"IP: %s, Type: %s\", host, serverType)) return connInfo.String() }  func GetDB(ctx context.Context, uri string) (*sqlx.DB, *pgxpool.Pool, error) { DB, pool, err := PgxCreateDB(ctx, uri) if err != nil { return nil, nil, err } return DB, pool, nil }  func PgxCreateDB(ctx context.Context, uri string) (*sqlx.DB, *pgxpool.Pool, error) { connConfig, err := pgxpool.ParseConfig(uri) if err != nil { return nil, nil, fmt.Errorf(\"failed to parse connection config: %w\", err) }  pool, err := pgxpool.NewWithConfig(ctx, connConfig) if err != nil { return nil, nil, fmt.Errorf(\"failed to create connection pool: %w\", err) }  if err := pool.Ping(ctx); err != nil { return nil, nil, fmt.Errorf(\"failed to ping DB: %w\", err) }  pgxdb := stdlib.OpenDBFromPool(pool) return sqlx.NewDb(pgxdb, \"pgx\"), pool, nil }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u0434\u0435\u00a0<code>main.go<\/code>:<\/p>\n<ol>\n<li>\n<p><strong>\u0421\u0431\u043e\u0440\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/strong>: \u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>buildConnStringFromEnv<\/code>\u00a0\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437\u00a0<code>.env<\/code>\u00a0\u0444\u0430\u0439\u043b\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e Terraform) \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u00a0<code>target_session_attrs<\/code>\u00a0\u0442\u0430\u043a\u0436\u0435 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438<\/strong>: \u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>GetConnectionInfo<\/code>\u00a0\u043f\u0435\u0440<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-460101","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/460101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=460101"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/460101\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=460101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=460101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=460101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}