Re: "stored procedures" - use cases?

From: Darren Duncan <darren(at)darrenduncan(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "stored procedures" - use cases?
Date: 2011-04-25 21:28:50
Message-ID: 4DB5E792.4040104@darrenduncan.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Another point, as there appear to be diverging camps about
> supertransactional stored procedures vs. autonomous transactions, what
> would be the actual use cases of any of these features? Let's collect
> some, so we can think of ways to make them work.

An analogy I like to use for a very capable DBMS is that of an operating system,
and each autonomous transaction is like a distinct process/thread in this
system. The DBMS is like a virtual machine in which processes/autonomous
transactions run.

Like with an operating system, a process/auto-transaction can be started by
another one, or by the OS/DBMS (or a root process/auto), and once running all
processes are mutually independent to a large extent, in that each has its own
separatable privileges or state or view of the database, the database being an
analogy to the file system.

A process/auto-transaction can be started by a DBMS client, analogous to a user,
but it doesn't have to be. The message passing feature that Pg has,
listen/notify, is like inter-process communication between these processes/autos.

A stored procedure always runs within the context of one process/auto, and a
regular transaction or savepoint or whatever is specific to a process/auto.

Has anyone else thought of the DBMS as operating system analogy? I don't recall
specifically reading this anywhere, but expect the thought may be common.

-- Darren Duncan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2011-04-25 21:45:32 Improving the memory allocator
Previous Message Peter Eisentraut 2011-04-25 21:10:38 Re: Unfriendly handling of pg_hba SSL options with SSL off