Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j5rX5-0006vL-5Q for pgsql-odbc@arkaria.postgresql.org; Sun, 23 Feb 2020 13:42:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j5rX3-0000Xh-5I for pgsql-odbc@arkaria.postgresql.org; Sun, 23 Feb 2020 13:42:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j5dVA-0007EE-OP for pgsql-odbc@lists.postgresql.org; Sat, 22 Feb 2020 22:44:00 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j5dV7-0007Rc-Rm for pgsql-odbc@postgresql.org; Sat, 22 Feb 2020 22:44:00 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 81CD71D05 for ; Sun, 23 Feb 2020 00:43:57 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PWX1J-BXLRfE for ; Sun, 23 Feb 2020 00:43:55 +0200 (EET) Received: from mail.hot.ee (hot-relayhost3.estpak.ee [213.180.2.81]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 0D4FE1D03 for ; Sun, 23 Feb 2020 00:43:55 +0200 (EET) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost3.estpak.ee (Postfix) with ESMTPSA id 48Q3K7022nz2S3 for ; Sun, 23 Feb 2020 00:43:53 +0200 (EET) Message-ID: <00B7D82CD18C4FF2B2F462BA277CADED@dell2> From: "Andrus" To: Subject: How to fix psqlODBC driver regression to get error message details Date: Sun, 23 Feb 2020 00:43:46 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="windows-1257"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! I'm looking for a way to fix psqlODBC driver regression. Starting at psqlODBC 09.05.0100 when psqlODBC driver uses libpq for all operations (earlier versions used libpg only for authentication) ODBC client does not show error message details. For example, users got only generic error message like Connectivity error: ERROR: insert or update on table "mytable" violates foreign key constraint "mytable_myfield_fkey Error message details like Key (myfield)=(mykeyvalue) is not present in table "mymastertable".; are no more returned. How to detailed error message or at least only bad key value "mykeyvalue" which is returned in error message details ? Some ideas: 1. First versions of libpq based ODBC drivers returned same error message "no resource found" for all errors. Hiroshi has fixed it it later versions. Maybe psqlODBC code can fixed to restore pre-libpq behaviour. 2. Maybe analyzing odbc logs from pre and after 09.05.0100 drivers may provide solution. I can provide ODBC log files. 3. psqlODBC allows to pass parameters to libpq from connection string. Maybe some libpq parameter can fix this. 4. Maybe some Postgres query, postgres extension or direct odbc or libpq call can used to return last error message details like Windows API GetLastError() or Unix global errno. 5. Maybe it is possible to to create method which returns error message detals from postgres log file. Postgres 12.2 and latest psqlODBC driver 12.01.0000 are used. psqlODBC is called from Visual FoxPro Andrus. Posted also in https://stackoverflow.com/questions/60357505/how-to-fix-psqlodbc-driver-regression-to-get-error-message-details and in pgsql-general mailist list.