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!
- the official SPI documentation
- the official C functions documentation
- a tutorial on how to make postgres extensions
Note that this is only the first part in a series of 5 blog posts on the same topic (the link to the next post is at the bottom of the current post)
pg_spi_int()
: insert an INT in a tablepg_spi_char()
: insert a CHAR(n) in a tablepg_spi_bit()
: insert a BIT(n) in a table