IO in constraint trigger

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: IO in constraint trigger
Date: 2015-07-19 10:56:14
Message-ID: VisenaEmail.1ba.9a77f7beb4b7eeed.14ea5ed30e4@tc7-visena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.
 
We're planning to move away from Blobs (stored as OID) and use files with
path/URI stored in DB. For this to be reliable we're planning to do rename()
(which is atomic) in a constraint trigger, which triggers on commit. The plan
is to write stuff to a file (with at tmp-filename) in the application and to
pass the absolute file-name down to the DB so the trigger can rename it ON
COMMIT. This way we can use a naming-convention to figure out what files are OK
and which are not (which can be deleted due to rolled back transactions).
 
I have found this extension: https://github.com/csimsek/pgsql-fio/
but it doesn't seem to support renaming.
 
Any advice on how to proceed?
 
Thanks.
 
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoff Winkless 2015-07-19 12:10:38 Re: INSERT ... ON CONFLICT DO UPDATE
Previous Message Rafal Pietrak 2015-07-19 10:30:16 Re: INSERT ... ON CONFLICT DO UPDATE