pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
commit inside plpgsql function
2+ messages / 2 participants
[nested] [flat]

* commit inside plpgsql function
@ 2004-12-21 17:21 Dennis Sacks <dennis@illusions.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Dennis Sacks @ 2004-12-21 17:21 UTC (permalink / raw)
  To: pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: commit inside plpgsql function
@ 2004-12-24 22:18 Gregory S. Williamson <gsw@globexplorer.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Gregory S. Williamson @ 2004-12-24 22:18 UTC (permalink / raw)
  To: Dennis Sacks <dennis@illusions.com>; pgsql-sql


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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-12-24 22:18 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-21 17:21 commit inside plpgsql function Dennis Sacks <dennis@illusions.com>
2004-12-24 22:18 Re: commit inside plpgsql function Gregory S. Williamson <gsw@globexplorer.com>

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