Duplicating a table with a trigger

From: Wayne Oliver <wayn0(dot)ml(at)gmail(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Duplicating a table with a trigger
Date: 2013-09-03 11:11:42
Message-ID: 467399C8-A476-45A7-A0AC-5B64C13C31B1@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

I was hoping somebody here could point me in the right direction.
I am trying to duplicate changes to a specific table to a copy of that table.

Does that make sense?

basically I have

my_awesome_table

and

my_awesome_table_copy

Every time there is an insert or an update on my_awesome_table I would like to run exactly the same update or insert on my_awesome_table_copy.
I was thinking a trigger but the how to there after has got me a little confused.

if anyone could help it would be greatly appreciated.

Thanks
Wayn0

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Luca Ferrari 2013-09-03 11:36:03 Re: Duplicating a table with a trigger
Previous Message DrYSG 2013-09-02 16:29:25 PostGreSQL and NodeJS