Re: LISTEN/NOTIFY

From: Jeff Davis <list-pgsql-general(at)empires(dot)org>
To: Cristóvão Dalla Costa <cbraga(at)bsi(dot)com(dot)br>, pgsql-general(at)postgresql(dot)org
Subject: Re: LISTEN/NOTIFY
Date: 2002-10-04 22:00:44
Message-ID: 200210041500.44980.list-pgsql-general@empires.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces


I did something similar using python with a simple "getnotify()" function
(part of the python pg module).

I couldn't find a similar function for perl -- strange.

I think the listening process needs to be a separate process anyway, since I
wouldn't think that an apache process would easily be able to wait for a
notification.

You could just do the cache invalidation process in another language, like
python or C, and all that would do is listen for an update, read the updated
info, and replace the cache. It should be small enough that you don't mind
straying from perl, hopefully.

Of course it is weird that perl doesn't support that. Maybe I missed something
too.

Regards,
Jeff Davis

On Friday 04 October 2002 01:49 pm, Cristóvão Dalla Costa wrote:
> I'm developing an e-commerce site using Apache/mod_perl and, for
> performance, I intend to cache rows such as user and product information
> inside Perl. I think the LISTEN/NOTIFY interface would be perfect for
> invalidating the cache when a product/user gets updated, yet I have not
> found a way to access it from Perl -- DBI, or DBD::Pg even, offer no way
> to "listen". Also, I don't really like the vanilla Pg. So, my question
> to you is, is there another efficient way to accomplish notification of
> updates?
>
> Thank you
>
> Cristóvão
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

In response to

  • LISTEN/NOTIFY at 2002-10-04 20:49:55 from Cristóvão Dalla Costa

Browse pgsql-general by date

  From Date Subject
Next Message Ed L. 2002-10-04 23:31:54 Pg 7.2.3 configure error
Previous Message Dagoberto Torres 2002-10-04 21:01:42 sum function

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2002-10-05 02:54:02 Re: LISTEN/NOTIFY
Previous Message Cristóvão Dalla Costa 2002-10-04 20:49:55 LISTEN/NOTIFY