atom feed5 messages in org.postgresql.pgsql-interfacesRe: [INTERFACES] Use ecpg
FromSent OnAttachments
Margarita BarvinokJan 28, 1999 7:16 am 
James ThompsonJan 28, 1999 8:36 am 
Michael MeskesJan 28, 1999 10:58 am 
Michael MeskesJan 28, 1999 10:20 pm 
Margarita BarvinokJan 29, 1999 6:38 am 
Subject:Re: [INTERFACES] Use ecpg
From:James Thompson (
Date:Jan 28, 1999 8:36:30 am

On Thu, 28 Jan 1999, Margarita Barvinok wrote:

Hello All,

I just began to use postgresql-6.4.2 and ecpg (version: 2.4.4). I try t precompile simple code ( I took it from a book) and get this error message: prog:17: parse error Perhaps this is stupid error, but I have no idea what to do, because I don't have good manual on Embedded SQL. Can I find somewhere documentation on C-Embedded SQL?

I'm kinda in the same boat. I've been using the Oracle Pro*C precompiler manual. I don't have the URL here at work but I found an online copy using

/* set error handler to bail out if we can't connect */ EXEC SQL WHENEVER SQLERROR { /* LINE 17 */ printError(); return FAILURE; };

I don't think this will work. I think you need to define an action for the ecpg parser. I asked one of the authors about the sqlerror option and here's a snippet from the e-mail I got this morning


interested in the actions to whenever sqlerror. I tried to look in the preproc.y file but I have no idea what I'm looking at. I saw a DO and a CALL but can't find out what they mean.

The following actions are defined:

continue sqlprint stop goto label go to label do break do function(parameter) call function(parameter)


For me, the best documentation has been the test progs bundled in the postgresql distro. From memory the location is


or something like that. There are two test programs and a preformace program.

Hope this helps. I you'd be so kind, mail me and let me know how things work out, I'm working on error handling tonight.