Re: Setting global vars for use with triggers

From: Douglas McNaught <doug(at)mcnaught(dot)org>
To: CSN <cool_screen_name90001(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Setting global vars for use with triggers
Date: 2005-06-22 22:21:15
Message-ID: m2zmtif2xw.fsf@Douglas-McNaughts-Powerbook.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

CSN <cool_screen_name90001(at)yahoo(dot)com> writes:

> I'd like to create a trigger which deletes associated
> files whenever their corresponding row is deleted.
> Problem is, I don't want to hard-code directory
> locations in the trigger function. Is there a way to
> set a DOCUMENT_ROOT-like variable in Postgresql which
> triggers could access and use? I'm using PHP for the
> trigger (and PG 8.x).

It's probably best to keep it in a one-row table--that way it'll be
saved when you back up the database, and you can change it with
standard SQL.

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Julian Legeny 2005-06-22 22:36:50 PROBLEM: Function does not exist
Previous Message Tom Lane 2005-06-22 21:39:00 Re: Vacuum advice