Re: user get notification when postgresql database updated

Поиск
Список
Период
Сортировка
От Tom Molesworth
Тема Re: user get notification when postgresql database updated
Дата
Msg-id 4F73008D.5050103@audioboundary.com
обсуждение исходный текст
Ответ на user get notification when postgresql database updated  (Albert <oo_O2_oo@hotmail.com>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Albert
Дата:
Сообщение: user get notification when postgresql database updated
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Multiple Slave Failover with PITR