Search Postgresql Archives

Re: user get notification when postgresql database updated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28/03/12 12:40, Albert wrote:
I am using javaScript app and PostgreSQL database. I have car_alert as a
table contains id (FK of cars table) and userid (FK of users table)
each car has a status ( status column in cars table ).

car_alert is updating and having new records (car id and userid ) every time
user choose car to be alerted about.

my database information is updating every 10 min and the user should get
notification message every time status for its car is changed. ( of course
every user has choosed his interested cars and inserted them to the
car_alert table by car id ) .

what is the best method to do that ?


Depends on what you mean by "javaScript app" in this context - browser-based or standalone? If the latter, the NOTIFY/LISTEN mechanism may help, see http://www.postgresql.org/docs/9.1/static/sql-notify.html, and if it's in the browser, might as well just poll the server every 10 minutes, that's unlikely to put much load on the server or network and there's not much point doing it more often if the updates only happen every 10 minutes anyway.

cheers,

Tom


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux