# Elastic PostgreSQL connector 8.12.2 with track\_commit\_timestamp off

**URL:** <https://discuss.elastic.co/t/elastic-postgresql-connector-8-12-2-with-track-commit-timestamp-off/377593>\
**Category:** Elasticsearch\
**Tags:** connectors\
**Created:** [April 29, 2025, 5:17am UTC](https://discuss.elastic.co/t/elastic-postgresql-connector-8-12-2-with-track-commit-timestamp-off/377593 "2025-04-29T05:17:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![apostolos.e](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apostolos.e/32/142868_2.png) [@apostolos.e](https://discuss.elastic.co/u/apostolos.e)\
**Post date:** [April 29, 2025, 5:17am UTC](https://discuss.elastic.co/t/elastic-postgresql-connector-8-12-2-with-track-commit-timestamp-off/377593/1 "2025-04-29T05:17:21Z")

</div>

Hi all,

I am using ELK 8.12.2 along with Elastic PostgreSQL connector 8.12.2. Both have been setup on premises, in my infra.

When track\_commit\_timestamp is off, the connector fails with:

```auto
DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.ObjectNotInPrerequisiteStateError'>: could not get commit timestamp data HINT: Make sure the configuration parameter "track_commit_timestamp" is set. [SQL: SELECT MAX(pg_xact_commit_timestamp(xmin)) FROM myschema."mytable"] (Background on this error at: https://sqlalche.me/e/20/dbapi).

```

My Postgres setup consists of Primary and Read-Only replicas and Elastic PostgreSQL connector 8.12.2 will be connected to one of the Read-Only replicas.

Billions of transactions take place in the database and I am concerned about enabling track\_commit\_timestamp. Enabling track\_commit\_timestamp will incur a cost of adding 12 bytes per transaction and this kind of data will be written inside $PostgresDir/main/pg\_commit\_ts. Postgres should truncate old data in pg\_commit\_ts during checkpoints and when old transactions ids are cleaned-up because of vacuuming. Despite that, I'd prefer not to enable track\_commit\_timestamp.

Is there any way to make Elastic Postgres Connector 8.12.2 not failing when track\_commit\_timestamp is off, even with the cost of indexing the same data on every connector sync? If there is a way to do that, then I will be deleting all documents from my index each time before the connector performs a full sync and keep track\_commit\_timestamp off in Postgres.

_I am aware about using alternative approaches like replacing Elastic Postgres Connector with Logstash._

Thank you,  
Apostolos

---

<div class="post-metadata">

**Author:** ![Jedr\_Blaszyk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jedr_blaszyk/32/127637_2.png) [@Jedr\_Blaszyk](https://discuss.elastic.co/u/Jedr_Blaszyk)\
**Post date:** [April 29, 2025, 6:47am UTC](https://discuss.elastic.co/t/elastic-postgresql-connector-8-12-2-with-track-commit-timestamp-off/377593/2 "2025-04-29T06:47:23Z")

</div>

Hey @apostolos.e yeah, the error occurs because the connector implementation tries to use `pg_xact_commit_timestamp` to track the last update time of tables (this is approach to be more efficient at subsequent syncs of data)

As of now, there is no way to disable this in the configuration. If you really want to disable this, you would need to edit the [connector implementation](https://github.com/elastic/connectors/blob/main/connectors/sources/postgresql.py) function that relies on the timestamp data:

```auto
class PostgreSQLClient:
    # ... other methods ...

    async def get_table_last_update_time(self, table):
        """Always returns current timestamp instead of querying for it"""
        return iso_utc()

```

> If there is a way to do that, then I will be deleting all documents from my index each time before the connector performs a full sync and keep

The connector should delete all your outdated docs anyway upon completing the full sync, so manual deletion of docs in index should not be needed.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![apostolos.e](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apostolos.e/32/142868_2.png) [@apostolos.e](https://discuss.elastic.co/u/apostolos.e)\
**Post date:** [April 29, 2025, 7:15am UTC](https://discuss.elastic.co/t/elastic-postgresql-connector-8-12-2-with-track-commit-timestamp-off/377593/3 "2025-04-29T07:15:04Z")

</div>

Much appreciated. Thank you
