NOTIFY tableX, LISTEN tableX, pool Nofities()

Поиск
Список
Период
Сортировка
От Davi Leal
Тема NOTIFY tableX, LISTEN tableX, pool Nofities()
Дата
Msg-id 200203281727.g2SHR1tb019240@excalibur.ene.es
обсуждение исходный текст
Список pgsql-general
I am developing an n-tier application which uses postgresql 7.2. It has several windows to show Data Base data. If the
DBmodifies its data then some or each window must update the showed information. To realize it the DB send "NOTIFY
<tableX changed>". 

The problem is that if a window catch a "NOTIFY table1", another window of the same process, which must update too the
table1'sinformation, does not update due to the asynchronous notification to this backend has already been processed. 

Must I use a thread to each application's window?.

Must I do a central collect of notifies and raise the update of windows from there?. Yes, I think so.  :-)   However, I
needto know the exact type of notify which the backend gets: "NOTIFY table1",  "NOTIFY table2", or ... 

How could I differentiate from several types of "NOTIFY tableX" ?.

Which are the fields of the PGnotify* PgDatabase::Notifies() ?.


Note: You can see attached examples as C or C++ code which catch the NOTIFY from the data base doing a pool. To compile
iton Debian GNU/Linux (sid) you can do: 
gcc -o testlibpq2-C testlibpq2.c -I /usr/include/postgresql/ -lpq
g++ -o testlibpq2-C++ testlibpq2.cpp -I /usr/include/postgresql/ -lpq++


Regards,
Davi Leal

Вложения

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

Предыдущее
От: "Johnson, Shaunn"
Дата:
Сообщение: Re: table design strategy
Следующее
От: Marcelo Pereira
Дата:
Сообщение: Re: Sum