BUG #17313: Exception by opening and closing connection

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: lareomerlin(at)gmail(dot)com
Subject: BUG #17313: Exception by opening and closing connection
Date: 2021-12-03 15:33:02
Message-ID: 17313-126b96cc43774971@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17313
Logged by: José Antonio Lareo Domínguez
Email address: lareomerlin(at)gmail(dot)com
PostgreSQL version: 13.0
Operating system: Windows Server 2012
Description:

Hello,

I have the following exception by opening and closing a connection:

AccessViolationException bei
System.Data.Common.UnsafeNativeMethods.SQLDriverConnectW

I tested the code with multiple OS from Microsoft without problems except in
this particular version.

The operation system is up-to-date, and I tried different versions of the
odbc driver without success. By disabling the connection pooling seems to
avoid the error.
The driver that is causing the exception is the ANSI driver, by using the
Unicode driver the code is running fine.

The following code is a simple example I did to reproduce the error (C#):

========================================================
string connectionString = "Driver={PostgreSQL};Server=IP
address;Port=5432;Database=myDataBase;Uid=myUsername;Pwd=myPassword";

while (true)
{
using (OdbcConnection conn = new OdbcConnection())
{
Console.WriteLine("Opening connection");
conn.ConnectionString = connectionString;
conn.Open();
Thread.Sleep(100);
conn.Close();
Console.WriteLine("Closing connection");
Thread.Sleep(100);
}
}
=========================================

If you need futher information just contact me
Thank you.

Browse pgsql-bugs by date

  From Date Subject
Next Message Francisco Olarte 2021-12-03 16:48:23 Re: BUG #17311: Google search results: Outdated docs at the top
Previous Message Chinh Nguyen 2021-12-03 15:06:23 Re: BUG #17305: to_timestamp accept dates rejected by timestamptz cast