From: tiagoalves@brturbo.com
To: pgsql-sql@postgresql.org
Subject: Triggers Help...
Date: Wed, 17 Sep 2003 14:20:35 -0300 (BRT)
Message-ID: <14572644.1063819235613.JavaMail.nobody@webmail2.brturbo.com> (raw)
Hi,
I have two databases with the same tables, one is my Real Database and the other is my Log Database.
My Log database does NOT have any kind of keys (PRIMARY or FOREIGN).
I need to insert from my Real database to my Log database every row that is Updated or Deleted in any Table of the Real database.
I need to create triggers (BEFORE DELETE or BEFORE UPDATE) to each of my Real database tables, these triggers will INSERT into my Log database table the row that is being deleted or/and updated in the Real Database tables.
I dont know how to do this? Anyone can help me?
Thanks,
Tiago Alves
From pgsql-sql-owner@postgresql.org Wed Sep 17 16:33:57 2003
X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org
Received: from localhost (unknown [64.117.224.130])
by svr1.postgresql.org (Postfix) with ESMTP id 5AFF7D1B509
for <pgsql-sql-postgresql.org@localhost.postgresql.org>; Wed, 17 Sep 2003 17:39:43 +0000 (GMT)
Received: from svr1.postgresql.org ([64.117.224.193])
by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024)
with ESMTP id 62048-03
for <pgsql-sql-postgresql.org@localhost.postgresql.org>;
Wed, 17 Sep 2003 14:39:33 -0300 (ADT)
Received: from news.hub.org (unknown [64.117.224.194])
by svr1.postgresql.org (Postfix) with ESMTP id BFBF0D1B513
for <pgsql-sql@postgresql.org>; Wed, 17 Sep 2003 14:39:32 -0300 (ADT)
Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged))
by news.hub.org (8.12.9/8.12.9) with ESMTP id h8HHdUsn085841
for <pgsql-sql@postgresql.org>; Wed, 17 Sep 2003 17:39:32 GMT
(envelope-from news@news.hub.org)
Received: (from news@localhost)
by news.hub.org (8.12.9/8.12.9/Submit) id h8HHU8Ln084659
for pgsql-sql@postgresql.org; Wed, 17 Sep 2003 17:30:08 GMT
Message-ID: <4sgm31-723.ln1@dwnoon.ntlworld.com>
From: David W Noon <dwnoon@spamtrap.ntlworld.com>
Subject: Re: how to get decimal to date form
X-Newsgroups: comp.databases.postgresql.sql
References: <90446ee7.0309170450.2f16d9ef@posting.google.com>
Lines: 20
User-Agent: KNode/0.7.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
Date: Wed, 17 Sep 2003 18:05:40 +0100
X-Complaints-To: abuse@ntlworld.com
Organization: ntl Cablemodem News Service
To: pgsql-sql@postgresql.org
X-Virus-Scanned: by amavisd-new at postgresql.org
X-Archive-Number: 200309/162
X-Sequence-Number: 15140
On Wednesday 17 Sep 2003 13:50 in
<90446ee7.0309170450.2f16d9ef@posting.google.com>, wireless
(wireless200@yahoo.com) wrote:
> For example where the rec_num is 30608124143.47069519725 the above
> functions return 30608.
Unless you are logging dates around 3 A.D., I suggest you add 2000 to the
number before you apply the TO_CHAR() function.
I strongly suspect your app is not Y2K-compliant. [I haven't written that
for years!]
--
Regards,
Dave [RLU#314465]
======================================================
dwnoon@spamtrap.ntlworld.com (David W Noon)
Remove spam trap to reply via e-mail.
======================================================
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: tiagoalves@brturbo.com
Subject: Re: Triggers Help...
In-Reply-To: <14572644.1063819235613.JavaMail.nobody@webmail2.brturbo.com>
* 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