The PLs (Procedural Languages) in PostgreSQL let you write stored procedures (i.e. functions) that can be called on their own or via a trigger (e.g. when a row is inserted or updated).
For instance, if you had a field that you wanted to be the output of some complex expression, algorithm, &c, you can write it as a function. For instance, something like Greatest Common Divisor (GCD) or geometry functions (e.g. intersection of two geometries, the union or intersection of two geometries, &c). Another example is custom aggregate functions.
This just lets you do it in Lua, if that's your thing. I think by default there is PL/pgSQL, PL/Tcl, PL/Perl , and PL/Python. There are plugins for a variety of other languages (e.g. ruby, java lua, R). I actually thought Lua became a default recently, but maybe they're still talking about it.
Yes. PL/pgSQL is the default AFAIK (been away from active use of Postgres for a few years). PL/pgSQL is basically the same as Oracle's PL/SQL, which has a very Pascal-like syntax.
I played around with PL/Lua 5 or 6 years ago, and liked it, but the project/idea got sidelined for other reasons so I never got very deep into it.
For instance, if you had a field that you wanted to be the output of some complex expression, algorithm, &c, you can write it as a function. For instance, something like Greatest Common Divisor (GCD) or geometry functions (e.g. intersection of two geometries, the union or intersection of two geometries, &c). Another example is custom aggregate functions.
This just lets you do it in Lua, if that's your thing. I think by default there is PL/pgSQL, PL/Tcl, PL/Perl , and PL/Python. There are plugins for a variety of other languages (e.g. ruby, java lua, R). I actually thought Lua became a default recently, but maybe they're still talking about it.