How to delete large objects in postgres

Should I call lo_unlink? Deletion did not delete the object from pg_largeobject.

+7
database postgresql
source share
2 answers

Yes, you need to explicitly call lo_unlink (). I assume that you are just DELETEd the string that contained the link to it, and this will not delete the actual large object.

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

+4
source share

You can also clear large objects from the command line using

$ vacuumlo -U username databasename 
+13
source share

All Articles