# ES Update on PostgreSQL DB CRUD operations

**URL:** <https://discuss.elastic.co/t/es-update-on-postgresql-db-crud-operations/23787>\
**Category:** Elasticsearch\
**Created:** [June 16, 2015, 9:16pm UTC](https://discuss.elastic.co/t/es-update-on-postgresql-db-crud-operations/23787 "2015-06-16T21:16:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AkshataNaik](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AkshataNaik](https://discuss.elastic.co/u/AkshataNaik)\
**Post date:** [June 16, 2015, 9:16pm UTC](https://discuss.elastic.co/t/es-update-on-postgresql-db-crud-operations/23787/1 "2015-06-16T21:16:40Z")

</div>

Hi,

I am working in a production environment where a PostgreSQL DB stores all the date, and I pull all data into ES. Now I need to keep updating my ES DB to be in sync after CRUD on PostgreSQL. I see various methods of doing this but I am not very much convinced on the efficiency.

I have a Java program which indexes ES and also contacts PostgreSQL. Could anyone please suggest the best method of updating the DB? I know I can use timestamp to check for change in tables. But its seems inefficient- going through the entire record to check for time miss match. Also there is a problem with deleted entries.

Help appreciated ! Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:07am UTC](https://discuss.elastic.co/t/es-update-on-postgresql-db-crud-operations/23787/2 "2017-07-06T00:07:14Z")

</div>


