Re: Calling PL functions with named parameters

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Calling PL functions with named parameters
Date: 2004-08-14 21:07:58
Message-ID: 411E7F2E.4000505@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:

>Josh Berkus wrote:
>
>
>>>Dennis has pointed out that mixing the call-with-named-parameter
>>>interface with call-by-order-of-parameters one would cause
>>>confusion, and I think it would be OK to disallow this type mixing,
>>>so
>>>
>>>
>>As we've discussed on IRC, this should be the difference between a
>>FUNCTION and a PROCEDURE.
>>
>>
>
>Huh? As far as I can tell, the difference between a function and a
>procedure is precisely that the latter doesn't return a value. A
>consistent way to specify the parameters of either one would certainly
>be highly desirable.
>
>
>
>>b) Procedures are not automatically transactional; that is,
>>transactions within procedures must/can be explicit. Among other
>>things, this would allow procedures to run maintainence tasks.
>>
>>
>
>I certainly want all my maintenance tasks to be transactional. Being
>nontransactional is a fuzzy idea anyway. You can't really run anything
>without a transaction in PostgreSQL.
>
>
>

I think you're right on both counts.

ISTM we need a more strategic discussion of where we want to go with
procedural code.

some other ideas to consider:
- it would be nice to be able to say PERFORM 'string with plcode'
language plname;
- OUT / INOUT parameters

I think we need an idea of where we are going with all this stuff,
rather than approaching the area piecemeal in a way that might preclude
other decisions we might want to make later.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-08-14 21:44:35 Re: [Fwd: Re: [pgsql-hackers-win32] Import from Linux to
Previous Message Peter Eisentraut 2004-08-14 20:45:03 Re: Calling PL functions with named parameters