pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: ramachandra.bhaskaram@wipro.com
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL NOTIFY Help] sending NOTIFY to the external program
Date: Wed, 03 Jan 2007 14:22:57 +0000
Message-ID: <459BBC41.1070804@archonet.com> (raw)
In-Reply-To: <47230CE166B64744B0120173E4C2161E0103E6A1@BLR-EC-MBX01.wipro.com>
References: <47230CE166B64744B0120173E4C2161E0103E6A1@BLR-EC-MBX01.wipro.com>

ramachandra.bhaskaram@wipro.com wrote:
> Yes, our application is supposed to know *immediately* that a change in
> the database has occurred since, based on this modified data it is doing
> lot of other operations and also, the db transactions are heavy(expected
> to be arround 300 tps(transactions per sec)).
> 
> I agree that this can be done using some untrusted languages, written to
> a file and then the application can look into the file for the modified
> date.  But, as far as performance is concerned it will take time for the
> application to get the response. The user on the application side might
> not be kept in waiting state until this transaction happens.

Needn't take time, if the O.S. you're on can notify you of file writes, 
but in any case I'd look at communicating over a socket (unix or tcp/ip) 
if you want immediate notification. It's simple enough in perl or python 
(or ruby, or any of those).

Oh, and you'll need to cope with the case:
  1. Transaction containing the update is rolled back
  2. Notification has already left the database

-- 
   Richard Huxton
   Archonet Ltd



view thread (8+ messages)  latest in thread

Message-ID: <459BBC41.1070804@archonet.com>
Permalink:  ../459BBC41.1070804@archonet.com/
Also on:    postgresql.org/message-id/459BBC41.1070804@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, ramachandra.bhaskaram@wipro.com
  Subject: Re: [SQL NOTIFY Help] sending NOTIFY to the external program
  In-Reply-To: <459BBC41.1070804@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox