pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Lyons <fusion@storytotell.org>
To: pgsql-bugs@postgresql.org
Subject: BUG #5969: ecpg can't see sqlca
Date: Fri, 8 Apr 2011 22:47:32 GMT
Message-ID: <201104082247.p38MlWot030910@wwwmaster.postgresql.org> (raw)


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 <stdlib.h>
#include <stdio.h>

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.



view thread (2+ messages)  latest in thread

Message-ID: <201104082247.p38MlWot030910@wwwmaster.postgresql.org>
Permalink:  ../201104082247.p38MlWot030910@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201104082247.p38MlWot030910@wwwmaster.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: fusion@storytotell.org
  Subject: Re: BUG #5969: ecpg can't see sqlca
  In-Reply-To: <201104082247.p38MlWot030910@wwwmaster.postgresql.org>
  References: <201104082247.p38MlWot030910@wwwmaster.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox