From: Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>
To: 'Howie' <caffeine@toodarkpark.org>
Cc: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: RE: [SQL] Deleting large objects from database.
Date: Thu, 16 Dec 1999 15:43:53 +0100
Message-ID: <DA70131D22E4D211B02C006097483734025014@TIEX1> (raw)
> -----Oryginalna wiadomość-----
> Od: Howie [SMTP:caffeine@toodarkpark.org]
> Wysłano: 16 grudnia 1999 06:52
> Do: Czarny Marcin
> DW: 'pgsql-sql@postgresql.org'
> Temat: Re: [SQL] Deleting large objects from database.
>
> On Tue, 14 Dec 1999, Czarny Marcin wrote:
>
> > I have column with large objects in table named my_table.
> > After SQL command:
> > delete from my_table;
> > they are still files xinv* and xinx* in directory ./data/base/my_db.
> > Have I delete this files from operating system?
> > What is wrong? I hope thats is only my ignorance?
>
> delete'ing a record that 'holds' the LO's OID isnt the same as using
> lo_unlink() to delete the LO from disk.
>
> what you might want to do is look at $PGSQL_SRC_ROOT/contrib/lo.
> 'lo_manage()' is a function you can use in a DELETE trigger that, assuming
> a row 'housing' the LO's OID gets wiped, will lo_unlink() the LO, removing
> it from disk. its got a small bug ( doesnt, or didnt, properly check for
> NULL OIDs ), so be warned.
>
> ---
> Howie <caffeine@toodarkpark.org> URL: http://www.toodarkpark.org
> "Tell a man that there are 400 billion stars and he'll believe you.
> Tell him a bench has wet paint and he has to touch it."
>
YEEESSS!
That's it. I've made trigger with: select lo_unlink(...... And it's
work great.
Thanks a lot Howie.
MC :-))
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: Marcin.Czarny@plock.petrochemia.pl, caffeine@toodarkpark.org
Subject: Re: [SQL] Deleting large objects from database.
In-Reply-To: <DA70131D22E4D211B02C006097483734025014@TIEX1>
References: <DA70131D22E4D211B02C006097483734025014@TIEX1>
* 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