Proposal: real procedures again (8.4)

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: "Josh Berkus" <Josh(dot)Berkus(at)sun(dot)com>, "David Fetter" <david(at)fetter(dot)org>
Subject: Proposal: real procedures again (8.4)
Date: 2007-10-27 11:40:42
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


I found lot of discus about this topic.

There is one result - OUT params for functions. I propose start with
simple goals that we can enhance in future.

First goal: Procedures support for better conformance with ANSI SQL:

* procedure returns any only through OUT, INOUT params,
* procedure has own executor, that allows byref params (and own
transaction management in future),
* procedure can be overloaded,
* procedure can not returns recordset or multi recordset,
* procedure doesn't support default parameters,
* SQL statement CALL allows only expression (this proposal doesn't
need session variables) for older environments
* new SPI_exec_procedures API (allows binding to host variables) and
some similar in libpq, that allow CALL implementation in pgsql and
* new internal exec_exec_proc (allow ref on datum variable) used in
plpgsql statement CALL.
* new V2 calling convention (maybe based on SQL/CLI)
* no changes in current functions support

* procedure can manages transactions,
* procedure can returns recordset or multi recordset,
* procedure allows default parameters,
* CALL statement allows session variables
* no changes in current functions support

Why new calling convention? I would to support byref variables and
then I have to carry memory context info ... and maybe some others

Nice a weekend

Pavel Stehule


Why procedures? New parts of ANSI SQL use it, and what is worse, they
use methods:


Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-10-27 12:43:17 Re: Proposal: real procedures again (8.4)
Previous Message sayali k 2007-10-27 10:22:15 Definition of function base_yylex in version 8.1.4