标签: azure-postgresql

在连接到 Postgres 方面,Node 比 .NET Core 快 20 倍

我有两台服务器连接到PostgresSQL 9.6Azure 上托管的数据库。服务器正在做一件事 -SELECT 1每 5 秒通过查询访问Postgres 数据库。

连接到数据库并获取数据的典型时间:

  • 节点: 25 MS
  • .NET Core 3.1 使用 Npsql 4.1.1(我也尝试过 4.1.2,没有差异): 500 MS

我的问题是我的 .NET Core 应用程序在获取数据方面比 Node慢 20 倍。我相信.NET Core 由于某种原因没有汇集连接。这种缓慢发生在本地运行应用程序和在 Azure 应用程序服务上运行它时 - 没有区别。我想解决 .NET --> Postgres 缓慢的问题。

请只浏览相关细节,不要在这一点上阅读整个内容 - 我相信只有.NET Core代码是相关的。

APsPing到我的机器上的数据库(应用程序Node.NET Core应用程序都在其上运行:

Connecting to foobarPostGres:5432 (warmup): from someIp: 19.98ms
Connecting to foobarPostGres:5432: from someIp: 1.65ms
Connecting to foobarPostGres:5432 from …
Run Code Online (Sandbox Code Playgroud)

c# postgresql azure npgsql azure-postgresql

7
推荐指数
1
解决办法
1232
查看次数

ADF-Postgres 超时

我正在使用 ADF 和 Azure 托管 Postgres。我遇到了一个反复出现的问题,即查找和源自查询的复制活动在大约 35 秒后超时。

Failure happened on 'Source' side. 'Type=Npgsql.NpgsqlException,Message=Exception while reading from stream,Source=Npgsql,''Type=System.IO.IOException,Message=Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.,Source=System,''Type=System.Net.Sockets.SocketException,Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond,Source=System,' …
Run Code Online (Sandbox Code Playgroud)

postgresql azure-data-factory azure-postgresql

6
推荐指数
2
解决办法
4120
查看次数

当我收到超时错误时,如何将 Azure postgres 数据库连接到 pgadmin

我已经在 postgreSQL 的 Azure 数据库中创建了一个数据库,但是当我尝试通过 pgadmin 连接时,它说无法连接超时已过期(我很确定管理员和密码是正确的)。有人面临这个问题吗?pgadmin 有替代方案吗?

在此输入图像描述

java postgresql azure pgadmin azure-postgresql

4
推荐指数
1
解决办法
7879
查看次数

org.postgresql.util.PSQLException:SSL 错误:从 Azure Databricks 写入 Azure Postgres Citus 时收到致命警报:handshake_failure

我正在尝试将 pyspark 数据帧写入 Azure Postgres Citus(超大规模)。我正在使用最新的 Postgres JDBC 驱动程序,并尝试在 Databricks Runtime 7、6、5 上编写。

df.write.format("jdbc").option("url","jdbc:postgresql://<HOST>:5432/citus?user=citus&password=<PWD>&sslmode=require" ).option("dbTable", table_name).mode(method).save()

这是运行上述命令后得到的结果 org.postgresql.util.PSQLException: SSL error: Received fatal alert: handshake_failure

我已经尝试过 URL 中的不同参数,也尝试过该选项,但到目前为止还没有运气。但是,我可以使用本地计算机连接到此实例,并使用 psycopg2 在 databricks 驱动程序/笔记本上连接到此实例。Azure Postgres Citus 和 Databricks 都位于同一区域,并且 Azure Postgres Citus 是公共的。

azure apache-spark pyspark azure-postgresql azure-databricks

3
推荐指数
1
解决办法
6117
查看次数

在 Azure 灵活 PostgeSQL 上安装 pg_cron

我正在尝试为 Azure PostgreSQL 灵活服务器安装 pg-cron 扩展。根据此处找到的文档: https: //learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-extensions#postgres-13-extensions pg_cron 是可用的扩展,但是当我尝试安装它时:

create schema cron_pg;
CREATE EXTENSION pg_cron SCHEMA cron_pg;
Run Code Online (Sandbox Code Playgroud)

我得到的是:

SQL Error [0A000]: ERROR: extension "pg_cron" is not allow-listed for "azure_pg_admin" users in Azure Database for PostgreSQL
  Hint: to see the full allow list of extensions, please run: "show azure.extensions;"
Run Code Online (Sandbox Code Playgroud)

执行时:

show azure.extensions;
Run Code Online (Sandbox Code Playgroud)

pg_cron 丢失:

address_standardizer,address_standardizer_data_us,amcheck,bloom,btree_gin,btree_gist,citext,cube,dblink,dict_int,dict_xsyn,earthdistance,fuzzystrmatch,hstore,intagg,intarray,isn,lo,ltree,pageinspect,pg_buffercache,pg_freespacemap,pg_partman,pg_prewarm,pg_stat_statements,pg_trgm,pg_visibility,pgaudit,pgcrypto,pgrowlocks,pglogical,pgstattuple,plpgsql,postgis,postgis_sfcgal,postgis_tiger_geocoder,postgis_topology,postgres_fdw,sslinfo,tablefunc,tsm_system_rows,tsm_system_time,unaccent,uuid-ossp,lo,postgis_raster
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

azure-postgresql pg-cron

3
推荐指数
1
解决办法
5472
查看次数

通过 CLI 重置 Azure PostgreSQL 服务器用户密码

如何通过 CLI 更改/重置 Azure Postgresql 服务器中用户的密码。我知道有一种方法可以通过 Portal 重置密码,但我正在寻找通过 Azure CLI 重置的方法。

我尝试过ALTER USER {user} WITH PASSWORD '{password}';,但它需要超级用户访问权限。据我所知,没有授予 azure_superuser 访问权限,那么有什么方法可以通过 CLI 重置?

postgresql azure azure-sql-database azure-postgresql

2
推荐指数
1
解决办法
2805
查看次数