Search Postgresql Archives

Re: Writing data to a text file based on a trigger event...

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

 




Le jeudi 12 avril 2012 à 06:58, raghupradeep a écrit :

> What I need to know is it possible to write a trigger which will write the
> data of the row whose status column gets updated to a text file?

I would advise simply INSERTing the old values into a new table. This would be more flexible in the end, as you could export to a file, or run queries, or whatever.

The trigger would be an ON UPDATE, and very similar to the auditing trigger at http://www.postgresql.org/docs/9.1/static/plpgsql-trigger.html#PLPGSQL-TRIGGER-AUDIT-EXAMPLE

Welcome to PostgreSQL! Hope that helps!
François


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux