If you have lob type
@Column(name = "xml")
@Lob
private String xml;
then in PostgreSQL you get column with type text
\d tablename
Column | Type | Modifiers
----------------+-----------------------------+-----------
xml | text |
When you insert some text into this colummn then large object is created and column contain s link to this object
# select * from tablename
xml
+------------
242781
(1 row)
In this post it's suggested to use vacuumlo utility to cleanup large objects which correspond to deleted rows. But according this documentation
It then scans through all columns in the database that are of type oid or lo, and removes matching entries from the temporary table. (Note: only types with these names are considered; in particular, domains over them are not considered.)
So if you run vacuumlo on database that contains text column then all large objects will be deleted as they are referencef from text column not oid. So question how shold I map LOB object in hibernate to be allowed clean up unused space
I checked with Postgresql 9.3.4 and hibernate 4.3.5