From: | silly8888 <silly8888(at)gmail(dot)com> |
---|---|
To: | bret_stern(at)machinemanagement(dot)com |
Cc: | Steve Atkins <steve(at)blighty(dot)com>, pgsql-general General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Synchronize filenames in table with filesystem |
Date: | 2009-12-02 06:44:57 |
Message-ID: | 3c8f9f940912012244u5afd0497td32ad58203786d65@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
You can also use LISTEN/NOTIFY.
On Tue, Dec 1, 2009 at 6:25 PM, Bret <bret_stern(at)machinemanagement(dot)com> wrote:
>> -----Original Message-----
>> From: pgsql-general-owner(at)postgresql(dot)org
>> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Steve Atkins
>> Sent: Tuesday, December 01, 2009 9:44 AM
>> To: pgsql-general General
>> Subject: Re: [GENERAL] Synchronize filenames in table with filesystem
>>
>>
>> On Dec 1, 2009, at 9:19 AM, Ludwig Kniprath wrote:
>>
>> > Hi List,
>> > not another question on how to store files (db or
>> filesystem), i decided to use the filesystem.
>> >
>> > I'm now searching for a trigger, that deletes the physical
>> file when deleting a database-record containing the filename
>> in one of its fields. Is there a sample somewhere how this
>> could be done? I'm runnig PG 8.4 on a windows machine.
>>
>> I've done that by having the trigger put the name of the file
>> to be deleted in a "to be deleted" table. Then an external
>> process polls that table and deletes any file it finds in
>> there (using listen/notify if you need that to happen
>> immediately, but just polling works fine if it's just garbage
>> collection).
>>
>> That has the advantage of not deleting files until the
>> transaction commits too.
>>
>> Cheers,
>> Steve
>>
>>
>> --
>> Sent via pgsql-general mailing list
>> (pgsql-general(at)postgresql(dot)org) To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>
> I'm with Ludwig..
>
> Better to have the database perform it's primary function, and stay away
> from os chores.
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
From | Date | Subject | |
---|---|---|---|
Next Message | Helio Campos Mello de Andrade | 2009-12-02 07:16:06 | Postgres Dump out of order |
Previous Message | rahimeh khodadadi | 2009-12-02 06:40:43 | Re: Fwd: psql+krb5 |