Re: PL/pgSQL PERFORM with CTE
От | Pavel Stehule |
---|---|
Тема | Re: PL/pgSQL PERFORM with CTE |
Дата | |
Msg-id | CAFj8pRAH9kQ46A43bYfHhGNEPOyA5pEv_qdyH-YuHBtBM3+waQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: PL/pgSQL PERFORM with CTE (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: PL/pgSQL PERFORM with CTE
|
Список | pgsql-hackers |
2013/8/24 Tom Lane <tgl@sss.pgh.pa.us>
Pavel Stehule <pavel.stehule@gmail.com> writes:That article is worth reading, because Tom K. points out exactly why
> Oracle has a special function for returning sets from procedures - see a
> new functionality "Implicit Result Sets"
> http://tkyte.blogspot.cz/2013/07/12c-implicit-result-sets.html
T-SQL's approach is a bad idea compared to returning refcursors.
It's not clear to me that we should be in a hurry to go there, much less
try to be 100% syntax compatible with it.
I disagree - Tom K. speaking about what he likes or dislikes (and about what he didn't use) He forgot about strong points of implicit result or interesting points. Clients usually has no problem with dynamic datasets - PHP, DBI, Llibpq, GUI components .. all libs support a generic access and this generic access is often used due less dependency on queries.
There are a three interesting possibilities of implicit result sets:
* Possibility to return dynamic dataset - when you don't know a result before execution - typical use case is a some form of pivot tables or some analytics queries.
* Possibility to return multiple results as flattening of some multidimensional data.
* Possibilty to write multiresults reports for one call execution.
This functionality can be emulated by refcursors sets, but it is significantly less user friendly - so it is not widely used on Oracle's world.
regards
Pavel
regards, tom lane
В списке pgsql-hackers по дате отправления: