Re: "stored procedures"

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "stored procedures"
Date: 2011-04-21 17:34:00
Message-ID: BANLkTimWV9e15m=HNYX5Vp+7duWjNG3Ykg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

2011/4/21 Josh Berkus <josh(at)agliodbs(dot)com>:
> Peter,
>
>> I would like to collect some specs on this feature.  So does anyone have
>> links to documentation of existing implementations, or their own spec
>> writeup?  A lot of people appear to have a very clear idea of this
>> concept in their own head, so let's start collecting those.
>
> Delta between SPs and Functions for PostgreSQL:
>
> * SPs are executed using CALL or EXECUTE, and not SELECT.
>
> * SPs do not return a value
> ** optional: SPs *may* have OUT parameters.

SP can returns value - result status or RETURNED_SQLSTATE. Result
status is hidden OUT parameter

>
> * SPs have internal transactions including begin/commit
> ** optional: SPs can run non-transaction statements,
>   like CREATE INDEX CONCURRENTLY and VACUUM
> ** corollary: SPs may not be called as part of a larger query
> ** question: if an SP is called by another SP, what is its
>   transaction context?
>
> * optional: SPs can return multisets (ala SQL Server).
> ** question: how would multisets be handled on the client end?
>

you should to use some "next" function for iteration between resultsets

http://dev.mysql.com/doc/refman/5.0/en/mysql-next-result.html

similar function exists in MSSQL API too

Regards

Pavel Stehule

> --
> Josh Berkus
> PostgreSQL Experts Inc.
> http://pgexperts.com
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-04-21 17:35:27 Re: EOL for 8.2 (was Re: Formatting Curmudgeons WAS: MMAP Buffers)
Previous Message Josh Berkus 2011-04-21 17:22:25 Re: "stored procedures"