# How to integrate Elasticsearch and PgSQL?

**URL:** <https://discuss.elastic.co/t/how-to-integrate-elasticsearch-and-pgsql/171494>\
**Category:** Elasticsearch\
**Created:** [March 8, 2019, 12:45pm UTC](https://discuss.elastic.co/t/how-to-integrate-elasticsearch-and-pgsql/171494 "2019-03-08T12:45:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danyal\_Tarik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danyal_tarik/32/41854_2.png) [@Danyal\_Tarik](https://discuss.elastic.co/u/Danyal_Tarik)\
**Post date:** [March 8, 2019, 12:45pm UTC](https://discuss.elastic.co/t/how-to-integrate-elasticsearch-and-pgsql/171494/1 "2019-03-08T12:45:33Z")

</div>

I have to push data from PgSQL to Elasticsearch? Any other method than CLI for indexing

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 8, 2019, 1:16pm UTC](https://discuss.elastic.co/t/how-to-integrate-elasticsearch-and-pgsql/171494/2 "2019-03-08T13:16:30Z")

</div>

I shared most of my thoughts there: [http://david.pilato.fr/blog/2015/05/09/advanced-search-for-your-legacy-application/](http://david.pilato.fr/blog/2015/05/09/advanced-search-for-your-legacy-application/)

Basically, I'd recommend modifying the application layer if possible and send data to elasticsearch in the same "transaction" as you are sending your data to the database.

But you can also use Logstash JDBC input.

---

<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:** [April 5, 2019, 1:16pm UTC](https://discuss.elastic.co/t/how-to-integrate-elasticsearch-and-pgsql/171494/3 "2019-04-05T13:16:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
