Re: PL/pgSQL PERFORM with CTE

Поиск
Список
Период
Сортировка
Искать
От
David E. Wheeler
Тема
Re: PL/pgSQL PERFORM with CTE
Дата
Msg-id
E7ADEE10-DE87-4E58-9967-4BA7366F1390@justatheory.com
Ответ на
Список
Дерево обсуждения
PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Andres Freund <andres@2ndquadrant.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE Merlin Moncure <mmoncure@gmail.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Merlin Moncure <mmoncure@gmail.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE Marko Tiikkaja <marko@joh.to>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Boszormenyi Zoltan <zb@cybertec.at>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE Marko Tiikkaja <marko@joh.to>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL PERFORM with CTE "David E. Wheeler" <david@justatheory.com>
Re: PL/pgSQL PERFORM with CTE Pavel Stehule <pavel.stehule@gmail.com>
On Aug 29, 2013, at 1:11 PM, Pavel Stehule  wrote:

> I cannot to say what is good design for PL/pgSQL - only I feel so some variant of RETURN statement is not good, because semantic is significantly different. And I see a increasing inconsistency between a original ADA and PL/pgSQL. 

So YIELD or implement PL/PSM.

> Sure, When I am thinking about PSM, I am thinking about T-SQL syntax, but there is little bit simpler situation - there is a precedent in PSM implementation in MySQL and some other new databases. 

PL/pgSQL is not PSM.

> so main problem is a impossibility to write
> 
> BEGIN
>    CALL fce()
> 
> or
> 
> BEGIN
>   fce();
> 
> A workaround in Postgres is PERFORM - and I really has nothing again to remove PERFORM for start of VOID functions!

No reason SELECT could not work just a well.

> A unhelpful error message has zero relevant to topic - just almost all in PL/pgSQL is SELECT.

Well, it was an aside, but points out another problem with PERFORM: It doesn't really exist. I gets replaced with SELECT internally, leading to confusing error messages. Solution: Allow SELECT instead of PERFORM.

> Do you would to remove a ":=" statement too?
> 
> postgres=# do $$declare x int; begin x := notexisting(10); end; $$ ;
> ERROR:  function notexisting(integer) does not exist
> LINE 1: SELECT notexisting(10)
>                ^
> HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
> QUERY:  SELECT notexisting(10)
> CONTEXT:  PL/pgSQL function inline_code_block line 1 at assignment

I agree it would be nice if it didn't report SELECT there, but at least it's not *removing* anything from what you see in the source.

Best,

David




В списке pgsql-hackers по дате отправления
От: Pavel Stehule
Дата:
От: Ants Aasma
Дата:
FAQ