Received: from nh.newgen.co.in ([203.195.148.19]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8E9fd789007 for ; Fri, 14 Sep 2001 05:41:47 -0400 (EDT) (envelope-from advid@newgen.co.in) Received: from advid (ws103.newgen.co.in [192.168.5.103]) by nh.newgen.co.in (8.9.3/8.8.7) with SMTP id PAA13265; Fri, 14 Sep 2001 15:04:47 +0530 Message-ID: <001201c13d00$cd84c790$6705a8c0@advid> From: "Advid@newgen" To: Cc: Subject: Urgent: How to set autocommit off in postgres......... Date: Fri, 14 Sep 2001 15:06:59 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Archive-Number: 200109/79 X-Sequence-Number: 4726 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