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

BUG #5969: ecpg can't see sqlca

From: "Daniel Lyons" <fusion(at)storytotell(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5969: ecpg can't see sqlca
Date: 2011-04-08 22:47:32
Message-ID: 201104082247.p38MlWot030910@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5969
Logged by:          Daniel Lyons
Email address:      fusion(at)storytotell(dot)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.

Responses

pgsql-bugs by date

Next:From: Brendan JurdDate: 2011-04-09 13:20:59
Subject: Re: Failed assert ((data - start) == data_size) in heaptuple.c
Previous:From: ShianmiinDate: 2011-04-08 22:07:43
Subject: Re: PostgreSQL backend process high memory usage issue

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