Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1834063438F for ; Mon, 6 Jul 2009 15:28:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 82403-05 for ; Mon, 6 Jul 2009 15:28:17 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f205.google.com (mail-fx0-f205.google.com [209.85.220.205]) by mail.postgresql.org (Postfix) with ESMTP id 66F00633645 for ; Mon, 6 Jul 2009 15:28:17 -0300 (ADT) Received: by fxm1 with SMTP id 1so310042fxm.19 for ; Mon, 06 Jul 2009 11:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=xiu8RkDM+5ZqPeJSrAMWlWDp7tDFOkLecDo8TtZLYnU=; b=jlQ0+LkFJVkO7DsxY3QpwYgng0gkxQG6Mx/uEzs6KWyLdQ3qlEqpwRCYbSq3xTcoN6 DRCjzKWzHtZN03e6YI72dOgVAtAhThaU6boKC/HZ5CyAoo+USricSVpxoulumbCQwlfD 1dCDOZQ+R91bQJGm0dScY8FV4oC1SaUmZmxmc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=IHVkUsCAhDWPVLQxE1DFPHB9EhQRbOWFwLw/xYys7vseXKVqrZTjMGyoqdoV5aHZ14 tdXgAmcux0gf+5t1Ze6iF+V6eMZdwC4RZ3Ovs2Ad40ST2+5ED0pPuawVucC8QB0Uzy6C n8zhvj9K28Ohq7eXP5P1VJS0LEAZDKo87EMY8= MIME-Version: 1.0 Received: by 10.103.8.19 with SMTP id l19mr2441694mui.22.1246904895148; Mon, 06 Jul 2009 11:28:15 -0700 (PDT) In-Reply-To: <24360061.post@talk.nabble.com> References: <24360061.post@talk.nabble.com> From: Greg Stark Date: Mon, 6 Jul 2009 19:27:55 +0100 X-Google-Sender-Auth: 18a8a9f1e9dbc9a9 Message-ID: <407d949e0907061127n4aa61994sce02724004c27e76@mail.gmail.com> Subject: Re: PostgreSQL_db_change_notification To: iceDice Cc: pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/12 X-Sequence-Number: 19780 On Mon, Jul 6, 2009 at 6:57 PM, iceDice wrote: > > Does PostgreSQL supports some database change notification mechanism? > I have Java Swing application and PostgreSQL database for storing data. > The problem is that my database can change at any moment and instead of > querying > the database every 5 seconds, I would like the database to some how send my > application > a notification of a change when it happens. The Postgresy way to do this is to have triggers on the tables you want to watch which use the NOTIFY command. Then have your client issue a LISTEN. I'm not sure how this works with JDBC though... -- greg http://mit.edu/~gsstark/resume.pdf