Database Reference
In-Depth Information
Chapter 1. What
Is
a
PostgreSQL
Server?
If you think that a PostgreSQL server is just a storage system, and the only way to
communicate with it is by executing SQL statements, you are limiting yourself tre-
mendously. That is using just a tiny part of the database's features.
A PostgreSQL server is a powerful framework that can be used for all kinds of data
processing, and even some non-data server tasks. It is a server platform that allows
you to easily mix and match functions and libraries from several popular languages.
Consider this complicated, multi-language sequence of work:
1. Call a string parsing function in Perl.
2. Convert the string to XSLT and process the result using JavaScript.
3. Ask for a secure stamp from an external time-stamping service such as
www.guardtime.com , using their SDK for C.
4. Write a Python function to digitally sign the result.
This can be implemented as a series of simple function calls using several of the
available server programming languages. The developer needing to accomplish all
this work can just call a single PostgreSQL function without having to be aware of how
the data is being passed between languages and libraries:
SELECT convert_to_xslt_and_sign(raw_data_string);
In this topic, we will discuss several facets of PostgreSQL server programming. Post-
greSQL has all of the native server-side programming features available in most
larger database systems such as triggers, automated actions invoked automatically
each time data is changed. But it has uniquely deep abilities to override the built-in
behavior down to very basic operators. Examples of this customization include the
following.
Writing User-defined functions ( UDF ) in C for carrying out complex computations:
• Add complicated constraints to make sure that data in the server meets
guidelines.
Search WWH ::




Custom Search