Re: expression evaluation with expected datatypes - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: expression evaluation with expected datatypes
Date
Msg-id CAFj8pRCaNw7zZudga1TFW5gitdBbg-55J+fLhhYpGY9jFD09cQ@mail.gmail.com
Whole thread Raw
In response to Re: expression evaluation with expected datatypes  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: expression evaluation with expected datatypes
List pgsql-hackers
2012/7/10 Dimitri Fontaine <dimitri@2ndquadrant.fr>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>>>>   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?
>
> It's the DO block idea turned into a query rather than a utility
> command: you can now run a function that does not exists in the catalogs
> *and* feed it parameters (either from the client, as literals in the
> main query, or from the query itself) *and* you get a query result our
> of it.
>
> I'm not sure I can understand the difference between that and the use
> case for which you want to implement DO blocks with parameters.

this is similar to temporary functions - you need some temporary name
- it is insert to pg_proc, and you have to solve possible conflicts.



>
> Regards,
> --
> Dimitri Fontaine
> http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: expression evaluation with expected datatypes
Next
From: Tom Lane
Date:
Subject: Re: expression evaluation with expected datatypes