X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DB30BD1DAB3 for ; Sat, 31 Jan 2004 19:40:26 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 23716-07 for ; Sat, 31 Jan 2004 15:40:23 -0400 (AST) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 0AF6AD1DA9B for ; Sat, 31 Jan 2004 15:40:22 -0400 (AST) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 800746; Sat, 31 Jan 2004 11:37:09 -0800 Message-ID: <401C042E.5000705@joeconway.com> Date: Sat, 31 Jan 2004 11:38:22 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: JinNet Picker Cc: pgsql-admin@postgresql.org Subject: Re: 'dblink' Help References: <20040127105326.97350.qmail@web9402.mail.yahoo.com> In-Reply-To: <20040127105326.97350.qmail@web9402.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/309 X-Sequence-Number: 12172 JinNet Picker wrote: > What i need is, when ever a NEW record is inserted in > 'MyDb1' , i want fire a Trigger or Rule to insert the > Same Record to MyDb2 database. > Anybody Got Idea how to do this? See the dblink documentation for dblink_exec(), and see the Postgres documentation for how to create triggers: http://www.postgresql.org/docs/current/static/triggers.html You'll probably want to create the trigger function using PL/pgSQL: http://www.postgresql.org/docs/current/static/plpgsql.html Joe