Jonathan Foy | 7 Apr 2010 21:57
Picon

Acucobol, ODBC and Postgres

Hello

I'm trying to configure the postgres odbc driver with our Acucobol application (5.2 and 8.1), and was hoping that someone out there might have some experience with this.

The application currently connects to our postgres databases (8.1.3 up to 8.4.2) without issue.  The problem came up when I started trying to use pgbouncer.  I had it up and running from the command line, but connections coming from the application are rejected due to a "bad packet header", which seems to be because the connect packets are coming in with V2 in the data, and pgbouncer only supports V3.  So, we downloaded the latest driver, compiled it (RHEL 5.4), and (in theory) recompiled cobol with the new library (libodbcpsql.so.2.0.0) linked in.  There was no apparent change.

The application can still parse the odbc.ini file to get the database name, server, port, user, and password, but any additional settings seem to be ignored.  I can't get any logging, I can't set the Protocol version...I'm not convinced that the proper driver is being used.

Does anyone have any ideas?  Pulling my hair out...

Korry Douglas | 7 Apr 2010 22:06
Favicon

Re: Acucobol, ODBC and Postgres

> I'm trying to configure the postgres odbc driver with our Acucobol  
> application (5.2 and 8.1), and was hoping that someone out there  
> might have some experience with this.
>
> The application currently connects to our postgres databases (8.1.3  
> up to 8.4.2) without issue.  The problem came up when I started  
> trying to use pgbouncer.  I had it up and running from the command  
> line, but connections coming from the application are rejected due  
> to a "bad packet header", which seems to be because the connect  
> packets are coming in with V2 in the data, and pgbouncer only  
> supports V3.  So, we downloaded the latest driver, compiled it (RHEL  
> 5.4), and (in theory) recompiled cobol with the new library  
> (libodbcpsql.so.2.0.0) linked in.  There was no apparent change.
>
> The application can still parse the odbc.ini file to get the  
> database name, server, port, user, and password, but any additional  
> settings seem to be ignored.  I can't get any logging, I can't set  
> the Protocol version...I'm not convinced that the proper driver is  
> being used.
>
> Does anyone have any ideas?  Pulling my hair out...

I would start by running strace on your application while it is trying  
to connect.  When I've run into kind of problem that you describe,  
I've found that the ODBC Driver Manager is reading the wrong odbc.ini  
file (for example, reading from /etc/odbc.ini when I expected /usr/ 
local/etc/odbc.ini).

Just run:

	$ strace -o /tmp/myapp.trc <your application name goes here>

Then look through the /tmp/myapp.trc file, searching for attempts to  
open odbc.ini, odbcinst.ini, and the libodbcpsql.so library.

			-- Korry

-----------------------------------------------------------------------
Korry Douglas
Senior Database Dude
EnterpriseDB Corporation
The Enterprise Postgres Company

Phone: (804)241-4301
Mobile: (620) EDB-NERD

--

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Jonah H. Harris | 7 Apr 2010 22:14
Picon
Gravatar

Re: Acucobol, ODBC and Postgres

On Wed, Apr 7, 2010 at 3:27 PM, Jonathan Foy <thefoy <at> gmail.com> wrote:
I'm trying to configure the postgres odbc driver with our Acucobol application (5.2 and 8.1), and was hoping that someone out there might have some experience with this.

