LOAD(7)

πŸ“¦ version 15.19, in opensuse-leap 16.0

πŸ’… LOAD(7) β€” the PostgreSQL 15.19 glow-up for shared libraries

okay so bestie, you found a page from the PostgreSQL 15.19 Documentation, manual section 7, and it's literally called LOAD. it's a whole vibe and it's about yeeting a shared library file into the server's brain space. let's get into it πŸ’–


✨ NAME ✨

LOAD β€” load a shared library file πŸŽ€


🌸 SYNOPSIS 🌸

LOAD 'filename'

that's it. that's the whole thing. iconic minimalism.


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: this command loads a shared library file into the PostgreSQL server's address space. literally moving in, unpacking boxes 🧳

if the file has already been loaded, the command does nothing. like, zero. nada. it's giving "seen at 3:47pm, no reply" energy. πŸ™ˆ

here's the part that's highkey important though: shared library files that contain C functions are automatically loaded whenever one of their functions is called. so the server handles that for you, no cap. therefore, an explicit LOAD is usually only needed when you're loading a library that modifies the server's behavior through "hooks" rather than just providing a set of functions. hooks girlies stay needing the manual invite πŸ’…

so like, how do you write the file name? the library file name is typically given as just a bare file name, and that gets looked up in the server's library search path (which is set by dynamic_library_path). alternatively you can hand over a full path name. either way, you can skip the platform's standard shared library file name extension β€” she'll figure it out ✨ see Section 38.10.1 for the whole deep dive on this topic, iykyk.

and now the important safety bit, listen up fr fr 🚨:

Non-superusers can only apply LOAD to library files located in $libdir/plugins/ β€” and the specified filename must begin with exactly that string. like, exactly. no wiggle room. and it is the database administrator's responsibility to ensure that only "safe" libraries are installed there. so if you're the DBA, that's your job, bestie, not the server's. don't come crying later 😭

πŸ‘‘ COMPATIBILITY πŸ‘‘

LOAD is a PostgreSQL extension. she's not standard SQL, she's built different, and that's on periodt. πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

  • CREATE FUNCTION (CREATE_FUNCTION(7)) β€” the other way to get your functions in there, go read it 🫢

and that's the whole page! πŸ“ this masterpiece brought to you by PostgreSQL 15.19, dated 2026. go forth and load responsibly, bestie πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from