Contents
ALTER LARGE OBJECT
An SQL command to change ownership of a large object
ALTER LARGE OBJECT
is a DDL command to change ownership of a large object.
ALTER LARGE OBJECT
was added in PostgreSQL 9.0.
Change history
- PostgreSQL 9.5
ALTER LARGE OBJECT ... OWNER TO { CURRENT_USER | SESSION_USER }
syntax added (commit 31eae602)
- PostgreSQL 9.0
- added (commit f1325ce2)
Examples
Using ALTER LARGE OBJECT
to alter ownership of a large object:
postgres=# \lo_import /tmp/random-meme.gif 'popular animated meme' lo_import 16459 postgres=# \dl Large objects ID | Owner | Description -------+----------+---------------------- 16459 | postgres | popular animated meme (1 row) postgres=# ALTER LARGE OBJECT 16459 OWNER TO lo_usr; ALTER LARGE OBJECT postgres=# \dl Large objects ID | Owner | Description -------+--------+---------------------- 16459 | lo_usr | popular animated meme (1 row)
References
- PostgreSQL documentation: ALTER LARGE OBJECT