November 2019
Beginner to intermediate
470 pages
11h 59m
English
Once in a while, your Perl procedure has to carry out some database work. Remember, the function is part of the database connection. Therefore, it is pointless to actually create a database connection. To talk to the database, the PostgreSQL server infrastructure provides the Server Programming Interface (SPI), which is a C interface that you can use to talk to database internals. All procedural languages that help you to run server-side code use this interface to expose functionality to you. PL/Perl does the same, and in this section, you will learn how to use the Perl wrapper around the SPI interface.
The most important thing that you might want to do is simply run SQL, and retrieve the number of rows that ...