Saturday, May 10, 2008

Re: choiche of function language was: Re: [GENERAL] dynamic procedure call

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

No comments: