Feature request: NOTIFY enhancement

From: "CN" <cnliou9(at)fastmail(dot)fm>
To: pgsql-general(at)postgresql(dot)org
Subject: Feature request: NOTIFY enhancement
Date: 2008-01-03 16:11:18
Message-ID: 1199376678.6148.1229295417@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear developers,

With the existing single-notification-value mechanism, not only
SELECT'ing tables are necessary in some cases but DELETE'ing rows and
synchronizing the DELETE are also required in many cases where there are
multiple client connections to the same database.

As an example, supposing there are 3 client connections to a database,
c1, c2, and c3. C1 updates a row with primary key value "cust A" on
table "customer". Then c1 notifies all clients to refresh their local
data only for "cust A". The present implementation requires c2 and c3 to
read all rows from table "customer" instead of just one row that has
primary key value "cust A".

Probably one will implement an additional table, say tableX, so that c1
will first insert value "cust A" into tableX and then do the
notification. Sure c2 and c3 can first check tableX so they can
determine how to proceed. Problem is who is responsible for the delete
of row from tableX, and when and which row! This is really complicate
because c1, c2, or c3 can update the row for "cust B" any time later,
too.

I am not sure if I am asking too much but does it make sense, and is it
possible, to enhance NOTIFY that process "name/value" pair? Like this:

NOTIFY "MyName=MyValue";

With the capability of name/value pair, the listener will not have to
check notification details by reading tables.

Thank you!

CN

--
http://www.fastmail.fm - The professional email service

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2008-01-03 16:21:37 Re: Feature request: NOTIFY enhancement
Previous Message Pavel Stehule 2008-01-03 16:10:24 Re: C-Extenions for PostgreSQL, Call Convention Version 0