Skip site navigation (1) Skip section navigation (2)

SQLSTATE not updated in ecpg program.

From: Ken Jennings <ken_jennings(at)bellsouth(dot)net>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: SQLSTATE not updated in ecpg program.
Date: 2006-12-28 04:26:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
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:
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 

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


pgsql-interfaces by date

Next:From: Michael MeskesDate: 2006-12-28 12:34:34
Subject: Re: SQLSTATE not updated in ecpg program.
Previous:From: Michael Talbot-WilsonDate: 2006-12-27 09:34:59
Subject: What happened to guile-pg?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group