Summary

The powerful, yet clean, Tcl language is available in PostgreSQL as PL/Tcl and the untrusted PL/Tclu. Both the languages use different Tcl interpreters. PL/Tclu is the oldest language used in PostgreSQL, to access things outside the database. It allows you to write stored procedures in Tcl and takes advantage of all the cool features that Tcl has to offer. You can do almost everything you can with other PL languages, including database access and writing triggers. The only major disadvantage of PL/Tcl is that it does not allow you to return composite types and sets from a function.

In the next chapter, we will explore how to publish your code as a PostgreSQL extension.

Get PostgreSQL Server Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.