# Detecting Postgresql Table Change for LiveView

**URL:** <https://forum.devtalk.com/t/detecting-postgresql-table-change-for-liveview/1114>\
**Category:** Frontend Chat/Discussions\
**Tags:** postgres, liveview\
**Created:** [18 July 2020 15:01 UTC](https://forum.devtalk.com/t/detecting-postgresql-table-change-for-liveview/1114 "2020-07-18T15:01:00Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Exadra37](https://forum.devtalk.com/user_avatar/forum.devtalk.com/exadra37/32/683_2.png) [@Exadra37](https://forum.devtalk.com/u/Exadra37)\
**Post date:** [19 July 2020 09:23 UTC](https://forum.devtalk.com/t/detecting-postgresql-table-change-for-liveview/1114/6 "2020-07-19T09:23:10Z")

</div>

> [@michael](#):
>
> So I have a table of MediaItems and when that list changes, say new entries, I’d like LiveView to know about that so that the Timeline updates automatically. How to know when the table updates?

You use Phoenix PubSub to broadcast them each time you create, update or delete them.

Then in the `handle_info` on your live view you can use [send\_update/2](https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#send_update/2) to update the client.

Some useful links:

- [Phoenix LiveView Tutorial: PubSub and Pow Authentication | Curiosum](https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-3)
- [Building Real-Time Features with Phoenix Live View and PubSub | Blog · Elixir School](https://elixirschool.com/blog/live-view-with-pub-sub/)

---

_[View the full topic](https://forum.devtalk.com/t/detecting-postgresql-table-change-for-liveview/1114)._
