Wednesday, March 10, 2010

PL/pgSQL on Rdbhost

We have added the server-hosted programming language PL/pgSQL to all Rdbhost accounts.

It is enabled by default for new accounts, and can be enabled on existing accounts via the new Languages page, linked from the profile page.

PL/pgSQL supports variables and conditional execution, so you can write more sophisticated queries than with straight SQL. It is now possible to write sequences of operations to be executed in one request, that formerly required multiple requests, with client side intermediate evaluations between.

One example is illustrated here . Instead of doing an update, determining whether it succeeded, and conditionally doing an insert in a follow-up query, PL/pgSQL code can do the whole sequence on the server, and complete in one request.

http://www.rdbhost.com/plpgsql.html
http://www.postgresql.org/docs/8.2/interactive/plpgsql.html

No comments:

Post a Comment