ALTER_LARGE_OBJECT(7pg18)
π 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 ROLEto 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 πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms