high cpu on idle state

Sorry to bother if my question is irrelevant
but I really would like to understand why
idle persistent connection would take more than 25% of a cpu

top -c

63844 postgres  20   0 4677440 289168 287320 S  33.9  0.9   0:03.43
postgres: freeswitch freeswitch idle
62774 postgres  20   0 4677480 286488 284636 S  29.9  0.9   1:22.17
postgres: freeswitch freeswitch idle
 4901 postgres  20   0 4677480 280812 278968 S  27.6  0.9   2:43.71
postgres: freeswitch freeswitch idle
 4847 postgres  20   0 4677480 279468 277624 S  24.9  0.8   2:35.25



I noticed high cpu usage with idle connections using

psqlodbc last git version:

10793 postgres  20   0 4677484 329672 327772 S  29.2  1.0 2:21.43
postgres: freeswitch freeswitch idle
12708 postgres  20   0 4677508 323524 321652 S  27.6  1.0 0:49.71
postgres: freeswitch freeswitch idle
12725 postgres  20   0 4677508 329232 327360 R  24.9  1.0 0:52.27
postgres: freeswitch freeswitch SELECT

3 nodes are connected through VPN with tinc, freeswitch is a voip server
that establishes permanent connection.

any idea?

Fedora 26 64bits


32-bit odbc source compilation failed

We hope this message finds you well.
We are looking for a 32-bit compatible ODBC driver for RedHat Linux 7.4 64 -bit version for connecting 32-bit application to a 32- bit Data Source.
We downloaded the driver 'psqlodbc-10.02.0000.tar.gz' from the URL <a href=";umid=76FF58ED-6C26-0805-A753-765F80188BA7&amp;auth=ec34f7633709e8bd85e48c7fc0c92c09c079e558-e50cc6da79abab78c719160d67495dc9ce4fc6f9" title=";umid=76FF58ED-6C26-0805-A753-765F80188BA7&amp;auth=ec34f7633709e8bd85e48c7fc0c92c09c079e558-e50cc6da79abab78c719160d67495dc9ce4fc6f9"></a> released on 30-03-2018.

When we try to compile it,which failed with below error.

Build with Oracle Solaris Studio


the small patch attached makes psqlodbc buildable using Oracle Solaris
Studio (tested with version 12.3).


Bug report: x64 Row status Array uses wrong data type


Thank you for psq odbc driver!

I've found an issue with 64 bit driver.
The array returned from fetch for row statuses uses 16 bit values
instead of 64 bit values.

Tested on x64 Windows (7, 10, srv2012 and srv2016)
with 64 bit psqlodbc-09.06.0500 (Unicode and ANSI)
Client is set ODBC version 2

Changing SQLUSMALLINT to SQLSETPOSIROW in descriptor.h
for two structs and in the code handling these structs fixed the issue.
Code in psqlodbc-10.02.0000 is the same for these parts.

struct IRDFields_
StatementClass *stmt;

Problem with ODBC class

Hi, ALL,
Is there a reason why following function returns empty string?

SQLHSTMT stmt = 0;
SQLHDBC hdbc = 0;
int result = 0;
SQLLEN cbTableName = SQL_NTS, cbSchemaName = SQL_NTS;
SQLWCHAR *table_name = NULL, *schema_name = NULL, *qry = NULL;
std::wstring query;
if( pimpl->m_subtype == L"PostgreSQL" )
query = L"SELECT u.usename FROM pg_class c, pg_user u,
pg_namespace n WHERE n.oid = c.relnamespace AND u.usesysid =
c.relowner AND n.nspname = ?

ODBC 2.0 Bug: wrong timestamp data type


I used the latest driver version
If your application uses ODBC version 2.0. When you
call SQLGetTypeInfo, the driver reports supported data
types that are not available for version 2.0. The first
iteration of the result of this function for the timestamp
data type is SQL_TYPE_TIMESTAMP. If you then call
SQLBindParameter, ODBC Manager returns s1003 (SQL1).log).
The error could be corrected (SQL2.log).

