Transaction Queries!!!

From: Vatsal <vatsal(dot)avasthi(at)wipro(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Transaction Queries!!!
Date: 2003-10-14 10:08:50
Message-ID: 1066126151.31597.25.camel@M3-113824
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi,

We are using postgresql as the underlying RDBMS for one of our
application.
When in a transaction if we execute an query that causes database to
return
a failure. The whole transaction gets roll backed.

Below are 2 examples
which illustrate this problem. We want the rollback to be in control of
the user. And that is why as i understand we have the postgresql
rollback
command.

Examples of implicit rollback:
1>
cpdb=# begin;
BEGIN
cpdb=# insert into abc ('80219');
ERROR: parser: parse error at or near "'"
cpdb=# insert into abc values ('80219');
NOTICE: current transaction is aborted, queries ignored until end of
transaction block
*ABORT STATE*
cpdb=#

2>
cpdb=# begin;
BEGIN
cpdb=# insert into abc values ('-1');
ERROR: ExecAppend: rejected due to CHECK constraint abc_i
cpdb=# insert into abc values ('1');
NOTICE: current transaction is aborted, queries ignored until end of
transaction block
*ABORT STATE*
cpdb=#

A another problem is of executing update query thru ODBC API's. When we
run update query thru executeQuery() API, even though the update query
may
not go thru as some column condition may not have met or the where
clause
may have been wrong. In such case also the API returns success.

When the query is executed thru psql prompt it says zero rows updated.
Has this problem got to do with postgresql or ODBC API?

kindly help!!!

TIA

regards
vatsal

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is
'privileged' and 'confidential' and intended for use only by the individual
or entity to which it is addressed. You are notified that any use, copying
or dissemination of the information contained in the E-MAIL in any manner
whatsoever is strictly prohibited.

***************************************************************************

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Welche 2003-10-14 11:59:22 Re: gborg cvs ?
Previous Message B.W.H. van Beest 2003-10-14 09:53:21 How to list which tables are available?