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 .so if 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 apply LOAD to 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 ~ ๐Ÿ’–โœจ