From: Volkan YAZICI <volkan.yazici@gmail.com>
To: Richard Huxton <dev@archonet.com>
Cc: Premsun Choltanwanich <Premsun@nsasia.co.th>
Cc: pgsql-sql@postgresql.org
Subject: Re: How to delete Large Object from Database?
Date: Sat, 8 Oct 2005 14:20:05 +0300
Message-ID: <7104a7370510080420qca482a5r23ce3fdff80d25e1@mail.gmail.com> (raw)
In-Reply-To: <434623FD.7000408@archonet.com>
References: <43465BAA.C5F7.004C.0@nsasia.co.th>
<434623FD.7000408@archonet.com>
Hi,
On 10/7/05, Richard Huxton <dev@archonet.com> wrote:
> Deleting the OID does not remove the object itself - see details of
> lo_unlink() in Chapter 28 of the manuals.
>
> I seem to recall some other utilities in the contrib/ directory of the
> source distribution too.
Could it be `contrib/lo'? Here's some snippet from contrib/lo/README.lo:
[Snippet]
One of the problems with the JDBC driver (and this affects the ODBC driver
also), is that the specification assumes that references to BLOBS (Binary
Large OBjectS) are stored within a table, and if that entry is changed, the
associated BLOB is deleted from the database.
As PostgreSQL stands, this doesn't occur. Large objects are treated as
objects in their own right; a table entry can reference a large object by
OID, but there can be multiple table entries referencing the same large
object OID, so the system doesn't delete the large object just because you
change or remove one such entry.
[...]
I've fixed this by creating a new data type 'lo', some support functions, and
a Trigger which handles the orphaning problem. The trigger essentially just
does a 'lo_unlink' whenever you delete or modify a value referencing a large
object. When you use this trigger, you are assuming that there is only one
database reference to any large object that is referenced in a
trigger-controlled column!
[/Snippet]
Regards.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: volkan.yazici@gmail.com, dev@archonet.com, Premsun@nsasia.co.th
Subject: Re: How to delete Large Object from Database?
In-Reply-To: <7104a7370510080420qca482a5r23ce3fdff80d25e1@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox