SQLSTATE not updated in ecpg program. - Mailing list pgsql-interfaces

From Ken Jennings
Subject SQLSTATE not updated in ecpg program.
Date
Msg-id 200612272326.10049.ken_jennings@bellsouth.net
Whole thread Raw
Responses Re: SQLSTATE not updated in ecpg program.  (Michael Meskes <meskes@postgresql.org>)
List pgsql-interfaces
Hello.
I looked at the interfaces, bugs, and general archives for the past month and 
could not find anything similar to the problem I'm having.

I'm having issues with ecpg compiled programs built on several 8.2.0 installs 
I've done (all on suse linux kernel 2.6.13-15.12).  The same program had no 
issues built/run on postgres 8.1.5 on the same computers.  ( I'm not using 
the postgres in the suse distro packages -- I built everything for 8.1.5 and 
8.2.0 from the source on a postgresql ftp mirror. )

In all cases the configure, make, make check, and install all appear to work 
properly.  I'm not having connection issues -- psql works locally and 
connects to remote servers.  pgadminIII on a Windows box also works talking 
to the servers.

A simple test program compiled with ecpg worked fine for 8.1.5
which can be found here: http://www.kenjennings.cc/st/prg/ux/test_pgc.tar.gz
The program does simple error checking using sqlca.sqlstate which the postgres 
docs (31.11.2) suggest is preferable to sqlca.sqlcode.

When rebuilt for 8.2.0 it appears to not work anymore.  After a lot of digging 
and adding extra debugging I discovered that all the EXEC SQL are actually 
executing just fine.  The problem is that the contents of sqlca.sqlstate[5] 
is not changing, and as sqlstate perpetually contains garbage which doesn't 
match "00000" the program thinks everything fails.   sqlca.sqlcode is being 
updated, as are sqlca.sqlerrm.sqlerrml and sqlca.sqlerrm.sqlerrmc[70].

I've done a dozen installs and reinstalls of 8.2.0 on these servers using 
different configuration options over the past few days (and I'm getting 
pretty darned good at it).  Everything seems to install perfectly each time.  
The original configure line used for 8.2.0 for two of the three systems is 
the same as used for 8.1.5:
CONFIGURE = '--with-tcl' '--with-perl' '--with-openssl' 
'--enable-integer-datetimes' '--enable-thread-safety'
One of the systems does not have the --with-openssl option, since it is 
missing a dependency.  Removing the openssl  option from the build on the 
other systems does not change the behavior of ecpg compiled programs on those 
systems.

Does anyone have any idea of something I might be doing wrong with the 
install ?


pgsql-interfaces by date:

Previous
From: Michael Talbot-Wilson
Date:
Subject: What happened to guile-pg?
Next
From: Michael Meskes
Date:
Subject: Re: SQLSTATE not updated in ecpg program.