Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Is there a way to sync Postgresql Views with Elasticsearch? #275

@vijeandran

Description

@vijeandran

PGSync version: 2.2.1

Postgres version: 13.6

Elasticsearch version: 8.1.0

Redis version: 5.0.7

Python version: 3.8.3

Problem Description:
I have created an index in Elasticsearch for Postgresql Views. Whenever I do changes in the Postgres View table, the same changes have to happen in the Elasticsearch index. I tried running the command pgsync with schema.json and got the below error.
Is there a way to sync Postgresql Views with Elasticsearch? Because this is my requirement.

Error Message (if any):

$ pgsync --config /home/vijee/Elastic/schema.json
 - dept_cmpy


2022-03-29 12:50:09.632:ERROR:pgsync.elastichelper: Exception (psycopg2.errors.UndefinedColumn) column dept_cmpy_1.xmin does not exist
LINE 3: WHERE CAST(CAST(dept_cmpy_1.xmin AS TEXT) AS BIGINT) < 699
                        ^

[SQL: SELECT count(*) AS count_1 
FROM public.dept_cmpy AS dept_cmpy_1 
WHERE CAST(CAST(dept_cmpy_1.xmin AS TEXT) AS BIGINT) < %(param_1)s]
[parameters: {'param_1': 699}]
(Background on this error at: https://sqlalche.me/e/14/f405)
Traceback (most recent call last):
  File "/home/vijee/anaconda3/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1802, in _execute_context
    self.dialect.do_execute(
  File "/home/vijee/anaconda3/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.UndefinedColumn: column dept_cmpy_1.xmin does not exist
LINE 3: WHERE CAST(CAST(dept_cmpy_1.xmin AS TEXT) AS BIGINT) < 699


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions