pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: John Proctor <jproctor@prium.net>
To: Neil Conway <nconway@klamath.dyndns.org>
Cc: josh@agliodbs.com
Cc: peter_e@gmx.net
Cc: pgman@candle.pha.pa.us
Cc: tgl@sss.pgh.pa.us
Cc: pgsql-patches@postgresql.org
Subject: Re: [SQL] 16 parameter limit
Date: Wed, 17 Apr 2002 09:08:58 -0700
Message-ID: <web-1374310@davinci.ethosmedia.com> (raw)
In-Reply-To: <200204170619.g3H6JKa29940@slxmail01.prium.net>

Folks,

> 1) More than 16 parameters.   This can be parameter configurable if 
> necessary, but up to 128 would cover 99.9%.
> 
> 2) Better exception handling.  The procedure should be able to trap
> any data 
> related exception and decide what to do.   No function should ever
> abort.  It should raise a trappable exception and let me decide what
> to do.
> 
> 3) Allow transactions inside of functions.   Mostly for incremental
> commits. 
> Each transaction shoud be implicitely started after any CrUD
> statement and 
> continue until a commit or rollback.
> 
> 4) Allow autonomous transactions.  This is related to number 2.  In
> Oracle, I 
> can track every single exception and log it in a central table with
> details, 
> even if I rollback the current transaction or savepoint.   This is a
> must for 
> tracking every single database error in an application at the exact
> point of 
> failure.
> 
> 5) Find a way to get rid of the requirement to quote the entire proc.
>   This 
> is very clumsy.   The PL/pgSQL interpreter should be able to do the
> quoting 
> and escape what it needs.
> 
> 6) Allow function parameters to be specified by name and type during
> the definition. Even aliasing is cumbersome and error prone on large
> procs, especially during development when changes are frequent.
> 
> 7) Allow function parameters to be passed by name, not just
> positional.  i.e. 
> get_employee_salary(emp_id => 12345, tax_year => 2001).
> 
> 8) Add packages.  This is a great way to group related functions,
> create 
> reusable objects, like cursors, etc.
> 
> 9) Allow anonymous PL/pgSQL blocks.   It should not be required to
> create a 
> function for every PL/pgSQL block.   Often, I just want to do
> something quick 
> and dirty or write complex blocks that I don't even want saved in the
> 
> database.  I can just keep then in a file and execute when necessary.

Also:

10) Allow declaration of all PostgreSQL data types, including custom
data types and domains, inside functions.  Especially important are
Arrays, which are supported as parameters but not as declarations.

11) PL/pgSQL has functionality 100% analagous to cursors, with a
different syntax.  While the PL/pgSQL record loop is easier to use, the
lack of support for standard cursor syntax mars the poratbility of
Oracle procedures to Postgres and vice-versa.

12) The biggie:  Allowing the easy return of query results from a
procedure.  This is currently supported through a rather difficult
workaround involving either the ROWTYPE datatype or a return Cursor.
 Both approaches require the use of a procedural code loop on the
interface side to read the data being returned ... much clumsier than
just dumping the data ala PL/SQL or T-SQL.  If implemented, this rowset
return would the the difference between a CREATE FUNCTION and a CREATE
PROCEDURE statement.

13) Allow the creation of multiple output parameters for PROCEDURES (as
opposed to FUNCTIONS) in the parameter declaration.

14) Procedures should have their own permissions, which supercede the
permissions on the tables being affected if the procedure is created by
the database owner, in the same way that Views can allow users to
Select data they would not be entitled to from the base tables.  In
other words, if I declare "GRANT SELECT ON fn_modify_assignment TO
phpaccess", the user phpaccess should be able to run
fn_modify_assignment even if that user has no permissions on the
assignment table itself.

-Josh Berkus

P.S. I haven't brought up these issues before because there is no way I
can contribute any significant resources to completing them.  

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



view thread (43+ messages)  latest in thread

Message-ID: <web-1374310@davinci.ethosmedia.com>
Permalink:  ../web-1374310@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-1374310@davinci.ethosmedia.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, jproctor@prium.net, nconway@klamath.dyndns.org, peter_e@gmx.net, pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, pgsql-patches@postgresql.org
  Subject: Re: [SQL] 16 parameter limit
  In-Reply-To: <web-1374310@davinci.ethosmedia.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox