Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4F3B3476495 for ; Fri, 4 Oct 2002 18:01:54 -0400 (EDT) Received: from mail1.servata.com (unknown [64.71.190.37]) by postgresql.org (Postfix) with ESMTP id 7F8F0476033 for ; Fri, 4 Oct 2002 18:00:33 -0400 (EDT) Received: from [66.75.132.38] (helo=jeff) by mail1.servata.com with asmtp (Exim 3.35 #1 (Debian)) id 17xaiO-0000NZ-00; Fri, 04 Oct 2002 15:14:32 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Jeff Davis To: =?iso-8859-1?q?Crist=F3v=E3o=20Dalla=20Costa?= , pgsql-general@postgresql.org Subject: Re: LISTEN/NOTIFY Date: Fri, 4 Oct 2002 15:00:44 -0700 User-Agent: KMail/1.4.3 References: <3D9DFEF3.6020509@bsi.com.br> In-Reply-To: <3D9DFEF3.6020509@bsi.com.br> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200210041500.44980.list-pgsql-general@empires.org> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/282 X-Sequence-Number: 31280 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