pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gregory S. Williamson <gsw@globexplorer.com>
To: Dennis Sacks <dennis@illusions.com>
To: pgsql-sql@postgresql.org
Subject: Re: commit inside plpgsql function
Date: Fri, 24 Dec 2004 14:18:42 -0800
Message-ID: <71E37EF6B7DCC1499CEA0316A256832801D4BC74@loki.wc.globexplorer.net> (raw)


Already been answered (by me) -- you can't do this in postgres 7.x or earlier -- procedures may not have begins/commits or rollbacks. Version 8.0 *may* be different -- I don't have it installed yet; it does allow for some nesting of transactions but I don't know if this is allowed. The 8.0 documentation on user defined procedures would probably say.

Greg Williamson
DBA
GlobeXplorer LLC



-----Original Message-----
From:	Dennis Sacks [mailto:dennis@illusions.com]
Sent:	Tue 12/21/2004 9:21 AM
To:	pgsql-sql@postgresql.org
Cc:	
Subject:	[SQL] commit inside plpgsql function
Hi,

I am converting oracle stored procedures to plpgsql. There are several 
of the oracle procedures where a parameter vCommit is passed into the 
procedure and:

if vCommit = 1
    then
        commit;
        do_something_commit(vdate);
    else
        do_something(vdate);
    end if;

does this make sense in plpgsql? Does it make sense to do a commit in 
plpgsql?

Thanks,

Dennis

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match






view thread (2+ messages)

Message-ID: <71E37EF6B7DCC1499CEA0316A256832801D4BC74@loki.wc.globexplorer.net>
Permalink:  ../71E37EF6B7DCC1499CEA0316A256832801D4BC74@loki.wc.globexplorer.net/
Also on:    postgresql.org/message-id/71E37EF6B7DCC1499CEA0316A256832801D4BC74@loki.wc.globexplorer.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: gsw@globexplorer.com, dennis@illusions.com
  Subject: Re: commit inside plpgsql function
  In-Reply-To: <71E37EF6B7DCC1499CEA0316A256832801D4BC74@loki.wc.globexplorer.net>
  References: <71E37EF6B7DCC1499CEA0316A256832801D4BC74@loki.wc.globexplorer.net>

* 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