Re: "stored procedures" - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: "stored procedures"
Date
Msg-id BANLkTimidZxu823O0iLeiaLuEXfsW8sTzA@mail.gmail.com
Whole thread Raw
In response to Re: "stored procedures"  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, Apr 21, 2011 at 8:34 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Apr 21, 2011, at 3:51 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>> If you do it that (base it on AT) way, then you can't:
>> 1) call any utility command (vacuum, etc)
>> 2) run for an arbitrary amount of time
>> 3) discard any locks (except advisory)
>> 4) deal with serialization isolation/mvcc snapshot issues that plague functions.
>
> It is not obvious to me that you cannot do these things.

yeah...I think I misunderstood what you were saying ("When you enter a
stored procedure at the outermost level, you begin a transaction...").Those restrictions only apply when there is a
opentransaction
 
controlling the context of what is running.  If you are handing the
command textually off to another backend which then runs it, then you
are mostly good...although #2 still might be a problem, and #3 if you
happen to grab any.

merlin


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: fsync reliability
Next
From: Yves Weißig
Date:
Subject: What Index Access Method Functions are really needed?