Re: ecpg error --> DbPg_cre_sect_buf.pgc:1334: ERROR: syntax

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: jason(dot)ctr(dot)alburger(at)faa(dot)gov
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ecpg error --> DbPg_cre_sect_buf.pgc:1334: ERROR: syntax
Date: 2006-02-25 03:57:48
Message-ID: 200602250357.k1P3vm117586@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

jason(dot)ctr(dot)alburger(at)faa(dot)gov wrote:
> I'm relatively new to database programming & I've inherited a system to
> maintain that contains lots of embedded SQL. I'm attempting to port my C
> source code from RH 7.2 (with ecpg 2.8.0) to Mandrake 10.0 (with ecpg
> 4.1.1). ecpg 4.1.1 is generating an error which I did not get on the
> RH7.2 system with ecpg 2.8.0....It's telling me I have a syntax error with
> a "ROLLBACK RELEASE" (DbPg_cre_sect_buf.pgc:1334: ERROR: syntax error at or
> near "RELEASE"). Here's a snippet of the code in error...
> .
> .
> .
> 1320 /* Ignore termination signal (if rcvd) - terminating anyway
> */
> 1321 signal(SIGTERM, SIG_IGN);
> 1322
> 1323 /* send a message to the client that download has
> terminated abnormally */
> 1324 DbgS1(10, DBG_DRW_3, sqlca.sqlerrm.sqlerrmc);
> 1325 DbgI1(10, DBG_DRW_3, -sqlca.sqlcode);
> 1326
> 1327 EXEC SQL WHENEVER SQLERROR CONTINUE;
> 1328 EXEC SQL CLOSE cms_sec_curr;
> 1329
> 1330 if (fpa_curs)
> 1331 {
> 1332 DbPgCC_sector_assign_status ();
> 1333 }
> 1334 EXEC SQL ROLLBACK RELEASE;
> 1335
> 1336 DbgS1(11, DBG_DRW_3,
> 1337 "Closed Connection to the Database Due to Postgres
> Error");

Seems we had shift-reduce problems and had to remove this
Oracle-compatible syntax. In preproc.y I see:

/*
* for compatibility with ORACLE we will also allow the keyword RELEASE
* after a transaction statement to disconnect from the database.
*/

/* We cannot do that anymore since it causes shift/reduce conflicts. */
ECPGRelease: TransactionStmt RELEASE

and we commented out the ECPGRelease state. You can only use:

| RELEASE SAVEPOINT ColId
| RELEASE ColId
| ROLLBACK opt_transaction TO SAVEPOINT ColId
| ROLLBACK opt_transaction TO ColId

Sorry about that.

--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2006-02-25 04:00:56 Re: Fw: ecpg error --> DbPg_cre_sect_buf.pgc:1334: ERROR:
Previous Message Christopher Browne 2006-02-25 03:46:58 Re: Requesting LinuxWorld East staffers