Re: trigger output to a file - Mailing list pgsql-sql

From Jan Wieck
Subject Re: trigger output to a file
Date
Msg-id 200103231802.NAA18716@jupiter.jw.home
Whole thread Raw
In response to trigger output to a file  ("pgsql-sql" <pgsql-sql@fc.emc.com.ph>)
Responses Re: trigger output to a file
List pgsql-sql
pgsql-sql wrote:
> Hello Everyone,
>
> Here's my simple question.
>
> I just want to know/get the recent changes made to a table.
> Deeper? I wanted the Postgresql server to *publish* every
> changes made to a table (similar to replication, incremental transfer,
> etc.).
> What is the best way to go about it?
>
> My idea is to create a trigger for every insert/update that will
> select the new/updated record and output it to a file. Or better
> yet, I would like to output the actual sql query to file.
> Is it possible to output the result of an sql query from a trigger
> to a file? How?
   Putting the SQL query to a file would be my approach too.
   The  trigger approach lacks the capability to discard changes   already logged in case of a  transaction  rollback.
Thus, I   wouldn't buy it.
 
   For the query string logging, alot more is required. Not only   the queries themself are  needed,  you'd  need  to
serialize  snapshot creation, log sequence allocations and the like. And   the program rolling forward this kind  of
log into  another   database  needs  control mechanisms to tell the database that   it's in this recovery mode and has
toask for those values in   case it needs them.
 
   You might guess it already, I've been thinking about it for a   year or so now. And I'm still not past  the  point
to start   implementing it.
 

>
> I would appreciate any answer. Thank you very much.
> Sherwin
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>


--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



pgsql-sql by date:

Previous
From: Jie Liang
Date:
Subject: Re: SOME PL/PGSQL PROBLEMS
Next
From: Roberto Mello
Date:
Subject: Re: drop table in PL/pgSQL