V
V
vyn2019-12-09 13:26:32
PostgreSQL
vyn, 2019-12-09 13:26:32

Is there a way to get a postgresql table state update by an external java process?

Preconditions: there is a periodically growing table in postgresql and a java process in which we would like to process newly received data
. Assumption: it is not rational to request data from this table from a java process and check them.
Question: Is there a way to subscribe a java process to table updates?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2019-12-09
@vyn

https://www.postgresql.org/docs/current/logicaldec...
Logical Decoding Framework.
Either you write to pgq as a trigger, your application reads the pgq queue. It's much easier.

S
Sergey Gornostaev, 2019-12-09
@sergey-gornostaev

Make a trigger send NOTIFY on changes and execute LISTEN in the program .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question