Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3106A1337CC8 for ; Fri, 8 Apr 2011 20:12:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 04901-01-7 for ; Fri, 8 Apr 2011 23:12:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 726FF1337BDF for ; Fri, 8 Apr 2011 19:47:33 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p38MlWYj030911 for ; Fri, 8 Apr 2011 22:47:32 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p38MlWot030910; Fri, 8 Apr 2011 22:47:32 GMT (envelope-from www) Date: Fri, 8 Apr 2011 22:47:32 GMT Message-Id: <201104082247.p38MlWot030910@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5969: ecpg can't see sqlca From: "Daniel Lyons" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201104/49 X-Sequence-Number: 29968 The following bug has been logged online: Bug reference: 5969 Logged by: Daniel Lyons Email address: fusion@storytotell.org PostgreSQL version: 9.0.3 Operating system: FreeBSD 8.2-RELEASE Description: ecpg can't see sqlca Details: Under the current FreeBSD and the current PostgreSQL, ecpg-processed C programs don't see the sqlca global variable. This wreaks havoc with error handling. For example: #include #include EXEC SQL INCLUDE sqlca; int main() { /* stop on any error */ EXEC SQL WHENEVER SQLERROR STOP; /* connect to a non-existent database */ EXEC SQL CONNECT TO nonexistentdb USER nonexistentuser; /* if we get here, something is wrong. */ printf("I'm still here, even though this database doesn't exist.\n"); return 0; } Same program does the right thing on a Linux machine I have access to, so it may be a platform issue.