Re: "stored procedures"

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "stored procedures"
Date: 2011-04-25 18:27:35
Message-ID: 4DB5BD17.9040602@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/25/2011 02:18 PM, Peter Eisentraut wrote:
> On tor, 2011-04-21 at 18:24 +0300, Peter Eisentraut wrote:
>> So the topic of "real" "stored procedures" came up again. Meaning a
>> function-like object that executes outside of a regular transaction,
>> with the ability to start and stop SQL transactions itself.
> I would like to add a note about the SQL standard here.
>
> Some people have been using terminology that a "function" does this and
> a "procedure" does something else. Others have also mentioned the use
> of a CALL statement to invoke procedures.
>
> Both procedures (as in CREATE PROCEDURE etc.) and the CALL statement are
> specified by the SQL standard, and they make no mention of any
> supertransactional behavior or autonomous transactions for procedures.
> As far as I can tell, it's just a Pascal-like difference that functions
> return values and procedures don't.
>
> So procedure-like objects with a special transaction behavior will need
> a different syntax or a syntax addition.
>

The trouble is that people using at least some other databases call
supertransactional program units "stored procedures". Maybe we need a
keyword to designate supertransactional behaviour, but if we call them
anything but procedures there is likely to be endless confusion, ISTM,
especially if we have something called a procedure which is never
supertransactional.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-04-25 18:31:09 Re: Foreign table permissions and cloning
Previous Message Josh Berkus 2011-04-25 18:26:17 Re: branching for 9.2devel