Example usage of Postgres SPI and extension tools

February 6, 2018 ยท View on GitHub

This PostgreSQL extension does nothing special, except give some simple examples of how to use postgres' Server Programming Interface (SPI), since I felt a lack of examples while working on other projects.

This was made mainly by trial and error, so there might be inefficencies, or mistakes. Use at your own risk!

It is nowhere near exhaustive, it merely showcases functions I've needed.

Pull requests are welcome!

Resources

Functions

  • pg_spi_int(): insert an INT in a table
  • pg_spi_char(): insert a CHAR(n) in a table
  • pg_spi_bit(): insert a BIT(n) in a table