Urgent: How to set autocommit off in postgres.........

From: "Advid(at)newgen" <advid(at)newgen(dot)co(dot)in>
To: <fede(at)link(dot)it>
Cc: <ajoppich(at)usa(dot)net>
Subject: Urgent: How to set autocommit off in postgres.........
Date: 2001-09-14 09:36:59
Message-ID: 001201c13d00$cd84c790$6705a8c0@advid
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi ,

I read one of solution to andreas problem of how to set autocommit off but
my problem still persists. I am basically writing a function in plpgsql
language which performs a number of update and insert statements but on a
failing condition it rollbacks inorder to maintain integrity in the
database. I have tried using the following code :

create function abc() returns char as'
begin
....
begin work;
insert into mytable values(1);
// pseudo code
if (conditions fails) then
rollback work;
end work;
...
..
end;
' language 'plpgsql';

But this code fails miserably by not executing without errors since
autocommit is on.Moreover I could not find ~/.psqlrc (or /etc/psqlrc).
I am using Red Hat Linux 7.1 and Postgres 7.1.2. I badly in need of help as
my deadline closes by to submit my project. Hope u would consider this as
SOS call from ur friend.

Waiting in anticipation of early reply,

Regards,
Advid Parmar
New Delhi, India

Browse pgsql-sql by date

  From Date Subject
Next Message Richard NAGY 2001-09-14 10:11:41 SQL request change when upgrade from 7.0.2 to 7.1.3
Previous Message Kevin Way 2001-09-14 06:30:07 Re: trigger trouble -- procedure not found