"Terri Reid" <treid@bct-solutions.co.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.
regards, tom lane