Re: Non-superuser creating a flat file

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Terri Reid <treid(at)edp(dot)co(dot)uk>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Non-superuser creating a flat file
Date: 2007-08-17 17:34:12
Message-ID: 5489664E-7E1C-44C2-81D7-8B9CE6096024@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Aug 13, 2007, at 10:07 AM, Terri Reid wrote:

> 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. Is there some
> other functionality that can write out flat files? I’m looking for
> something similar to the Oracle UTL file functionality, as ideally
> I’d want to append the data to an existing file and be able to
> manipulate the data before I wrote it out.

Maybe it could work if you create your function using the SECURITY
DEFINER option?

http://www.postgresql.org/docs/8.2/interactive/sql-createfunction.html

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2007-08-17 17:39:33 Re: Enterprise Wide Deployment
Previous Message Naz Gassiep 2007-08-17 17:23:05 More Time Zone fun