Re: How to export query results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/21/07, Chris Hoover <revoohc@xxxxxxxxx> wrote:
> I need some guidance.
>
> I need to have an after insert trigger execute on a specific table and
> export the results of query to a file on the database file system.  Is this
> possible to do from a trigger?  If so, how can I accomplish this?  I am
> drawing a blank on how to export the results of the query.

Yes.  you need to use the copy command inside a function and use
security definer to say that the function runs as a superuser.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux