Re: choiche of function language was: Re: dynamic procedure call

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: choiche of function language was: Re: dynamic procedure call
Дата
Msg-id 2240.1210432767@sss.pgh.pa.us
обсуждение исходный текст
Ответ на choiche of function language was: Re: dynamic procedure call  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы Re: choiche of function language was: Re: dynamic procedure call
Список pgsql-general
Ivan Sergio Borgonovo <mail@webthatworks.it> writes:
> It is clear what is at least one of the advantage of plpython or
> plperl over plpgsql, but then what are the advantages of plpgsql over
> the rest of the crowd other than resembling the language used in
> Oracle?

Others made some other comments already, but I think the issue that
is specifically concerning you is the question of strong vs weak
typing.  plpgsql is designed as a strongly typed language, meaning
that the types of all objects are supposed to be predetermined and
not changing.  This makes it difficult if not impossible to write stuff
that can refer to run-time-selected columns.  But you get benefits in
terms of better error checking and improved performance --- a weakly
typed language could never cache any plans, not even for trivial
expressions.

We've poked a few loopholes in the strong typing over the years
--- the whole business of EXECUTE versus direct evaluation of a
query can be seen as allowing weak typing for EXECUTE'd queries.
But it's still the language's design center.

I think it'd be possible to build a weakly typed language that was
just as well integrated with SQL as plpgsql is, but it would likely
be markedly slower in use.

            regards, tom lane

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

Предыдущее
От: Steve Atkins
Дата:
Сообщение: Re: choiche of function language was: Re: dynamic procedure call
Следующее
От: Tom Lane
Дата:
Сообщение: Re: choiche of function language was: Re: dynamic procedure call