pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Advid@newgen <advid@newgen.co.in>
To: fede@link.it
Cc: ajoppich@usa.net
Subject: Urgent: How to set autocommit off in postgres.........
Date: Fri, 14 Sep 2001 15:06:59 +0530
Message-ID: <001201c13d00$cd84c790$6705a8c0@advid> (raw)

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




Message-ID: <001201c13d00$cd84c790$6705a8c0@advid>
Permalink:  ../001201c13d00$cd84c790$6705a8c0@advid/
Also on:    postgresql.org/message-id/001201c13d00$cd84c790$6705a8c0@advid

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: advid@newgen.co.in, fede@link.it, ajoppich@usa.net
  Subject: Re: Urgent: How to set autocommit off in postgres.........
  In-Reply-To: <001201c13d00$cd84c790$6705a8c0@advid>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox