dbTalk Databases Forums  

[BUGS] Pb with ecpg and include file on PG 8.0.0

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Pb with ecpg and include file on PG 8.0.0 in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Valerie Schneider DSI/DEV
 
Posts: n/a

Default [BUGS] Pb with ecpg and include file on PG 8.0.0 - 09-10-2004 , 11:39 PM






Hi,

I have a set of libraries and C/C++ programs with embedded access to
a PG database. I'm using ecpg. I'm working on a Linux RedHat9 platform.

Until now I was in PG 7.4.2 :
[clipg@li SrcLib]$ ecpg --version
ecpg (PostgreSQL 7.4.2) 3.1.1
[clipg@li SrcLib]$ g++ --version
g++ (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.

and without any problem.

I installed PG 8.0.0beta2 :
[clipg@li SrcLib]$ ecpg --version
ecpg (PostgreSQL 8.0.0beta2) 3.2.0

And if I try to recompile I find pre-compiled errors, variables which
are defined in an include file are not "seen".
Is there any known problem or bug about this ?

Detail :
======= Precompiling DbTablesFk.pgc =======

ecpg DbTablesFk.pgc -I/VALE/users/clipg/Server/Include -o DbTablesFk.cc
DbTablesFk.pgc:144: ERROR: trying to access an undeclared cursor MAX_FK

DbTablesFk.pgc:144: ERROR: syntax error at or near "IN"


and in the program :
....
EXEC SQL INCLUDE DbTablesUtilPg.hh;
....

EXEC SQL PREPARE S FROM :sqlstmt;
EXEC SQL DECLARE C_FK_COL CURSOR FOR S;
EXEC SQL OPEN C_FK_COL;
EXEC SQL FETCH MAX_FK IN C_FK_COL INTO :fk_id_L , :valid_L, :target_t_L;

with MAX_FK a variable defined in the file
/VALE/users/clipg/Server/Include/DbTablesUtilPg.hh :
exec sql define MAX_FK 100;

If I replace the MAX_FK variable by its value it's OK.
If I define the MAX_FK variable directly in the program (and not
in an include file) it's OK.

Any idea ? Thanks for all, Valerie.


--


************************************************** ******************
* Les points de vue exprimes sont strictement personnels et *
* n'engagent pas la responsabilite de METEO-FRANCE. *
************************************************** ******************
* Valerie SCHNEIDER Tel : +33 (0)5 61 07 81 91 *
* METEO-FRANCE / DSI/DEV Fax : +33 (0)5 61 07 81 09 *
* 42, avenue G. Coriolis Email : Valerie.Schneider (AT) meteo (DOT) fr *
* 31057 TOULOUSE Cedex - FRANCE http://www.meteo.fr *
************************************************** ******************

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

Reply With Quote
  #2  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] Pb with ecpg and include file on PG 8.0.0 - 09-11-2004 , 02:16 AM






Valerie Schneider DSI/DEV wrote:
Quote:
...
EXEC SQL INCLUDE DbTablesUtilPg.hh;
...

EXEC SQL PREPARE S FROM :sqlstmt;
EXEC SQL DECLARE C_FK_COL CURSOR FOR S;
EXEC SQL OPEN C_FK_COL;
EXEC SQL FETCH MAX_FK IN C_FK_COL INTO :fk_id_L , :valid_L, :target_t_L;

with MAX_FK a variable defined in the file
/VALE/users/clipg/Server/Include/DbTablesUtilPg.hh :
exec sql define MAX_FK 100;
^

I think your problem is the semicolon.

--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #3  
Old   
Michael Meskes
 
Posts: n/a

Default Re: [BUGS] Pb with ecpg and include file on PG 8.0.0 - 09-12-2004 , 04:12 AM



I received this bug report and will take care of it as soon as I find
time. Since I am travelling next week to give PostgreSQL training, this
will take at least a week or so.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes (AT) jabber (DOT) org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply With Quote
  #4  
Old   
Michael Meskes
 
Posts: n/a

Default Re: [BUGS] Pb with ecpg and include file on PG 8.0.0 - 09-14-2004 , 03:16 AM



On Fri, Sep 10, 2004 at 08:09:55AM +0000, Valerie Schneider DSI/DEV wrote:
Quote:
I installed PG 8.0.0beta2 :
[clipg@li SrcLib]$ ecpg --version
ecpg (PostgreSQL 8.0.0beta2) 3.2.0
This works nicely for me with ecpg 3.2.0. It may be that ecpg
does not find the include file. But then it should also print that.

I had the file in "." where ecpg found it and the constant was correctly
translated.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes (AT) jabber (DOT) org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
  #5  
Old   
Michael Meskes
 
Posts: n/a

Default Re: [BUGS] Pb with ecpg and include file on PG 8.0.0 - 09-14-2004 , 06:38 AM



On Tue, Sep 14, 2004 at 08:35:52AM +0000, Valerie Schneider DSI/DEV wrote:
Quote:
But why ecpg found it in the 7.4 version ?
I'm not even sure this is the reason. Could you please try moving the
file to "." to see if it works?

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes (AT) jabber (DOT) org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
  #6  
Old   
Valerie Schneider DSI/DEV
 
Posts: n/a

Default Re: [BUGS] Pb with ecpg and include file on PG 8.0.0 - 09-15-2004 , 11:17 PM




Quote:
Date: Tue, 14 Sep 2004 09:27:41 +0200
From: Michael Meskes <meskes (AT) postgresql (DOT) org
To: Valerie Schneider DSI/DEV <valerie.schneider (AT) meteo (DOT) fr
Cc: pgsql-bugs (AT) postgresql (DOT) org
Subject: Re: [BUGS] Pb with ecpg and include file on PG 8.0.0
Mime-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040722i
X-Provags-ID: kundenserver.de abuse (AT) kundenserver (DOT) de
auth:da5cff6069dd6897c77170232368d0ba

On Fri, Sep 10, 2004 at 08:09:55AM +0000, Valerie Schneider DSI/DEV wrote:
I installed PG 8.0.0beta2 :
[clipg@li SrcLib]$ ecpg --version
ecpg (PostgreSQL 8.0.0beta2) 3.2.0

This works nicely for me with ecpg 3.2.0. It may be that ecpg
does not find the include file. But then it should also print that.
But why ecpg found it in the 7.4 version ?
Following a remark I removed the semi-colon at the end of each
exec sql define xxxxxx
(I had : exec sql define xxxxxx ; )
in the include file. No result.

Someone from the pgsql-fr-generale list seems to have the same problem.

Thanks for your reply, Valerie.


Quote:
I had the file in "." where ecpg found it and the constant was correctly
translated.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes (AT) jabber (DOT) org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!


************************************************** ******************
* Les points de vue exprimes sont strictement personnels et *
* n'engagent pas la responsabilite de METEO-FRANCE. *
************************************************** ******************
* Valerie SCHNEIDER Tel : +33 (0)5 61 07 81 91 *
* METEO-FRANCE / DSI/DEV Fax : +33 (0)5 61 07 81 09 *
* 42, avenue G. Coriolis Email : Valerie.Schneider (AT) meteo (DOT) fr *
* 31057 TOULOUSE Cedex - FRANCE http://www.meteo.fr *
************************************************** ******************


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.