pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedDeleting large objects from database.
4+ messages / 3 participants
[nested] [flat]
* Deleting large objects from database.
@ 1999-12-14 11:53 Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>
0 siblings, 2 replies; 4+ messages in thread
From: Czarny Marcin @ 1999-12-14 11:53 UTC (permalink / raw)
To: pgsql-sql
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?
Best regards,
Marcin Czarny
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [SQL] Deleting large objects from database.
@ 1999-12-14 18:16 neko@kredit.sth.szif.hu
parent: Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>
1 sibling, 0 replies; 4+ messages in thread
From: neko@kredit.sth.szif.hu @ 1999-12-14 18:16 UTC (permalink / raw)
To: Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>; +Cc: pgsql-sql
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.
The delete records are there still too. To remove them, U may use vacuum;
I'm not sure yet, about the vacuum remove the large objects.
I have seen somewhere an util called 'lovacuum'...
--
nek;(
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [SQL] Deleting large objects from database.
@ 1999-12-16 05:51 Howie <caffeine@toodarkpark.org>
parent: Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>
1 sibling, 0 replies; 4+ messages in thread
From: Howie @ 1999-12-16 05:51 UTC (permalink / raw)
To: Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>; +Cc: pgsql-sql
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."
^ permalink raw reply [nested|flat] 4+ messages in thread
* RE: [SQL] Deleting large objects from database.
@ 1999-12-16 14:43 Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>
0 siblings, 0 replies; 4+ messages in thread
From: Czarny Marcin @ 1999-12-16 14:43 UTC (permalink / raw)
To: 'Howie' <caffeine@toodarkpark.org>; +Cc: pgsql-sql
> -----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 :-))
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~1999-12-16 14:43 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-12-14 11:53 Deleting large objects from database. Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>
1999-12-14 18:16 ` neko@kredit.sth.szif.hu
1999-12-16 05:51 ` Howie <caffeine@toodarkpark.org>
1999-12-16 14:43 RE: [SQL] Deleting large objects from database. Czarny Marcin <Marcin.Czarny@plock.petrochemia.pl>
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