Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove large objects in postgres

should I call lo_unlink ? A delete didn't remove the object from pg_largeobject.

like image 527
Dani Cricco Avatar asked Jul 31 '09 20:07

Dani Cricco


2 Answers

You can also clean up large objects from the command-line using

$ vacuumlo -U username databasename
like image 66
pards Avatar answered Oct 12 '22 22:10

pards


Yes, you need to explicitly call lo_unlink(). I assume you just DELETEd the row that held a reference to it, and that will not remove the actual large object.

If you only ever reference it from the same place, you can always create a trigger to do it automatically for you.

like image 32
Magnus Hagander Avatar answered Oct 13 '22 00:10

Magnus Hagander