pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Havasvölgyi Ottó <h.otto@freemail.hu>
To: Rodrigo Madera <rodrigo.madera@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Best way to check for new data.
Date: Sat, 29 Oct 2005 00:13:18 +0200
Message-ID: <01cb01c5dc0c$cce42830$8400a8c0@OTTO> (raw)
References: <3cf983d0510281439s648fac45vbd7af544eeca4fc3@mail.gmail.com>

Rodrigo,

You could use LISTEN + NOTIFY with triggers.
In after_insert_statement trigger you could notify a listener, the client could query it immediately.

Best Regards,
Otto

  ----- Original Message ----- 
  From: Rodrigo Madera 
  To: pgsql-performance@postgresql.org 
  Sent: Friday, October 28, 2005 11:39 PM
  Subject: [PERFORM] Best way to check for new data.


  I have a table that holds entries as in a ficticious table Log(id integer, msg text).

  Lets say then that I have the program log_tail that has as it´s sole purpose to print newly added data elements.

  What is the best solution in terms of performace?

  Thank you for your time,
  Rodrigo

view thread (4+ messages)  latest in thread

Message-ID: <01cb01c5dc0c$cce42830$8400a8c0@OTTO>
Permalink:  ../01cb01c5dc0c$cce42830$8400a8c0@OTTO/
Also on:    postgresql.org/message-id/01cb01c5dc0c$cce42830$8400a8c0@OTTO

 · 

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-performance@postgresql.org
  Cc: h.otto@freemail.hu, rodrigo.madera@gmail.com
  Subject: Re: Best way to check for new data.
  In-Reply-To: <01cb01c5dc0c$cce42830$8400a8c0@OTTO>

* 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