Re: LISTEN ON table WHERE attr1 LIKE '%abc%';

From: Richard Huxton <dev(at)archonet(dot)com>
To: Eugen Dueck <eugen(at)dueck(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: LISTEN ON table WHERE attr1 LIKE '%abc%';
Date: 2009-08-06 08:18:07
Message-ID: 4A7A91BF.90307@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eugen Dueck wrote:
>
> Now I was hoping for a feature that goes even further than the ones discussed
> and allows clients to listen on changes in the database that satisfy real
> WHERE clauses, if used on tables, but I could imagine that you can listen for
> all changes caused by any DDL or DML statement, including CREATE TABLE and
> DROP TABLE.
>
> The motivation behind this request is, that I see lots of processes, connected
> to databases, that provide features like the one requested (they can only
> report changes that are done by clients through these processes, they don't
> notice changes done to the database directly), on the abstraction level
> of "business objects". These processes are essentially caches, used by
> multiple clients.

> So it would be nice to see the one feature I like about these caches added to
> Postgres, without having to resort to tricks that force me out of the (SQL)
> language, like rules/triggers.
>
> One problem might be that a couple of connection methods (like I think JDBC)
> don't allow for asynchronous communication from database to clients, which is
> why clients (when I checked out the LISTEN feature in Postgres) have to poll
> for changes, but I think it should be possible and maybe there are already
> ways to connect to Postgres that allow this?

The tricky bits are (1) reliability, (2) payload size and (3)
transactional semantics. You might find the pg-memcache project of some
interest, since it's handling this for the memcached system.
http://pgfoundry.org/projects/pgmemcache/

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ivan Sergio Borgonovo 2009-08-06 09:19:15 acl_admin by Afilias CA (bug/feature report)
Previous Message Richard Huxton 2009-08-06 08:10:22 Re: PostGres Config to Authenticate against AD over LDAP