Re: expression evaluation with expected datatypes

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: expression evaluation with expected datatypes
Date: 2012-07-10 14:35:32
Message-ID: CAFj8pRAAfTTR_NpER5toir_Jjj=A_dsJCuby8Y0FEA1ybnOAEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012/7/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr> writes:
>> We could imagine several syntax to show up the idea, common keywords
>> here include LAMBDA, FLET or LABELS, but I think that expanding WITH
>> would be preferable for us.
>
>> WITH FUNCTION foo(param list) returns rettype language foo AS (
>> definition here
>> )
>> <query using foo() here>;
>
> I like this idea. This gets rid of both the "how to pass parameters"
> and the "how to return results" issues that exist with DO, as well as
> assorted implementation problems that you hinted at by asking whether
> DO would still be a utility command.

what is use case for this statement?

Regards

Pavel

>
> In the syntax-bikeshedding department, we'd still need the function body
> to be a string literal, and I think we'd want the ability to add
> options such as IMMUTABLE/VOLATILE. So I'd be inclined to move all
> these options inside the parentheses that the WITH syntax dictates.
> Perhaps
>
> WITH FUNCTION foo(paramlist) AS (
> returns int
> as $$ ... $$
> language plpgsql
> ... other CREATE FUNCTION options as needed ...
> )
> query here ...
>
> regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2012-07-10 14:38:44 Re: Event Triggers reduced, v1
Previous Message Shaun Thomas 2012-07-10 14:31:50 Re: Synchronous Standalone Master Redoux