bigint disparity between two installations

I have a database on PostgreSQL 9.3 that I am accessing using psqlodbc
version on a couple of different Windows machines.

I have some bigint fields that are truncated on only one of the machines.
I have called both of their odbc setups up and compared them screen by
screen a few times and they are setup the same.

A value that is stored in the database is: -40581311272
This value is read correctly on two of the machines, but is returned as
-405813112 on the third.

Registering DSN with odbcconf.exe overwrites the connection attributes with defaults

With the following command, the SSLmode of the DSN is defaults to disable,
even the "prefer" option is provided in the connection attributes.

odbcconf.exe /A {CONFIGDSN "PostgreSQL Unicode(x64)"

During the configDSN, first the connection attributes are parsed in
ParseAttributes function and later all the values are replaced with
defaults using getCiAllDefaults.

ODBC - psqlodbc-7.2.3


I am not sure when i compiler the source using make, it failed. it worked fine when in execute the configure command.

I can't use the latest release. it does not work for me on the Solaris 10.

root@m# ./configure

checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets ${MAKE}... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for C compiler default output...

Deadlock when executing multiple select statements from multiple threads


We are having a deadlock issue when executing multiple select statements from multiple threads, the issue happens with driver version ( or newer, doesn't happen on .
I've attached a simple project that triggers the deadlock, tested with visual studio 2017, release x64 build, PostgreSQL 10.3, usually happens after few runs.[please note that the proper database connection string and the table names need to be provided in the code for it to work].
I've also included the stack trace of the two threads in deadlock.


Re: [ANNOUNCE] psqlODBC 09.06.0500 Released


Vedi allegato e di confermare.

Grazie e a presto,


Sebastiano SchiaviDirettore Generaleseba. ... at sixs dot it SIxS - Soluzioni Informatiche per il SocialeVia Sant'Antonino 41 - Vaiano Cremasco (CR)Tel.0373 386177 – Fax 0373 380216Cell. Informativa privacy: Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservati e sono comunque destinati esclusivamente alle persone o alla Società sopraindicati e non sono da considerarsi comunicazioni personali.

SSL connection string documentation

Example of pqopt on 3rd screen: sslroot=c:\\root.crt
Example of pappy in connection string:
Could you please post drove me crazy trying to figure it out.

psqlODBC 10.02.0000 Released

Hi, all.

We are pleased to annouce the release of psqlODBC 10.02.0000.
please see the notes at:
<a href="" title=""></a>

psqlODBC may be downloaded from in source, Windows Installer,
merge module, and basic zip file formats.

New Windows installer installs both 32-bit and 64-bit driver at once
on 64-bit OS.

Postgres Foreign Data Wrapper and DB2 LUW

Is there a web page describing how to set up a PG FDW to talk to DB2 LUW ver 10.5 ?


Compilation fails with XLC in AIX


I am compiling PostgreSQL ODBC driver 10.01.0000 in AIX using XLC compiler.
Compilation fails with the following error.

ld: 0711-317 ERROR: Undefined symbol: .getExeName
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
Makefile:573: recipe for target '' failed
gmake[1]: *** [] Error 8
gmake[1]: Leaving directory
Makefile:479: recipe for target 'all' failed
gmake: *** [all] Error 2

getExeName is no more there after this commit "Move the implemetation of
GetExeName() from psqlodbc.c(psq

Lost Data Connection

I have been successfully using the following PostgreSQL connection string in multiple Excel 2010 vba applications running on 64 bit Windows 7 systems. I have moved to a Window 10 system and my application will randomly lose its connection to the DSN. It may take 5000 calls one time and then 400 calls the next. I am using a Unicode driver. I wrote a sample program that makes the same call in a loop. The code will randomly fail on Window 10 and run flawlessly on Window 7.

ODBC embedded Postgres


We have an embedded Postgres database installed along with Vcenter Vmware
app. We wanted to connect it with ODBC connection, Is it possible? If yes,
what version of ODBC i need to install and are there any changes we will
need to make on Postgres SQL side?


Hello, psqlODBC team.

When we fetch large data via psqlodbc, we sometimes fail to
get all rows completely without any API's error responses;
SQLExecDirect returns SQL_SUCCESS and SQLFetch returns just SQL_NODATA.
But there are QR_REALLOC_error reported in mylog at that time.

I reproduced it by tweaking QR_REALLOC_return_with_error macro
to intentionally fail to allocate memory frequently.

DBLink problem between Oracle and PostGreSQL

Dear all,

I'm not sure if it is the correct address to send this king of request,
but we are currently struggling with a problem between Oracle and
PostGreSQL, passing through ODBC, so I take my change.
The situation is the following:
. On Oracle side:
 - Windows Server 2012 R2
 - Oracle 11g r2 (

. On PostGreSQL:
 - PostgreSQL 9.4.13
 - No details on servers or configuration, we don't have access to this.

. ODBC PostGreSQL Drivers

=> The problem is the following:
. We are currently unable to use a DBLink from Oracle to PostGreSQL, via

help with downloading postgres server and client

I downloaded downloaded installer from this site (
<a href="" title=""></a>) but this is not what I want
or it came with a whole bunch of other plugging that I don't need. All I
need a server and pgadmin. I also tried to download the binary files but I
have no luck.

could you please point me the right direction?

SQLError SqlState wrong when postgres backend dies


The SQLError function is returning the last statement level SqlState value if called after the postgres backend dies.

For exampel, if prior to the death of the postgres backend the last SQL statement that had an error returned an SqlState="23505"(due to a unique index problem) then after the postgres backend dies the next SQL statement will fail and SQLError returns:-

NativeError=26 SqlState="23505" ErrorMsg=Could not send Query(connection dead)

So ErrorMsg is correct but SqlState is not.

I was using psqlodbc-09.05.0400 but repeated my test with 10.01.0000 and got the same result.

PostgreSQL) How to use Bind Variable with ODBC Driver V10?


I hope my email finds you well. 

I am developing query tool for PostgreSQL using ODBC Driver (recent release ODBC v10).

The product that I am developing uses the SQLDescribeParam() function before the query SQLExec() when using Bind Variable. 

SQLDescribeParam () function normally works on 'psqlodbc_09_06_0500-x86', when using Bind Variable. 

However, in 'psqlodbc_10_00_0000-x86' and later versions, error occurs and Bind Variable cannot be used. 

Normal queries that do not use the SQLDescribeParam () function work fine. 

For your reference, below is the example of the query that

NUMERIC type makes trouble in MS Access

Hi there,

I'm experiencing problems with the ODBC driver on Windows 7 (and 10)
on 32 and 64 bit in Microsoft Access 2003, 2010 and 2016 (32, 64 bit).

My PostgreSQL server runs on Debian (64-bit): 9.6.7-1.pgdg80+1
Tested ODBC drivers: psqlodbc_09_06_0500 & psqlodbc_10_01_0000

Summary of the problem:
The current behavior of the ODBC driver creates an error in Access,
since the incoming values are longer than the field type. This leads
into a truncation warning (with many messageboxes) and no values
are shown at all.

Patch for an encoding bug in the derive_locale_encoding function


I've found a bug while I was working with the driver.

ODBC - Retrieving info messages - RAISE NOTICE


When executing a PL/pgsql query using powershell with ODBC (yes, a somehow special setup), it is possible to register to the event "InfoMessage" (with Register-ObjectEvent) to retrieve all messages that are created for example by using "RAISE NOTICE".
While this works fine when using MS SQL and the SqlConnection (all print statements are retrieved), it does not work with Postgres and the OdbcConnection, here, only the last message ("3") is retrieved, when a statement like
DO $$
is executed.

Maybe this is a general constraint wh

statement timeout with psqlODBC 09.05.300+


This ticket is related to
<a href="" title=""></a>

The client using the ODBC Driver is on Windows 7, must be x86 compatible,
and connect to a 9.6 postgresql database.
from 09.05.300+ version of the ODBC driver x86 (tested up to 10.01), queries
which used to work fine with drivers 08.x now throw "ERROR: canceling
statement due to statement timeout;"

It seems that there is now a default setting for statement timeout coming
with 9.5+ versions of the driver (less than 1 mn), and I did not find any
way to change this settin

Bug in is_setting_search_path


I have found a bug in the is_setting_search_path function (connection.c line 1597).

The search loop is currently:

for (; *q; q++)
if (IS_NOT_SPACE(*q))
if (strnicmp(q, "search_path", 11) == 0)
return TRUE;
while (IS_NOT_SPACE(*q))

The inner while(IS_NOT_SPACE(*q)) loop will terminate if a null is reached.

RE: psqlODBC 10.01.0000 Released -- what about 9.6.6?


I can see that the 09.06.0500 driver disappeared from <a href="" title=""></a>
Will it be back? Will there be an update for PostgreSQL 9.6.6?

psqlODBC 10.01.0000 Released

Hi, all.

We are pleased to annouce the release of psqlODBC 10.01.0000.
please see the notes at:
<a href="" title=""></a>

psqlODBC may be downloaded from in source, Windows Installer,
merge module, and basic zip file formats.

New Windows installer installs both 32-bit and 64-bit driver at once
on 64-bit OS.

Memory leak when using SQLParamData and SQLPutData


When executing a prepared insert statement and using SQL_DATA_AT_EXEC parameters that will be sent with SQLParamData and SQLPutData, the driver will leak memory for parameters. The memory will not be deallocated not even the handles are freed and the program disconnects from the database.

I am attaching a small project to demonstrate the bug. You can also browse the project at <a href="" title=""></a>


MS Access adds always actual day in time defined postgres column


We are moving BackEnd tables from a large MS Access application to postgresql.

In one table we have a field "Zeit" defined in postgres as

time(0) without time zone DEFAULT ('now'::text)::time(0) without time zone,

The linked table inside Access shows the actual day in front of the time value. Using the 24-hour format for displaying time values in Access looks fine.

Migration to PGLister - After


This list has now been migrated to new mailing list software known as

Migration to pglister - Before


We will be migrating these lists to pglister in the next few minutes.

This final email on the old list system is intended to let you know
that future emails will have different headers and you will need to
adjust your filters.

The changes which we expect to be most significant to users can be found
on the wiki here: <a href="" title=""></a>

Once the migration of these lists is complete, an 'after' email will be
sent out.



BUG: odbc statement_timeout gets set to 30000

Hi All

I've found a problem with at least the 906 and 1000 odbc driver, in that, no
matter what statement_timeout is set to, after initially connecting and
setting the value to that specified in the connection settings, it is then
subsequently set to 30000.

This means that queries running longer than 30seconds are failing, which is
a major problem.

session_timeout being set to 30000 bug

Hi All

OK,I've been trying out the later odbc drivers, 906 and 1000.

Trying to replicate from MS 2008 R2 to PostgreSQL

I have a project where I am trying to replicate some tables from a MS2008 SQL database to a PostgreSQL database. I have created a Linked Server using the PostgreSQL ANSI driver and the connection tests successfully. But when I try to create a subscription using that Linked Server, I cannot connect successfully to it. I was wondering if you might have some insights into possible avenues of research for this problem.

Problem with ODBC v.10


We use msaccess that connects to postgresql database with your ODBC driver

With the new version 10.0, something does not work anymore :

When we create a new record in a table with the dao method tb.addnew

Then we want to get the Autonumber generated, we used to add tb.update
and tb.Bookmark=tb.LastModified and then we were able to get the
tb!MyAutoNumberField value

Now this does not wok anymore and we get The record is deleted

(note that with MSAccess database we can get the autonumber before the

I saw that you have changed things with Identity...

SQL ODBC interface developer opportunity in Livermore CA

SQL ODBC Interface Developer position

Convergence CT (<a href="" title=""></a>) is a global health information company founded in 2001 and based in Honolulu Hawaii with the goal of connecting technologies to manage and use big data to the benefit of patients, healthcare providers, researchers, and life science companies. CCT has implemented over 27 clinical data warehouse systems for 76 hospitals and medical groups in Japan, Taiwan, China, Canada and the United States.

psqlODBC 10.00.0000 Released

Hi, all.

We are pleased to annouce the release of psqlODBC 10.00.0000.
please see the notes at:
<a href="" title=""></a>

psqlODBC may be downloaded from in source, Windows Installer,
merge module, and basic zip file formats.

New Windows installer installs both 32-bit and 64-bit driver at once
on 64-bit OS.

error with $ in names again


I think there’s still a bug in parsing names with dollars.

Linux RHEL66


create table T$001 (…) ok

create table T_$001 (…) ok


create table T$001 (…) ok

create table T_$001 (…) error

Here is session log for that:

$ test_odbc 0 'T$001'

Connection: DSN=PGDriver;UseServerSidePrepare=0

Returned connection string was: …;UseDeclareFetch=0;…;Parse=0;…;UseServerSidePrepare=1;LowerCaseIdentifier=0;

Exec: create table T$001 (i integer)


$ test_odbc 1 'T$001'

Connection: DSN=PGDriver;UseServer

please advise


I'm new to postgresql but would like to be a database developer.

What's the best way to join postgresql team as a volunteer?

ODBC driver for Postgres Installation error

I will be really grateful if you can guide me on how to install and use Postgres ODBC Driver for Windows 64 system.

I have downloaded psqlodbc_09_06_0500-x64.msi from from <a href="" title=""></a> . Unfortunately, after finishing up all the installation at last step of registering the product, the installation package runs into error and rolls back everything.
The message says "The Installer has encountered an unexpected error installing this package. This may indicate a problem with this package.

JDBC ZonedDateTime problem


I am using PostgreSQL 9.3.19 on a 64 bit Linux box with
postgresql-42.1.4.jar and 64 bit Java 8.

I am doing setObject with and I get:

org.postgresql.util.PSQLException: Can't infer the SQL type to use for an
instance of java.time.ZonedDateTime. Use setObject() with an explicit Types
value to specify the type to use.

What I am trying to do is set the column to the current datetime UTC.

Any help would sure be appreciated!

Blake McBride

ODBC binary downloads -- SHA256sums?

Trying to figure out how to validate my downloads.

postgresql install odbc driver


Centos 7.0
install 9.2 driver psqlodbc-09.02.0100.tar.gz

checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for library containing SQLGetPrivateProfileString...

install ODBC driver


install 9.5 driver

install 9.2 driver


互联网ITS集团,流通线.行业BU 魏磊
地址:陕西省 西安市 雁塔区 天谷八路 中软基地

ODBC connectin string for Postgres db needed


Is this a good contact to obtain the connection string to a Postgres database? We would like to connect to Postgres from Cognos 10.2 /Framework Manager.

Thanks so much in advance for any assistance that you can bring us.

Challenge Accepted!

Gonzalo Ordonez
HRIS Administrator
SOS International LLC
1881 Campus Commons Drive, Suite 500
Reston, VA 20191
o. 703.391.9680, ext. 1051 | d. 703.774.1836 | f.

Severe bug in SQLPrimaryKeys function in psqlODBC 09.06.0500


there seems to be a new bug in the SQLPrimaryKeys function - e.g.

Error Notification

Dear Support,

Most recent version of PostgreSQL ODBC Driver that we are using it for GreenPlum v is throwing error when character varying <255 within the linked SQL Server.

ODBC for Linux/RHEL - no 9.6.5 binary build yet?


I’ve been checking <a href="" title=""></a>

and while many components were updated to 9.6.5, the latest ODBC is still


Any plans for updating it?

Thank you.

Georgiy Pruss

psqlODBC 09.06.0500 Released

Hi, all.

We are pleased to annouce the release of psqlODBC 09.06.0500.
This is a some bugfix release.
please see the notes at:
<a href="" title=""></a>

psqlODBC may be downloaded from in source, Windows Installer,
merge module, and basic zip file formats.

New Windows installer installs both 32-bit and 64-bit driver at once
on 64-bit OS.

SQL literal with SJIS hankaku-kana character cause missing escape

Hello, psqlODBC team.

We got a bug.
Its reproduce program and log are attached.

An SQL string that contains string leteral ended odd number of
SJIS hankaku-kana character could cause misssing the next escape.

We haven't fixed it yet.

best regards,
Haruka Takatsuka / SRA OSS, Inc. <a href="" title=""></a>

Compilation failure with nmake since 503bb09

Hi all,

With the latest code of Postgres ODBC, I am seeing compilation
failures of this kind:
c:\Users\ioltas\git\pgodbc\connection.h(27) : fatal error C1083:
Cannot open include file: 'pqexpbuffer.h': No such file or directory

It seems to me that 503bb09 forgot to update win64.mak to include
$(PG_INC)/internal in the paths to scan for headers. Please see
attached a patch.


Bug in PostgreSQL ODBC - in names with dollar


I’m sorry, I really tried to register at pgsql-odbc list at, using different email addresses, but it didn’t’ work.

I saw that you may deal with this problem.

When UseServerSidePrepare is set to 1 (which is default, I guess), any names with $ in them cause error:

“The # of binded parameters < the # of parameter markers”

It’s both on Windows and Linux.

It seems that PG tries to use un-paired ‘$’ symbols as parameter marks for the server-side prepare/execute feature, even if there’s no PREPARE or EXECUTE statements.

I believe, PG should not par

ODBC crash after DB cleanup


We are using PostgreSQL release 9.3.14 and psqlODBC release 09.03.0400 configured over linux based OS. We are encountering an issue in production where we are observing ODBC crash after rehoming(cleanup of database) and BTS sites are going down after this activity.

Q: Is there a way to force psqlODBC with enabled UseDeclareFetch to commit statements and avoid nesting transactions (savepoints)?

Since generated cursors are declared WITH HOLD they would survive COMMIT, and I assume, release resources on the server. I know that this would not be appropriate for all statements!

I am trying to determine if there is a combination of statement attributes or some other settings that would make the ODBC driver operate in such fashion. I was hoping there is some combination of (statement) settings that would tell the driver that we are sending a forward only, read only, statement.

A POSSIBLE BUG: The ODBC standard procedure call ("{ CALL function(param) }") is disallowed in ReadOnly ODBC mode whereas "SELECT * FROM function(param)" is let through.

* A POSSIBLE BUG: The ODBC standard procedure call ("{ CALL function(param) }") is disallowed in ReadOnly ODBC mode whereas "SELECT * FROM function(param)" is let through.

Good morning.

Since the ODBC "{CALL..}" statement is translated to a "SELECT..FROM..." this seems like an error.

-- Regards, Matej.

Segmentation fault of during connect to postgres server


Because i send the email to your organization failed with company server, so i change the server and send the bug description again.

psql odbc expert, recently we met an occasional issue that will be crashed during connect the postgres server. version: psqlodbc-09.05.0400

postgres server version: postgresql-9.6.2

Test step:

1 Start up postgres server

2 Launcher a process which call psqlodbc driver to connect and disconnect postgres server insequential.

3 Fast shutdown the postgres server, however, the client process will crash occasionally.


The will be crashed during connect to postgres server


psql odbc expert, recently we met an occasional issue that will be crashed during connect the postgres server. version: psqlodbc-09.05.0400
postgres server version: postgresql-9.6.2

Test step:
1 Start up postgres server
2 Launcher a process which call psqlodbc driver to connect and disconnect postgres server in sequential.
3 Fast shutdown the postgres server, however, the client process will crash occasionally.

Crash information:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
106 in ../sysdeps/x8

Syndicate content