From: Jan Wieck <JanWieck@Yahoo.com>
To: pgsql-sql <pgsql-sql@fc.emc.com.ph>
Cc: pgsql-sql@postgresql.org
Subject: Re: trigger output to a file
Date: Fri, 23 Mar 2001 13:02:31 -0500 (EST)
Message-ID: <200103231802.NAA18716@jupiter.jw.home> (raw)
In-Reply-To: <fc.000f567200a768bb000f567200a768bb.a7696b@fc.emc.com.ph>
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 to ask 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: JanWieck@Yahoo.com, pgsql-sql@fc.emc.com.ph
Subject: Re: trigger output to a file
In-Reply-To: <200103231802.NAA18716@jupiter.jw.home>
References: <fc.000f567200a768bb000f567200a768bb.a7696b@fc.emc.com.ph> <200103231802.NAA18716@jupiter.jw.home>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox