Answer the question
In order to leave comments, you need to log in
How to receive notifications from the database when some table and/or field in the table is added/changed in the database?
How to receive notifications from the database when some table and/or field in the table is added/changed in the database? That is, the client uploads (Insert) or changes (Update) the data in the table, and an event is generated, to which another application is "subscribed" in some way, which spins right there on the same machine.
Any language, any database, but preferably PostgreSQL or MySQL. All that comes to mind is a poll after a short period of time using regular queries and comparing the new results with the result obtained last time. I think it's called Pulling? But this is how we torture the server. Or, as an option, monitor the physical files of the database using Watcher in Java, which can "see" events that signal a change in the file. notification
Answer the question
In order to leave comments, you need to log in
Postgres has a NOTIFY for this www.postgresql.org/docs/9.4/static/sql-notify.html
Correctly said, triggers.
As an option, create a trigger that inserts a row in a table with a log on the desired event.
An external script (by cron or daemon) works separately, which checks the table with the log for new entries and, depending on the type of entry, makes the necessary notifications.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question