Recording how a table is used
От | Daniel Gordon |
---|---|
Тема | Recording how a table is used |
Дата | |
Msg-id | 11c0133d0906292347q4c65cfe2m7b658232d0b13a9f@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Recording how a table is used
|
Список | 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 по дате отправления: