Recording how a table is used - Mailing list pgsql-sql

From Daniel Gordon
Subject Recording how a table is used
Date
Msg-id 11c0133d0906292347q4c65cfe2m7b658232d0b13a9f@mail.gmail.com
Whole thread Raw
Responses Re: Recording how a table is used
List pgsql-sql
I'm trying to record the results of a select statement into a separate table.  I need the information selected, the
columnit was stored in, the table it was stored in, and the query that selected it.  Everything I've read so far says
thattriggers can't trigger from select statements, and they don't have a variable that stores the query it triggered
from. I would be happy with partial solutions since my other option is a complicated perl script that has to parse the
querystatement to figure out where it is looking for the information<br /><br />Also, my next step is to do the same
foras many types of statements as possible, so if anyone knows how to retrieve the insert, update, or delete statement
sentto the database from inside the trigger, that would be useful as well.<br /><br />Here is the table I'm trying to
fill,in case it is useful<br /><pre>create table sql_query_data_log (<br /> id serial,<br /> create_ time timestamp
DEFAULTnow(),<br /> query varchar,<br /> table text,<br /> column text,<br />data varchar<br /> );</pre><br /> 

pgsql-sql by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: Re: Order of "WITH RECURSIVE" output
Next
From: Rainer Bauer
Date:
Subject: Re: fsync and Windows XP