About two years ago I was working on a project which used Postgres via ODBC with both ACUCOBOL and Micro Focus.  Which ODBC driver are you using?  You should try ODBCng (https://projects.commandprompt.com/public/odbcng/).

Also, you may want to try/consider using the commercial PG ODBC driver from DataDirect (http://www.datadirect.com/products/odbc/odbc-postgresql/index.ssp).

--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
Jonah H. Harris | 7 Apr 2010 22:15
Picon
Gravatar

Re: Acucobol, ODBC and Postgres

On Wed, Apr 7, 2010 at 3:36 PM, Korry Douglas <korry.douglas <at> enterprisedb.com> wrote:
I'm trying to configure the postgres odbc driver with our Acucobol application (5.2 and 8.1), and was hoping that someone out there might have some experience with this.

The application currently connects to our postgres databases (8.1.3 up to 8.4.2) without issue.  The problem came up when I started trying to use pgbouncer.  I had it up and running from the command line, but connections coming from the application are rejected due to a "bad packet header", which seems to be because the connect packets are coming in with V2 in the data, and pgbouncer only supports V3.  So, we downloaded the latest driver, compiled it (RHEL 5.4), and (in theory) recompiled cobol with the new library (libodbcpsql.so.2.0.0) linked in.  There was no apparent change.

The application can still parse the odbc.ini file to get the database name, server, port, user, and password, but any additional settings seem to be ignored.  I can't get any logging, I can't set the Protocol version...I'm not convinced that the proper driver is being used.

Does anyone have any ideas?  Pulling my hair out...

I would start by running strace on your application while it is trying to connect.  When I've run into kind of problem that you describe, I've found that the ODBC Driver Manager is reading the wrong odbc.ini file (for example, reading from /etc/odbc.ini when I expected /usr/local/etc/odbc.ini).

Yeah, I like to explicitly define my ODBCINI and ODBCINST environment variables to avoid that issue.

--
Jonah H. Harris
Blog: http://www.oracle-internals.com/
Jonathan Foy | 7 Apr 2010 22:55
Picon

Re: Acucobol, ODBC and Postgres

The application is actually launched from a windows box via a thin client...I'm not sure how I would run it with strace.

However, I'm fairly sure I'm pulling in the correct one, if I change the port it fails, as it should.  Switch it back and it works. Of all the odbc entries on the system (from a root level search for both odbc.ini and .odbc.ini), only the one has this database entry in it at all.  And it WILL connect, just not do what I want it to.


On Wed, Apr 7, 2010 at 4:06 PM, Korry Douglas <korry.douglas <at> enterprisedb.com> wrote:
I'm trying to configure the postgres odbc driver with our Acucobol application (5.2 and 8.1), and was hoping that someone out there might have some experience with this.

The application currently connects to our postgres databases (8.1.3 up to 8.4.2) without issue.  The problem came up when I started trying to use pgbouncer.  I had it up and running from the command line, but connections coming from the application are rejected due to a "bad packet header", which seems to be because the connect packets are coming in with V2 in the data, and pgbouncer only supports V3.  So, we downloaded the latest driver, compiled it (RHEL 5.4), and (in theory) recompiled cobol with the new library (libodbcpsql.so.2.0.0) linked in.  There was no apparent change.

The application can still parse the odbc.ini file to get the database name, server, port, user, and password, but any additional settings seem to be ignored.  I can't get any logging, I can't set the Protocol version...I'm not convinced that the proper driver is being used.

Does anyone have any ideas?  Pulling my hair out...

I would start by running strace on your application while it is trying to connect.  When I've run into kind of problem that you describe, I've found that the ODBC Driver Manager is reading the wrong odbc.ini file (for example, reading from /etc/odbc.ini when I expected /usr/local/etc/odbc.ini).

Just run:

       $ strace -o /tmp/myapp.trc <your application name goes here>

Then look through the /tmp/myapp.trc file, searching for attempts to open odbc.ini, odbcinst.ini, and the libodbcpsql.so library.

                       -- Korry




-----------------------------------------------------------------------
Korry Douglas
Senior Database Dude
EnterpriseDB Corporation
The Enterprise Postgres Company

Phone: (804)241-4301
Mobile: (620) EDB-NERD



Jonathan Foy | 7 Apr 2010 23:05
Picon

Re: Acucobol, ODBC and Postgres

I'm using (or think I am) the latest psqlODBC download from the postgresql website.  8.04.0200.  It was compiled and then linked into runcbl via the ACUSQL_ODBC_LIB variable, which then gets passed up the chain, in the Makefile (for runcbl).  Is this not the correct way to do it?

I'm under the impression that I'm bypassing unixODBC, but I am fairly new with this (cobol/odbc).  So I could be wrong.

ODBCng is no longer being developed, I'm not sure that that's the route I want to take for the future.  And convincing Higher Ups to go the commercial route would be difficult...

On Wed, Apr 7, 2010 at 4:14 PM, Jonah H. Harris <jonah.harris <at> gmail.com> wrote:
On Wed, Apr 7, 2010 at 3:27 PM, Jonathan Foy <thefoy <at> gmail.com> wrote:
I'm trying to configure the postgres odbc driver with our Acucobol application (5.2 and 8.1), and was hoping that someone out there might have some experience with this.

About two years ago I was working on a project which used Postgres via ODBC with both ACUCOBOL and Micro Focus.  Which ODBC driver are you using?  You should try ODBCng (https://projects.commandprompt.com/public/odbcng/).

Also, you may want to try/consider using the commercial PG ODBC driver from DataDirect (http://www.datadirect.com/products/odbc/odbc-postgresql/index.ssp).

--
Jonah H. Harris
Blog: http://www.oracle-internals.com/

Picon
Favicon

Regarding sinsle quotes

Hi support team,

We are using postgre 8.1.5 version.

And postgreODBC driver 8.1.200.

When we try to insert ‘’ into DB its inserting as \’\’. Can you help on this issue?

 

Can we install latest version ODBC driver for postgre 8.1.5 version?

 

Regards

Goutham J

DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. -----------------------------------------------------------------------------------------------------------------------
Anand | 8 Apr 2010 16:35
Picon

Postgres Driver

Hi All,
 
I need Postgres driver on unix host. My Informatica is hosted on unix system.
 
Do I need to instal PostgreSQL client or Postgres server or psqlodbc driver is enough?
 
Thanks,
Anand P.S
Mark Simonetti | 12 Apr 2010 20:25
Picon

Deallocation speed

Hi,
I'm currently working on a c++ project that uses the psqlodbc driver.

I have a query that returns over 26000 rows, and about 45 columns.

When it comes to closing the statement using SQLFreeStmt(hstmt, 
SQL_CLOSE), the command seems to take about 70 seconds to return (on a 
3.16ghz processor!).   This just doesn't seem right.  Is there something 
I may be missing?

I thought I'd ask first before I posted more details incase it is 
something obvious.

Thanks,

Mark.

--

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Ken Sell | 12 Apr 2010 23:13
Favicon

Re: Postgres Driver

Hi,

Informatica uses the DataDirect ODBC driver manager. You’ll need a postgres ODBC that
is compiled with that driver’s headers.

When you refer to a “Postgres server” do you mean the database? If so, you do not
have to have it on the same machine as your Informatica server.

...Ken Sell



On 4/8/10 6:35 AM, "Anand" <anand.satyanarayana <at> gmail.com> wrote:

Hi All,
 
I need Postgres driver on unix host. My Informatica is hosted on unix system.
 
Do I need to instal PostgreSQL client or Postgres server or psqlodbc driver is enough?
 
Thanks,
Anand P.S


Gmane