Re: Stored Procedures and Functions

Поиск
Список
Период
Сортировка
От PFC
Тема Re: Stored Procedures and Functions
Дата
Msg-id op.ttayv6e4cigqcu@apollo13
обсуждение исходный текст
Ответ на Re: Stored Procedures and Functions  ("Leif B. Kristensen" <leif@solumslekt.org>)
Список pgsql-general

    MySQL supports procedures and functions.

    Functions can return results but cannot update the database.
    Procedures can update the database but cannot return results.

    However :
    - a function can call a procedure that updates the database !
    - a procedure can return result through OUT parameters !

    It's a friggin mess. In pgsql, if you want, a STABLE or IMMUTABLE
procedure is a function since it is repeatable : it will always return the
same results with the same parameters, and has no side-effects. This is
the definition of a function.

    It is better not to draw useless lines in the ground with huge "don't
walk over this line" stickers. People will always find a way around.
Better offer features that users need.


>> Is it true that postgres doesn't have a notion of Stored Procedures
>> and functions is what it has instead?
>> RDBMS like Sql Server supports both stored procedures and functions.
>> So I was wondering what is the difference between a Stored Procedure
>> and a function.
>
> Pascal has functions and procedures. C has only functions. That doesn't
> say anything about the relative usability of each language. Those are
> just names.



В списке pgsql-general по дате отправления:

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Stored Procedures and Functions
Следующее
От: "Dawid Kuroczko"
Дата:
Сообщение: Re: Transactional DDL