LOAD(7)
โจ LOAD โจ
okay bestie, so this is the PostgreSQL 18.6 manual page for LOAD, and it's genuinely one of the shorter ones, so no excuses, we're reading the whole thing together ๐
๐ธ NAME ๐ธ
LOAD โ load a shared library file. that's it. that's the whole vibe. ๐ซถ
๐ SYNOPSIS ๐
LOAD 'filename'
๐ฆ DESCRIPTION ๐ฆ
so what does this actually do?? it loads a shared library file straight into the PostgreSQL server's address space. iconic behaviour, no notes.
and if the file has already been loaded?? the command literally does nothing. it's giving "been there, done that, no thoughts head empty." ๐
here's the part that lowkey matters most: shared library files that contain C functions get loaded automatically whenever one of their functions is called. so you don't need to sit there manually loading stuff like it's 2010. an explicit LOAD is usually only needed when you're loading a library that messes with the server's behaviour through "hooks" rather than just handing you a set of functions. hooks are the ones that need the formal invitation โจ
now, about the file name:
- you'll <em>typically</em> just give a bare file name, and the server goes looking for it in the server's library search path โ which is set by
dynamic_library_path๐ง - or you can give a full path name instead. either works, no judgement
- in <em>either</em> case, the platform's standard shared library file name extension may be omitted. so chill, you don't have to type
.soif you don't want to - for more on this whole topic, check Section 36.10.1
โ ๏ธ okay this bit is important, bestie, pay attention: non-superusers can only applyLOADto library files located in$libdir/plugins/. and the filename you specify must begin with exactly that string โ not kinda-sorta, not almost, exactly. no cap.
and one more thing, because it's genuinely on you: it is the database administrator's responsibility to make sure only "safe" libraries are installed in there. the quotes around "safe" are doing a lot of heavy lifting, iykyk ๐
๐ COMPATIBILITY ๐
LOAD is a PostgreSQL extension. so like, it's ours, it's a homegrown thing, don't go looking for it in the SQL standard ๐
๐ซ SEE ALSO ๐ซ
CREATE FUNCTION(CREATE_FUNCTION(7)) โ go read that one too, it's the main character of this friend group ๐
periodt. that's the whole page, you ate it, I'm so proud of you ๐
~ brought to you by PostgreSQL 18.6, dated 2026, and this little LOAD(7) page itself ~ ๐โจ
๐ฆ where this page comes from
- alpine 3.23: postgresql18-doc 18.6-r0 ยท PostgreSQL
- alpine 3.24: postgresql18-doc 18.6-r0 ยท PostgreSQL
- arch rolling: postgresql 18.6-4 ยท PostgreSQL
- fedora 43: postgresql 18.6-1.fc43 ยท PostgreSQL
- fedora 43: postgresql 18.6-1.fc43 ยท PostgreSQL
- fedora 44: postgresql 18.6-1.fc44 ยท PostgreSQL
- fedora 44: postgresql 18.6-1.fc44 ยท PostgreSQL
- nixos 26.05: postgresql 18.6
- ubuntu resolute: postgresql-client-18 18.6-0ubuntu0.26.04.1 ยท PostgreSQL
- ubuntu stonking: postgresql-client-18 18.6-3build2 ยท PostgreSQL
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms