Connecting Tech Pros Worldwide Help | Site Map

About tables

Member
 
Join Date: Sep 2007
Posts: 121
#1: Apr 27 '09
Hi friends,
I have one big doubt, when we update a table by inserting or deleting or modifying and those modifications we can store by \s <some filename>, by executing this command in the prompt of database, then it stores the commands whatever we have done till now in database prompt into that filename. But if we do modifications by a perl program, then how can we know which table is modified in which time?

My configuration is perl,postgresql,apache,Ubuntu 6.06 as Operating system.

So please help me?
Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 292
#2: Apr 27 '09

re: About tables


You can parse postgresql logs (first configure it) and look for sql DML queries, or you can define triggers on tables which can store,probably into another table, all queries you did.
Member
 
Join Date: Sep 2007
Posts: 121
#3: Apr 28 '09

re: About tables


Hi friend,
i am poor in configuring and do management, so can u please tell me elaborately, if u provide commands also it will be helpful to me.
Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 292
#4: Apr 28 '09

re: About tables


It depends if you want to change your database structure and define some triggers and new table for logs or not. In my opinion triggers are better than parsing log files.
If you want to parse log file firstly you need to configure postgres to put logs into file (it is not the default behaviour). You can configure it in postgresql.conf file. But you'll also need a soft called log analyzer (you can write it by yourself with perl language or search the internet, there are some) which will scan log file.

As i said better solution would be triggers. You don't need any new soft you only have to create triggers for tables you want to log and add new log table in which you will put logs.

I can help you with triggers, log analyzer you can download.


Sorry for english :)
Reply