Re: non superuser creating flat files

From: Erik Jones <erik(at)myemma(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Terri Reid" <treid(at)bct-solutions(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: non superuser creating flat files
Date: 2007-08-13 15:06:34
Message-ID: 60D5B120-CFF3-4411-9501-D2404A49E084@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Aug 13, 2007, at 9:50 AM, Tom Lane wrote:

> "Terri Reid" <treid(at)bct-solutions(dot)co(dot)uk> writes:
>> I have data that is being updated in a table that I need to export
>> to a flat
>> file via a database trigger on insert or update. The user
>> performing the
>> update will not be a superuser. I've tried to use COPY TO, but
>> that doesn't
>> work for non-superusers.
>
> It will if invoked in a trigger function that's marked SECURITY
> DEFINER
> and owned by a superuser.

Also/Or, make sure the that the correct filesystem write permissions
are set on the file/directory to which you're writing for which ever
user whose permissions the trigger function is executed as.

Erik Jones

Software Developer | Emma®
erik(at)myemma(dot)com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lim Berger 2007-08-13 15:12:59 Re: "Out of memory" errors..
Previous Message Terri Reid 2007-08-13 14:58:59 Re: non superuser creating flat files