pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #5969: ecpg can't see sqlca
2+ messages / 2 participants
[nested] [flat]

* BUG #5969: ecpg can't see sqlca
@ 2011-04-08 22:47 Daniel Lyons <fusion@storytotell.org>
  2011-04-09 15:52 ` Re: BUG #5969: ecpg can't see sqlca Michael Meskes <meskes@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Daniel Lyons @ 2011-04-08 22:47 UTC (permalink / raw)
  To: pgsql-bugs


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.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #5969: ecpg can't see sqlca
  2011-04-08 22:47 BUG #5969: ecpg can't see sqlca Daniel Lyons <fusion@storytotell.org>
@ 2011-04-09 15:52 ` Michael Meskes <meskes@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Meskes @ 2011-04-09 15:52 UTC (permalink / raw)
  To: Daniel Lyons <fusion@storytotell.org>; +Cc: pgsql-bugs

On Fri, Apr 08, 2011 at 10:47:32PM +0000, Daniel Lyons wrote:
> 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:

Could you please send me the precompiled version of your test case? Do you have THREAD_SAFETY compiled into PostgreSQL?

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at googlemail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-04-09 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-04-08 22:47 BUG #5969: ecpg can't see sqlca Daniel Lyons <fusion@storytotell.org>
2011-04-09 15:52 ` Michael Meskes <meskes@postgresql.org>

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