PostgreSQL EndTransactionBlock and not inprogress/abort state

Started by Manuel Lemosabout 27 years ago3 messagesgeneral
Jump to latest
#1Manuel Lemos
mlemos@acm.org

Hello,

I am trying to use transactions with PostgreSQL with the normal sequence

BEGIN
one or more SELECT/INSERT/UPDATE/DELETE queries
COMMIT
END

But I am getting the following message just like if I haven't started a
transaction when I commit.

EndTransactionBlock and not inprogress/abort state

Anybody experienced anything like this with PostgreSQL 6.4.2?

Regards,
Manuel Lemos

E-mail: mlemos@acm.org
URL: http://www.e-na.net/the_author.html
PGP key: finger://mlemos@zeus.ci.ua.pt
--

#2Clark Evans
clark.evans@manhattanproject.com
In reply to: Manuel Lemos (#1)
Re: [GENERAL] PostgreSQL EndTransactionBlock and not inprogress/abort state

Manuel Lemos wrote:

Hello,

I am trying to use transactions with PostgreSQL with the normal sequence

BEGIN
one or more SELECT/INSERT/UPDATE/DELETE queries
COMMIT
END

But I am getting the following message just like if I haven't started a
transaction when I commit.

EndTransactionBlock and not inprogress/abort state

I could be wrong, but the END isn't necessary.

BEGIN
....
COMMIT;

<or>

BEGIN
....
ROLLBACK;

Hope this helps,

Clark

#3Clark Evans
clark.evans@manhattanproject.com
In reply to: Manuel Lemos (#1)
Re: [GENERAL] PostgreSQL EndTransactionBlock and not inprogress/abort state

Clark Evans wrote:

Manuel Lemos wrote:

Hello,

I am trying to use transactions with PostgreSQL with the normal sequence

BEGIN
one or more SELECT/INSERT/UPDATE/DELETE queries
COMMIT
END

But I am getting the following message just like if I haven't started a
transaction when I commit.

EndTransactionBlock and not inprogress/abort state

Oops! forgot the semicolon. *whap*

BEGIN;

....
COMMIT;

<or>

BEGIN;

....
ROLLBACK;

BTW, are you putting on the "END" beacuse you are in a
PL/pgsql block? If so, I'm not sure if transactions
can work inside this language. Hmm.

Clark