Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 103939FB9CB for ; Wed, 18 Jul 2007 10:47:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 56180-04 for ; Wed, 18 Jul 2007 10:47:01 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by postgresql.org (Postfix) with ESMTP id 68B2A9FB677 for ; Wed, 18 Jul 2007 10:47:09 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id a2so289609ugf for ; Wed, 18 Jul 2007 06:47:07 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=SgZUfpVhDDx1RT7+fGSPQVmhTb9zyiR9H8warbias8mDQm+Ox/nBx/okasQgNAlWZn8rJBBrRtLRVRngAS77pT8D0SbbCr4kTwK9xXcCgV7XvTulw8G6dC8mFYwnFxo7pM7CD6gfdp1S6h9SXBGKIQr3bhwBnZ7dGugQtLH6gO4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=k5zwdXD4f1ye6w/ROlhLwfERG8XF8gOvghvUyZKLoPdiBxMFtRLlCfNIgSF4OdPpvM9s9PfudVZw5N13TdFP8Kt/avnad6mRllz1IX7lAZGGZ5iJXLQej/Z1OFspMI1KISygaSzfDwvJtBvQbVkM+NbAhsZgAdonBFZVs19glaY= Received: by 10.66.242.19 with SMTP id p19mr358757ugh.1184766427594; Wed, 18 Jul 2007 06:47:07 -0700 (PDT) Received: from ?172.24.32.133? ( [62.232.55.118]) by mx.google.com with ESMTPS id e23sm5589751ugd.2007.07.18.06.47.03 (version=SSLv3 cipher=RC4-MD5); Wed, 18 Jul 2007 06:47:04 -0700 (PDT) Message-ID: <469E199D.1040402@enterprisedb.com> Date: Wed, 18 Jul 2007 14:46:05 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Michael Dengler CC: pgsql-performance@postgresql.org Subject: Re: How to use a trigger to write rows to a remote server References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/213 X-Sequence-Number: 25897 Michael Dengler wrote: > I am trying to find out how to use a trigger function on a table to copy > any > inserted row to a remote PG server. Have a look at contrib/dblink. You'll have to think what you want to happen in error scenarios. For example, if the connection is down, or it brakes just after inserting the row to the other db, but before committing. Or if the insert on the other server succeeds, but the local transaction aborts. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com