PostgreSQL ODBC: an access violation after about 500 repeats of the same code in a new thread (Reported, not reproduced)

Applies to: reported on Windows 7, Clarion 8.0.9304 ABC, PostgreSQL 9.1 and the ODBC driver from PostgreSQL (driver version not stated).

Problem as reported

A routine run in a new thread (a simple window) worked for a while and then failed with an access violation error box. The code was the same on every pass and it failed after nearly 500 repeats, not the first time. The connection string was Driver=PostgreSQL ODBC Driver(ANSI); server=localhost; UID=Smith; PWD=password; PORT=5432; UseDeclareFetch=1; database=gemini. The database used WIN1252 encoding; the default UTF8 was tried too. The citext extension was installed.

What the thread found

  • A first reply suspected a bad variable definition, such as a variable toggled to a reference variable; the poster had checked several times and found none. A second reply read the pattern as a memory leak or an array overrun.
  • Another poster's connection string used Driver={PostgreSQL ANSI} and UseDeclareFetch=1. On the poster's machine that driver name did not work; the ODBC Administrator listed PostgreSQL ODBC Driver(ANSI) and a UNICODE one. The UNICODE choice made no difference.
  • The driver name changed between ODBC driver versions 8.04.01 and 8.04.02, from PostgreSQL ANSI to PostgreSQL ODBC Driver(ANSI), so the other poster was probably on an older version.
  • Compiling in debug mode with all the checks on, and the special debug runtime, gave only the exception access error.

Caveats

  • The cause was not found in the thread. Nothing points at the driver rather than at the program.

Today (2026)

Not reproduced. This entry records a 2012 report. A reader who can reproduce it on a current build is asked to post the driver version and the loop, or close this entry. The driver-name difference between versions is worth checking first.

Sources: Barton W. (Aug 2012, the question), Joe T., Jon W., Sean H. (Aug 2012) in softvelocity.clarion.databasedrivers.