New patch, typo fix in pgc.l. According to our customer who is porting their application to PostgreSQL, this causes an error currently in ECPG:
======================================== 1. within included structures the use of "$else;" is causing an precompiler error (tested several times in different programs) /home/progs/fors_neu/share/include/bwltrec.h:124: ERROR: syntax error at or near ";" Example: mainprog.ec: EXEC SQL BEGIN DECLARE SECTION; EXEC SQL INCLUDE share/include/bwltrec.h; /* record bwlt */ EXEC SQL END DECLARE SECTION; bwltrec.h: struct record_type_bwlt { int firmnr; /* Firmennummer (2,0) */ int liwerk; /* Werk - Lieferant (2,0) */ ... $ifdef FORS3; string besktr[7]; /* Kostentraeger */ $else; string besktr[13]; /* Kostentraeger */ $endif; } bwlt; ======================================== It looks to me that "EXEC SQL else;" is expected in the native syntax, but "$else" (without ";" at the end of the line) is expected in compat mode. Considering that the ";" seems to be expected by esql, this must be a typo in ecpg/preproc/pgc.l Best regards, Zoltán Böszörményi -- Bible has answers for everything. Proof: "But let your communication be, Yea, yea; Nay, nay: for whatsoever is more than these cometh of evil." (Matthew 5:37) - basics of digital technology. "May your kingdom come" - superficial description of plate tectonics ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH http://www.postgresql.at/
diff -dcrpN pgsql.locktimeout/src/interfaces/ecpg/preproc/pgc.l pgsql.ifdef/src/interfaces/ecpg/preproc/pgc.l *** pgsql.locktimeout/src/interfaces/ecpg/preproc/pgc.l 2009-09-03 13:57:48.000000000 +0200 --- pgsql.ifdef/src/interfaces/ecpg/preproc/pgc.l 2009-09-08 11:47:05.000000000 +0200 *************** cppline {space}*#(.*\\{space})*.*{newl *** 1000,1006 **** BEGIN(xskip); } } ! <C,xskip>{informix_special}{else}{space}* { /* are we simulating Informix? */ if (INFORMIX_MODE) { --- 1000,1006 ---- BEGIN(xskip); } } ! <C,xskip>{informix_special}{else}{space}*";" { /* are we simulating Informix? */ if (INFORMIX_MODE) {
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers