To Preload, or Not to Preload
The Tembo Blog published a post by yours truly last week about when to preload shared libraries and when not to:
Recently I’ve been trying to figure out when a Postgres extension shared libraries should be preloaded. By “shared libraries” I mean libraries provided or used by Postgres extensions, whether
LOAD
able libraries orCREATE EXTENSION
libraries written in C or pgrx. By “preloaded” I mean under what conditions should they be added to one of the Shared Library Preloading variables, especiallyshared_preload_libraries
.The answer, it turns out, comes very much down to the extension type.
I view this post as a kind of proto-chapter for an imagined book about developing extensions that I’d like to work on someday. I learned quite a lot researching it and responding to extensive feedback from more knowledgeable community members. It resulted in updates to the PGXN Meta preload property that I hope will inform binary distribution in the future. More on that soon.