Re: Using "exit" to bring "goto" functionality.
От
Bryn Llewellyn
Тема
Re: Using "exit" to bring "goto" functionality.
Дата
Msg-id
CF115345-21B2-4416-A751-0E379847136B@yugabyte.com
Ответ на
Re: Using "exit" to bring "goto" functionality. (Pavel Stehule)
Список
Дерево обсуждения
Using "exit" to bring "goto" functionality. Bryn Llewellyn <bryn@yugabyte.com>
Re: Using "exit" to bring "goto" functionality. Christophe Pettus <xof@thebuild.com>
Re: Using "exit" to bring "goto" functionality. DAVID ROTH <adaptron@comcast.net>
Re: Using "exit" to bring "goto" functionality. Adrian Klaver <adrian.klaver@aklaver.com>
Re: Using "exit" to bring "goto" functionality. Bryn Llewellyn <bryn@yugabyte.com>
Re: Using "exit" to bring "goto" functionality. Pavel Stehule <pavel.stehule@gmail.com>
Re: Using "exit" to bring "goto" functionality. Bryn Llewellyn <bryn@yugabyte.com>
> pavel.stehule@gmail.com wrote: > >> bryn@yugabyte.com wrote: >> >> As it happens, Oracle's PL/SQL has a "goto" statement. But PL/pgSQL does not. (I assume that this is because "goto" is considered a bad thing.) But PL/SQL programmers do use it. However, the doc section: > > The reason why PL/pgSQL has not "goto" statement is mainly technological. PL/pgSQL is an interpreter of high level commands. For this kind of interpreter the "goto" - unstructured jump cannot be effectively implemented. PL/pgSQL is very simple, and relatively fast (expressions are slow due evaluation by SQL executor), but "goto" cannot be implemented there. Interpreter of PL/pgSQL is very different from the more usual p-code interpreter. It’s interesting to know that the reason that PL/pgSQL doesn’t support “goto” is an implementation restriction rather than a purist stance. Thanks! I mentioned PL/SQL only to say that it does not support the premature exit from a block statement that PL/pgSQL _does_ support (and document). I accept, now, that I’ll never know the rationale for this.
В списке pgsql-general по дате отправления