Re: Using Large Object in PostgreSQL - Mailing list pgsql-general

From Tom Lane
Subject Re: Using Large Object in PostgreSQL
Date
Msg-id 6644.1087759432@sss.pgh.pa.us
Whole thread Raw
In response to Using Large Object in PostgreSQL  ("Simon Shum" <s035668@mailserv.cuhk.edu.hk>)
List pgsql-general
"Simon Shum" <s035668@mailserv.cuhk.edu.hk> writes:
> I just used oid as a reference to store some binary large object.
> After some time, I find that the data build up to a very large size 3.xx GB=
>  but I just have  2 or 3 records with a binary large object inside. So what=
>  may be the problem?
> by the way, I just delete the records with oid field using delete from tabl=
> e where id =3D 'xxx'. Will this left a unreferenced copy of large object in=
> side the database?

Yes.

> If yes, what should I do?

contrib/vacuumlo will help you identify the large objects that need to
be removed.  After you get done, pg_largeobject will need a VACUUM
FULL.

See also contrib/lo, which is a wrapper datatype that deletes large
objects when you delete the reference.  This is probably closer to the
behavior you were expecting.

            regards, tom lane

pgsql-general by date:

Previous
From: dayzman@hotmail.com (Michael)
Date:
Subject: Query
Next
From: Tom Lane
Date:
Subject: Re: plpgsql - Inserting DEFAULT Value.