ALTER_LARGE_OBJECT(7)

πŸ’– ALTER LARGE OBJECT πŸ’–

okay bestie, welcome to the PostgreSQL 18.6 docs, page 7, and today's main character is ALTER_LARGE_OBJECT β€” literally the glow-up button for a large object's definition. it's giving "new owner, who dis" πŸ¦‹


✨ SYNOPSIS ✨

ALTER LARGE OBJECT large_object_oid OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }

that's it, that's the whole vibe. one statement, one job, zero drama πŸ’…


🌸 DESCRIPTION 🌸

so what does ALTER LARGE OBJECT actually do? it changes the definition of a large object. periodt.

now, the rules, and bestie you need to hear these:

  • you must own the large object to use ALTER LARGE OBJECT. like, it has to be yours.
  • and if you wanna hand it off to someone else, you also need to be able to SET ROLE to that new owning role. no sneaky transfers, okay?
  • but β€” and this is the fun part β€” a superuser can alter any large object anyway. they just can. no cap. πŸ‘‘

and here's the thing: currently the only functionality is to assign a new owner. that's the entire menu. so both of those restrictions always apply, every single time, no exceptions. it's not a sometimes-thing, it's an always-thing 😭


πŸŽ€ PARAMETERS πŸŽ€

  • large_object_oid β€” the OID of the large object you're altering. that's the one you're giving a whole new era to.
  • new_owner β€” the new owner of the large object. the person getting the keys πŸ”‘

πŸ’€ COMPATIBILITY πŸ’€

there is no ALTER LARGE OBJECT statement in the SQL standard. it's simply not a thing there. so if you're out here expecting standards compliance, this is not that, and that's fine, we move. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

  • Chapter 33

that's the whole page, bestie β€” go forth and reassign some large objects responsibly 🧚

PostgreSQL 18.6 Β· 2026 Β· stay slay, stay owned by the right role πŸ’–βœ¨