PostgreSQL native programming language

PostgreSQL supports out-of-the-box user-defined functions written in C, SQL, and PL/pgSQL. There are also three other procedural languages that come with the standard PostgreSQL distribution: PL/Tcl, PL/Python, and PL/Perl. However, one needs to create the languages in order to use it, via the CREATE EXTENSION PostgreSQL command or via the createlang utility tool. The simplest way to create a language and make it accessible to all databases is to create it in template1, directly after the PostgreSQL cluster installation. Note that one does not need to perform this step for C, SQL, and PL/pgSQL.

For beginners, the most convenient languages to use are SQL and PL/pgSQL, since they are supported directly. Moreover, they are highly portable and do not need special care during the upgrading of the PostgreSQL cluster. Creating functions in the C is not as easy as creating them in SQL or PL/pgSQL, but since the C is a general programming language, one could use it to create very complex functions to handle complex data types such as images.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset