Re: Re: [HACKERS] pl/pgsql function out parameters

From: Jurgen Defurne <defurnj(at)glo(dot)be>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Richard Nfor <rnfor(at)taku(dot)demon(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [HACKERS] pl/pgsql function out parameters
Date: 2000-07-06 18:09:09
Message-ID: 3964CB44.C17F8E09@glo.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Thomas Lockhart wrote:

> > Does anyone know if out parameters are supported in pl/pgsql functions?
>
> Yes. They are not supported. I've got patches ready to submit which
> recognize the IN, OUT and INOUT keywords defined in SQL99, but the
> patches will just throw an explicit error if you specify an OUT/INOUT
> parameter.
>
> btw, everyone: any objections to or comments on the above?
>
> - Thomas

Yes, I would like to add my $2/100. I do not know what the historical trail
leading to your functions is, but in the context of a function you normally
would not want to define IN/OUT parameters (in Oracle PG/SQL it is
forbidden (Oracle PL/SQL is clearly derived from ADA)).
This forces some discipline on the programmer. I want say that you need
to define something as a subroutine, but wouldn't the following be better :
- If RETURN is used, then it is a function : forbid IN/OUT parameters
- If there is an IN/OUT parameter in the declaration, return type of the
function may only be opaque

Jurgen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeffrey A. Rhines 2000-07-06 20:33:20 OUTER JOIN workaround... ideas?
Previous Message The Hermit Hacker 2000-07-06 18:03:28 Re: proposed improvements to PostgreSQL license

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2000-07-06 18:36:26 Re: Fix for pg_dump
Previous Message The Hermit Hacker 2000-07-06 18:03:28 Re: proposed improvements to PostgreSQL license