pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: nha <lyondif02@free.fr>
To: pgsql-sql@postgresql.org
Subject: Re: Recording how a table is used
Date: Wed, 08 Jul 2009 12:36:06 +0200
Message-ID: <4A547696.50704@free.fr> (raw)
In-Reply-To: <4A546728.4050904@free.fr>
References: <11c0133d0906292347q4c65cfe2m7b658232d0b13a9f@mail.gmail.com>
	<4A546728.4050904@free.fr>

Hello,

Le 8/07/09 11:30, nha a écrit :
> Hello,
> 
> Le 30/06/09 8:47, Daniel Gordon a écrit :
>> I'm trying to record the results of a select statement into a separate
>> table.  I need the information selected, the column it was stored in,
>> the table it was stored in, and the query that selected it.
>> [...]
>> Here is the table I'm trying to fill, in case it is useful
>>
>> create table sql_query_data_log (
>>  id serial,
>>  create_ time timestamp DEFAULT now(),
>>  query varchar,
>>  table text,
>>  column text,
>>
>>  data varchar
>>  );
>> [...]
> Another crude alternative may be based on triggers as you mentioned.
> Triggers may be created on each table for each possible triggered event
> (before, after).
> [...]

Rules may be also appropriate (more than triggers?). This page gives
some examples:
http://www.postgresql.org/docs/8.3/interactive/rules-update.html

Regards.

--
nha / Lyon / France.




view thread (3+ messages)

Message-ID: <4A547696.50704@free.fr>
Permalink:  ../4A547696.50704@free.fr/
Also on:    postgresql.org/message-id/4A547696.50704@free.fr

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lyondif02@free.fr
  Subject: Re: Recording how a table is used
  In-Reply-To: <4A547696.50704@free.fr>

* 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