ECPG - Meaning of -400, ECPG_PGSQL?

From: "William West" <wwest(at)csc(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: ECPG - Meaning of -400, ECPG_PGSQL?
Date: 2002-07-31 23:48:48
Message-ID: OFA918392F.6F3DFA30-ON85256C07.007FD504@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Goal is to TRUNCATE table, then DROP table, then
VACUUM (everything) then (re)ADD table as part of
an ECPG application's initialization.

From psql, this strategy works just fine, but not from the
ECPG application.

EXEC SQL VACUUM or EXEC SQL TRUNCATE TABLE
gives ecpg program error -400. The message that comes
with it says two different things:

For VACUUM, it says sqlca -400 with sqlca text reading:

'VACUUM cannot run inside a BEGIN/END block'

For TRUNCATE it says sqlca -400 with sqlca text reading:

'TRUNCATE TABLE cannot run inside a transaction block'

These same messages appear in the server log.

Have tried positioning these statements immediately
after the CONNECT, same result.

Have also tried EXEC SQL COMMIT prior to each,
same result.

What could have begun the block the server has in
effect, if it is immediately after a CONNECT?

Shouldn't a COMMIT end any transactions anyway?

Browse pgsql-interfaces by date

  From Date Subject
Next Message Oliver Elphick 2002-07-31 23:51:48 Re: PGACCESS Error Relative Path @ export table
Previous Message C. Maj 2002-07-31 19:46:47 Re: PGACCESS Error Relative Path @ export table