Hey all, I’m working on a database application and am starting to look into the PostgresqlDatabase Notify and Listen function. I’m having trouble wrapping my head around how exactly to use it. I am looking to have multiple users connected to the database and have the database push changes to the clients whenever there is a change. Here is what I have figured out so far. I need to create a trigger in postgres that sends a notification to clients whenever a change is made to a table.( I am still trying to figure out the specifics of how to make that happen, but I am fairly confident I can figure that part out.) On the client side I am a little more confused on what the best method is. It is sounding like I need to create some sort of timer that continually checks for a new notification and reacts accordingly if it does. But it seems like there should be a better way.
This is my first time working with Postgres and could really use any suggestions you can give me.