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

From: François Beausoleil <francois(at)teksol(dot)info>
To: raghupradeep <raghupradeep(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Writing data to a text file based on a trigger event...
Date: 2012-04-12 12:29:24
Message-ID: D136534E9E18406281C954703D5CF326@ftml.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gavin Flower 2012-04-12 12:35:20 Fwd: Re: Searchable chess positions in a Postgress DB
Previous Message raghupradeep 2012-04-12 10:58:32 Writing data to a text file based on a trigger event...