The advantages and disadvantages of PLV8 are the same as the advantages and disadvantages of PLPerl, PLPython, and other PL languages.
- It is not integrated with the PostgreSQL engine - the result of processing SQL queries may be slower. PLpgSQL is fully integrated into the PostgreSQL engine.
- SQL is not integrated into the language - it is not possible to perform static analysis of embedded SQL. This is possible with PLpgSQL - see Plpgsql_check.
- You can do more expensive mathematical calculations, manipulating strings and arrays is usually faster than in PLpgSQL.
- You can use libraries designed for languages - Perl - CPAN, ...
- JavaScript, Perl, Python are common languages, so any common tasks are performed well there.
- PLpgSQL is a mature language for manipulating data in a database environment. Almost everything that developers need to work with data is. Iterating over the result, taking data from the database requires less readable code.
PLpgSQL is an ideal language for processing data using SQL. Other PLs are better for anything else - IO, Network, custom formatting, slow numerical computing, ...
source share