Package: pg-es-fdw
PostgreSQL Elastic Search foreign data wrapperThis allows you to index data in Elastic Search and then search it from
PostgreSQL. You can write as well as read.SYNOPSISSupported VersionsElastic SearchDependency Installation Command5sudo pip install "elasticsearch>=5,<6"6sudo pip install "elasticsearch>=6,<7"7sudo pip install "elasticsearch>=7,<8"PostgreSQLDependency Installation Command9.4sudo apt-get install postgresql-9.4-python-multicorn9.5sudo apt-get install postgresql-9.5-python-multicorn9.6sudo apt-get install postgresql-9.6-python-multicorn10sudo apt-get install postgresql-10-python-multicorn11sudo apt-get install postgresql-11-python-multicorn12sudo apt-get install postgresql-12-python3-multicorn13sudo apt-get install postgresql-13-python3-multicornPlease note that the Debian package for Multicorn on PostgreSQL 12+ requires Python 3.PostgreSQL 13+For PostgreSQL versions 13+ you can useMulticorn 2which is actively maintained. You can consult theMulticorn 2 READMEfor installation instructions, or review the Dockerfiles associated with this
project to see how I have installed it. I would recommend using the OSCG.IO
approach as it seems to be the easiest.PostgreSQLDockerfile13Dockerfile14Dockerfile15DockerfileInstallationThis requires installation on the PostgreSQL server, and has system level dependencies.
You can install the dependencies with:sudo apt-get install python python-pipYou should install the version of multicorn that is specific to your postgres
version. See the table inSupported Versionsfor installation commands. The
multicorn package is also only available from Ubuntu Xenial (16.04) onwards. If
you cannot install multicorn in this way then you can usepgxnto install it.This uses the Elastic Search client which has release versions that correspond
to the major version of the Elastic Search server. You should install theelasticsearchdependency separately. See the table inSupported Versionsfor installation commands.Once the dependencies are installed you can install the foreign data wrapper
using pip:sudo pip install pg_es_fdwUsageA running configuration for this can be found in thedocker-compose.ymlwithin this folder.The basic steps are:Load the extensionCreate the serverCreate the foreign tablePopulate the foreign tableQuery the foreign table...Load extension and Create serverCREATEEXTENSIONmulticorn;CREATESERVERmulticorn_esFOREIGNDATAWRAPPERmulticornOPTIONS(wrapper'pg_es_fdw.ElasticsearchFDW');Create the foreign tableCREATEFOREIGNTABLEarticles_es(idBIGINT,titleTEXT,bodyTEXT,metadataJSON,queryTEXT,scoreNUMERIC,sortTEXT)SERVERmulticorn_esOPTIONS(host'elasticsearch',port'9200',index'article-index',type'article',rowid_column'id',query_column'query',query_dsl'false',score_column'score',default_sort'last_updated:desc',sort_column'sort',refresh'false',complete_returning'false',timeout'20',username'elastic',password'changeme');Elastic Search 7 and greater does not require thetypeoption, which
corresponds to thedoc_typeused in prior versions of Elastic Search.This corresponds to an Elastic Search index which contains atitleandbodyfields. The other fields have special meaning:Therowid_column(idabove) is mapped to the Elastic Search document idThequery_column(queryabove) accepts Elastic Search queries to filter the rowsThequery_dsl(falseabove) indicates if the query is in theURI Searchsyntax or the jsonQuery DSL. The query will use the URI Search syntax by default. To use the Query DSL set this option to"true".Thescore_column(scoreabove) returns the score for the document against the queryThesort_column(sortabove) accepts an Elastic Search column to sort byTherefreshoption controls if inserts and updates should wait for an index refresh (Elastic Search documentation). The acceptable values are"false"(default),"wait_for"and"true"Thecomplete_returningoptions controls if Elastic Search is queries for the document after an insert to supportRETURNINGfields other than the document id. The acceptable values are"false"(default) and"true"Thetimeoutfield specifies the connection timeout in secondsTheusernamefield specifies the basic auth username usedThepasswordfield specifies the basic auth password usedAny other options are passed through to the elasticsearch client, use this to specify things like sslAll of these are optional.
Enablingrefreshorcomplete_returningcomes with a performance penalty.To use basic auth you must provide both a username and a password,
even if the password is blank.JSON and JSONBWhen elasticsearch returns nested data it is serialized to TEXT as json before being returned.
This means you can create columns with JSON or JSONB types and the data will be correctly converted on read.
If you write to a JSON or JSONB column then the data is passed to elasticsearch as json.As the data is converted on the fly per query the benefits of using JSONB over JSON are limited.Elastic Search AuthenticationCurrently basic auth is supported for authentication.
You can provide the username and password by setting theusernameandpasswordoptions when creating the table.
You must provide both, even if the password is blank.
If you do not provide them then basic auth is disabled for the table.If you need to use other forms of authentication then please open an issue.Populate the foreign tableINSERTINTOarticles_es(id,title,body,metadata)VALUES(1,'foo','spike','{"score": 3}'::json);It is possible to write documents to Elastic Search using the foreign data
wrapper. This feature was introduced in PostgreSQL 9.3.Query the foreign tableTo select all documents:SELECTid,title,body,metadataFROMarticles_es;URI Search QueryTo filter the documents using a URI Search query:SELECTid,title,body,metadata,scoreFROMarticles_esWHEREquery='body:chess';This uses theURI Searchfrom Elastic Search.
This is the default search syntax, and can be explicitly selected by setting thequery_dsloption to"false".Query DSL QueryTo filter the documents using a Query DSL query you must ensure that you have set thequery_dsloption to"true"when creating the table.SELECTid,title,body,metadata,scoreFROMarticles_esWHEREquery='{"query":{"bool":{"filter":[{"term":{"body":"chess"}}]}}}';This uses theQuery DSLfrom Elastic Search.
This is not the default search syntax and must be specifically enabled.
You cannot enable this on a per-query basis.Sorting the ResultsBy default Elastic Search returns the documents in score order, descending.
If you wish to sort by a different field you can use thesort_columnoption.Thesort_columnaccepts a column to sort by and a direction, for examplelast_updated:desc.
This is passed to Elastic Search so it should be the name of the Elastic Search column.
If you always want sorted results then you can use thedefault_sortoption to specify the sort when creating the table.To break ties you can specify further columns to sort on.
You just need to separate the columns with a comma, for exampleunit:asc,last_updated:desc.SELECT
    id,
    title,
    body,
    metadata,
    score
FROM
    articles_es
WHERE
    sort = 'id:asc'
;Refresh and RETURNINGWhen inserting or updating documents in Elastic Search the document ID is returned.
This can be accessed through theRETURNINGstatement without any additional performance loss.To get further fields requires reading the document from Elastic Search again.
This comes at a cost because an immediate read after an insert may not return the updated document.
Elastic Search periodically refreshes the indexes and at that point the document will be available.To wait for a refresh before returning you can use therefreshparameter.
This accepts three values:"false"(the default),"true"and"wait_for".
You can read about themhere.
If you choose to use the refresh setting then it is recommended to use"wait_for".Once you have chosen to wait for the refresh you can enable full returning support by settingcomplete_returningto"true".
Both therefreshandcomplete_returningoptions are set during table creation.
If you do not wish to incur the associated costs for every query then you can create two tables with different settings.CaveatsElastic Search does not support transactions, so the elasticsearch index
is not guaranteed to be synchronized with the canonical version in PostgreSQL.
Unfortunately this is the case even for serializable isolation level transactions.
It would however be possible to check against Elastic Search version field and locking.Rollback is currently not supported.TestsThere are end to end tests that use docker to create a PostgreSQL and Elastic
Search database. These are then populated with data and tests are run against
them.These require docker and docker-compose. These also require python packages
which you can install with:pipinstall-rtests/requirements.txtThe makefile will test all versions if you runmake test:➜maketestpoetryruntests/run.py--pg9.49.59.610111213--es566-auth7TestingPostgreSQL9.4withElasticsearch5PostgreSQL9.4withElasticsearch5:Testread-PASS
PostgreSQL9.4withElasticsearch5:Testnested-read-PASS
PostgreSQL9.4withElasticsearch5:Testsorted-read-PASS
PostgreSQL9.4withElasticsearch5:Testquery-PASS
PostgreSQL9.4withElasticsearch5:Testjson-query-PASS
PostgreSQL9.4withElasticsearch5:Testinsertreturningid-PASS
PostgreSQL9.4withElasticsearch5:Testinsertreturningrow-PASS
PostgreSQL9.4withElasticsearch5:Testinsertwaitingforrefresh-PASS
PostgreSQL9.4withElasticsearch5:Testdeletereturningrow-PASS
TestingPostgreSQL9.4withElasticsearch6PostgreSQL9.4withElasticsearch6:Testread-PASS
PostgreSQL9.4withElasticsearch6:Testnested-read-PASS
PostgreSQL9.4withElasticsearch6:Testsorted-read-PASS
PostgreSQL9.4withElasticsearch6:Testquery-PASS
PostgreSQL9.4withElasticsearch6:Testjson-query-PASS
PostgreSQL9.4withElasticsearch6:Testinsertreturningid-PASS
PostgreSQL9.4withElasticsearch6:Testinsertreturningrow-PASS
PostgreSQL9.4withElasticsearch6:Testinsertwaitingforrefresh-PASS
PostgreSQL9.4withElasticsearch6:Testdeletereturningrow-PASS
TestingPostgreSQL9.4withElasticsearch6-auth
PostgreSQL9.4withElasticsearch6-auth:Testread-PASS
PostgreSQL9.4withElasticsearch6-auth:Testnested-read-PASS
PostgreSQL9.4withElasticsearch6-auth:Testsorted-read-PASS
PostgreSQL9.4withElasticsearch6-auth:Testquery-PASS
PostgreSQL9.4withElasticsearch6-auth:Testjson-query-PASS
PostgreSQL9.4withElasticsearch6-auth:Testinsertreturningid-PASS
PostgreSQL9.4withElasticsearch6-auth:Testinsertreturningrow-PASS
PostgreSQL9.4withElasticsearch6-auth:Testinsertwaitingforrefresh-PASS
PostgreSQL9.4withElasticsearch6-auth:Testdeletereturningrow-PASS
TestingPostgreSQL9.4withElasticsearch7PostgreSQL9.4withElasticsearch7:Testread-PASS
PostgreSQL9.4withElasticsearch7:Testnested-read-PASS
PostgreSQL9.4withElasticsearch7:Testsorted-read-PASS
PostgreSQL9.4withElasticsearch7:Testquery-PASS
PostgreSQL9.4withElasticsearch7:Testjson-query-PASS
PostgreSQL9.4withElasticsearch7:Testinsertreturningid-PASS
PostgreSQL9.4withElasticsearch7:Testinsertreturningrow-PASS
PostgreSQL9.4withElasticsearch7:Testinsertwaitingforrefresh-PASS
PostgreSQL9.4withElasticsearch7:Testdeletereturningrow-PASS
TestingPostgreSQL9.5withElasticsearch5PostgreSQL9.5withElasticsearch5:Testread-PASS
PostgreSQL9.5withElasticsearch5:Testnested-read-PASS
PostgreSQL9.5withElasticsearch5:Testsorted-read-PASS
PostgreSQL9.5withElasticsearch5:Testquery-PASS
PostgreSQL9.5withElasticsearch5:Testjson-query-PASS
PostgreSQL9.5withElasticsearch5:Testinsertreturningid-PASS
PostgreSQL9.5withElasticsearch5:Testinsertreturningrow-PASS
PostgreSQL9.5withElasticsearch5:Testinsertwaitingforrefresh-PASS
PostgreSQL9.5withElasticsearch5:Testdeletereturningrow-PASS
TestingPostgreSQL9.5withElasticsearch6PostgreSQL9.5withElasticsearch6:Testread-PASS
PostgreSQL9.5withElasticsearch6:Testnested-read-PASS
PostgreSQL9.5withElasticsearch6:Testsorted-read-PASS
PostgreSQL9.5withElasticsearch6:Testquery-PASS
PostgreSQL9.5withElasticsearch6:Testjson-query-PASS
PostgreSQL9.5withElasticsearch6:Testinsertreturningid-PASS
PostgreSQL9.5withElasticsearch6:Testinsertreturningrow-PASS
PostgreSQL9.5withElasticsearch6:Testinsertwaitingforrefresh-PASS
PostgreSQL9.5withElasticsearch6:Testdeletereturningrow-PASS
TestingPostgreSQL9.5withElasticsearch6-auth
PostgreSQL9.5withElasticsearch6-auth:Testread-PASS
PostgreSQL9.5withElasticsearch6-auth:Testnested-read-PASS
PostgreSQL9.5withElasticsearch6-auth:Testsorted-read-PASS
PostgreSQL9.5withElasticsearch6-auth:Testquery-PASS
PostgreSQL9.5withElasticsearch6-auth:Testjson-query-PASS
PostgreSQL9.5withElasticsearch6-auth:Testinsertreturningid-PASS
PostgreSQL9.5withElasticsearch6-auth:Testinsertreturningrow-PASS
PostgreSQL9.5withElasticsearch6-auth:Testinsertwaitingforrefresh-PASS
PostgreSQL9.5withElasticsearch6-auth:Testdeletereturningrow-PASS
TestingPostgreSQL9.5withElasticsearch7PostgreSQL9.5withElasticsearch7:Testread-PASS
PostgreSQL9.5withElasticsearch7:Testnested-read-PASS
PostgreSQL9.5withElasticsearch7:Testsorted-read-PASS
PostgreSQL9.5withElasticsearch7:Testquery-PASS
PostgreSQL9.5withElasticsearch7:Testjson-query-PASS
PostgreSQL9.5withElasticsearch7:Testinsertreturningid-PASS
PostgreSQL9.5withElasticsearch7:Testinsertreturningrow-PASS
PostgreSQL9.5withElasticsearch7:Testinsertwaitingforrefresh-PASS
PostgreSQL9.5withElasticsearch7:Testdeletereturningrow-PASS
TestingPostgreSQL9.6withElasticsearch5PostgreSQL9.6withElasticsearch5:Testread-PASS
PostgreSQL9.6withElasticsearch5:Testnested-read-PASS
PostgreSQL9.6withElasticsearch5:Testsorted-read-PASS
PostgreSQL9.6withElasticsearch5:Testquery-PASS
PostgreSQL9.6withElasticsearch5:Testjson-query-PASS
PostgreSQL9.6withElasticsearch5:Testinsertreturningid-PASS
PostgreSQL9.6withElasticsearch5:Testinsertreturningrow-PASS
PostgreSQL9.6withElasticsearch5:Testinsertwaitingforrefresh-PASS
PostgreSQL9.6withElasticsearch5:Testdeletereturningrow-PASS
TestingPostgreSQL9.6withElasticsearch6PostgreSQL9.6withElasticsearch6:Testread-PASS
PostgreSQL9.6withElasticsearch6:Testnested-read-PASS
PostgreSQL9.6withElasticsearch6:Testsorted-read-PASS
PostgreSQL9.6withElasticsearch6:Testquery-PASS
PostgreSQL9.6withElasticsearch6:Testjson-query-PASS
PostgreSQL9.6withElasticsearch6:Testinsertreturningid-PASS
PostgreSQL9.6withElasticsearch6:Testinsertreturningrow-PASS
PostgreSQL9.6withElasticsearch6:Testinsertwaitingforrefresh-PASS
PostgreSQL9.6withElasticsearch6:Testdeletereturningrow-PASS
TestingPostgreSQL9.6withElasticsearch6-auth
PostgreSQL9.6withElasticsearch6-auth:Testread-PASS
PostgreSQL9.6withElasticsearch6-auth:Testnested-read-PASS
PostgreSQL9.6withElasticsearch6-auth:Testsorted-read-PASS
PostgreSQL9.6withElasticsearch6-auth:Testquery-PASS
PostgreSQL9.6withElasticsearch6-auth:Testjson-query-PASS
PostgreSQL9.6withElasticsearch6-auth:Testinsertreturningid-PASS
PostgreSQL9.6withElasticsearch6-auth:Testinsertreturningrow-PASS
PostgreSQL9.6withElasticsearch6-auth:Testinsertwaitingforrefresh-PASS
PostgreSQL9.6withElasticsearch6-auth:Testdeletereturningrow-PASS
TestingPostgreSQL9.6withElasticsearch7PostgreSQL9.6withElasticsearch7:Testread-PASS
PostgreSQL9.6withElasticsearch7:Testnested-read-PASS
PostgreSQL9.6withElasticsearch7:Testsorted-read-PASS
PostgreSQL9.6withElasticsearch7:Testquery-PASS
PostgreSQL9.6withElasticsearch7:Testjson-query-PASS
PostgreSQL9.6withElasticsearch7:Testinsertreturningid-PASS
PostgreSQL9.6withElasticsearch7:Testinsertreturningrow-PASS
PostgreSQL9.6withElasticsearch7:Testinsertwaitingforrefresh-PASS
PostgreSQL9.6withElasticsearch7:Testdeletereturningrow-PASS
TestingPostgreSQL10withElasticsearch5PostgreSQL10withElasticsearch5:Testread-PASS
PostgreSQL10withElasticsearch5:Testnested-read-PASS
PostgreSQL10withElasticsearch5:Testsorted-read-PASS
PostgreSQL10withElasticsearch5:Testquery-PASS
PostgreSQL10withElasticsearch5:Testjson-query-PASS
PostgreSQL10withElasticsearch5:Testinsertreturningid-PASS
PostgreSQL10withElasticsearch5:Testinsertreturningrow-PASS
PostgreSQL10withElasticsearch5:Testinsertwaitingforrefresh-PASS
PostgreSQL10withElasticsearch5:Testdeletereturningrow-PASS
TestingPostgreSQL10withElasticsearch6PostgreSQL10withElasticsearch6:Testread-PASS
PostgreSQL10withElasticsearch6:Testnested-read-PASS
PostgreSQL10withElasticsearch6:Testsorted-read-PASS
PostgreSQL10withElasticsearch6:Testquery-PASS
PostgreSQL10withElasticsearch6:Testjson-query-PASS
PostgreSQL10withElasticsearch6:Testinsertreturningid-PASS
PostgreSQL10withElasticsearch6:Testinsertreturningrow-PASS
PostgreSQL10withElasticsearch6:Testinsertwaitingforrefresh-PASS
PostgreSQL10withElasticsearch6:Testdeletereturningrow-PASS
TestingPostgreSQL10withElasticsearch6-auth
PostgreSQL10withElasticsearch6-auth:Testread-PASS
PostgreSQL10withElasticsearch6-auth:Testnested-read-PASS
PostgreSQL10withElasticsearch6-auth:Testsorted-read-PASS
PostgreSQL10withElasticsearch6-auth:Testquery-PASS
PostgreSQL10withElasticsearch6-auth:Testjson-query-PASS
PostgreSQL10withElasticsearch6-auth:Testinsertreturningid-PASS
PostgreSQL10withElasticsearch6-auth:Testinsertreturningrow-PASS
PostgreSQL10withElasticsearch6-auth:Testinsertwaitingforrefresh-PASS
PostgreSQL10withElasticsearch6-auth:Testdeletereturningrow-PASS
TestingPostgreSQL10withElasticsearch7PostgreSQL10withElasticsearch7:Testread-PASS
PostgreSQL10withElasticsearch7:Testnested-read-PASS
PostgreSQL10withElasticsearch7:Testsorted-read-PASS
PostgreSQL10withElasticsearch7:Testquery-PASS
PostgreSQL10withElasticsearch7:Testjson-query-PASS
PostgreSQL10withElasticsearch7:Testinsertreturningid-PASS
PostgreSQL10withElasticsearch7:Testinsertreturningrow-PASS
PostgreSQL10withElasticsearch7:Testinsertwaitingforrefresh-PASS
PostgreSQL10withElasticsearch7:Testdeletereturningrow-PASS
TestingPostgreSQL11withElasticsearch5PostgreSQL11withElasticsearch5:Testread-PASS
PostgreSQL11withElasticsearch5:Testnested-read-PASS
PostgreSQL11withElasticsearch5:Testsorted-read-PASS
PostgreSQL11withElasticsearch5:Testquery-PASS
PostgreSQL11withElasticsearch5:Testjson-query-PASS
PostgreSQL11withElasticsearch5:Testinsertreturningid-PASS
PostgreSQL11withElasticsearch5:Testinsertreturningrow-PASS
PostgreSQL11withElasticsearch5:Testinsertwaitingforrefresh-PASS
PostgreSQL11withElasticsearch5:Testdeletereturningrow-PASS
TestingPostgreSQL11withElasticsearch6PostgreSQL11withElasticsearch6:Testread-PASS
PostgreSQL11withElasticsearch6:Testnested-read-PASS
PostgreSQL11withElasticsearch6:Testsorted-read-PASS
PostgreSQL11withElasticsearch6:Testquery-PASS
PostgreSQL11withElasticsearch6:Testjson-query-PASS
PostgreSQL11withElasticsearch6:Testinsertreturningid-PASS
PostgreSQL11withElasticsearch6:Testinsertreturningrow-PASS
PostgreSQL11withElasticsearch6:Testinsertwaitingforrefresh-PASS
PostgreSQL11withElasticsearch6:Testdeletereturningrow-PASS
TestingPostgreSQL11withElasticsearch6-auth
PostgreSQL11withElasticsearch6-auth:Testread-PASS
PostgreSQL11withElasticsearch6-auth:Testnested-read-PASS
PostgreSQL11withElasticsearch6-auth:Testsorted-read-PASS
PostgreSQL11withElasticsearch6-auth:Testquery-PASS
PostgreSQL11withElasticsearch6-auth:Testjson-query-PASS
PostgreSQL11withElasticsearch6-auth:Testinsertreturningid-PASS
PostgreSQL11withElasticsearch6-auth:Testinsertreturningrow-PASS
PostgreSQL11withElasticsearch6-auth:Testinsertwaitingforrefresh-PASS
PostgreSQL11withElasticsearch6-auth:Testdeletereturningrow-PASS
TestingPostgreSQL11withElasticsearch7PostgreSQL11withElasticsearch7:Testread-PASS
PostgreSQL11withElasticsearch7:Testnested-read-PASS
PostgreSQL11withElasticsearch7:Testsorted-read-PASS
PostgreSQL11withElasticsearch7:Testquery-PASS
PostgreSQL11withElasticsearch7:Testjson-query-PASS
PostgreSQL11withElasticsearch7:Testinsertreturningid-PASS
PostgreSQL11withElasticsearch7:Testinsertreturningrow-PASS
PostgreSQL11withElasticsearch7:Testinsertwaitingforrefresh-PASS
PostgreSQL11withElasticsearch7:Testdeletereturningrow-PASS
TestingPostgreSQL12withElasticsearch5PostgreSQL12withElasticsearch5:Testread-PASS
PostgreSQL12withElasticsearch5:Testnested-read-PASS
PostgreSQL12withElasticsearch5:Testsorted-read-PASS
PostgreSQL12withElasticsearch5:Testquery-PASS
PostgreSQL12withElasticsearch5:Testjson-query-PASS
PostgreSQL12withElasticsearch5:Testinsertreturningid-PASS
PostgreSQL12withElasticsearch5:Testinsertreturningrow-PASS
PostgreSQL12withElasticsearch5:Testinsertwaitingforrefresh-PASS
PostgreSQL12withElasticsearch5:Testdeletereturningrow-PASS
TestingPostgreSQL12withElasticsearch6PostgreSQL12withElasticsearch6:Testread-PASS
PostgreSQL12withElasticsearch6:Testnested-read-PASS
PostgreSQL12withElasticsearch6:Testsorted-read-PASS
PostgreSQL12withElasticsearch6:Testquery-PASS
PostgreSQL12withElasticsearch6:Testjson-query-PASS
PostgreSQL12withElasticsearch6:Testinsertreturningid-PASS
PostgreSQL12withElasticsearch6:Testinsertreturningrow-PASS
PostgreSQL12withElasticsearch6:Testinsertwaitingforrefresh-PASS
PostgreSQL12withElasticsearch6:Testdeletereturningrow-PASS
TestingPostgreSQL12withElasticsearch6-auth
PostgreSQL12withElasticsearch6-auth:Testread-PASS
PostgreSQL12withElasticsearch6-auth:Testnested-read-PASS
PostgreSQL12withElasticsearch6-auth:Testsorted-read-PASS
PostgreSQL12withElasticsearch6-auth:Testquery-PASS
PostgreSQL12withElasticsearch6-auth:Testjson-query-PASS
PostgreSQL12withElasticsearch6-auth:Testinsertreturningid-PASS
PostgreSQL12withElasticsearch6-auth:Testinsertreturningrow-PASS
PostgreSQL12withElasticsearch6-auth:Testinsertwaitingforrefresh-PASS
PostgreSQL12withElasticsearch6-auth:Testdeletereturningrow-PASS
TestingPostgreSQL12withElasticsearch7PostgreSQL12withElasticsearch7:Testread-PASS
PostgreSQL12withElasticsearch7:Testnested-read-PASS
PostgreSQL12withElasticsearch7:Testsorted-read-PASS
PostgreSQL12withElasticsearch7:Testquery-PASS
PostgreSQL12withElasticsearch7:Testjson-query-PASS
PostgreSQL12withElasticsearch7:Testinsertreturningid-PASS
PostgreSQL12withElasticsearch7:Testinsertreturningrow-PASS
PostgreSQL12withElasticsearch7:Testinsertwaitingforrefresh-PASS
PostgreSQL12withElasticsearch7:Testdeletereturningrow-PASS
TestingPostgreSQL13withElasticsearch5PostgreSQL13withElasticsearch5:Testread-PASS
PostgreSQL13withElasticsearch5:Testnested-read-PASS
PostgreSQL13withElasticsearch5:Testsorted-read-PASS
PostgreSQL13withElasticsearch5:Testquery-PASS
PostgreSQL13withElasticsearch5:Testjson-query-PASS
PostgreSQL13withElasticsearch5:Testinsertreturningid-PASS
PostgreSQL13withElasticsearch5:Testinsertreturningrow-PASS
PostgreSQL13withElasticsearch5:Testinsertwaitingforrefresh-PASS
PostgreSQL13withElasticsearch5:Testdeletereturningrow-PASS
TestingPostgreSQL13withElasticsearch6PostgreSQL13withElasticsearch6:Testread-PASS
PostgreSQL13withElasticsearch6:Testnested-read-PASS
PostgreSQL13withElasticsearch6:Testsorted-read-PASS
PostgreSQL13withElasticsearch6:Testquery-PASS
PostgreSQL13withElasticsearch6:Testjson-query-PASS
PostgreSQL13withElasticsearch6:Testinsertreturningid-PASS
PostgreSQL13withElasticsearch6:Testinsertreturningrow-PASS
PostgreSQL13withElasticsearch6:Testinsertwaitingforrefresh-PASS
PostgreSQL13withElasticsearch6:Testdeletereturningrow-PASS
TestingPostgreSQL13withElasticsearch6-auth
PostgreSQL13withElasticsearch6-auth:Testread-PASS
PostgreSQL13withElasticsearch6-auth:Testnested-read-PASS
PostgreSQL13withElasticsearch6-auth:Testsorted-read-PASS
PostgreSQL13withElasticsearch6-auth:Testquery-PASS
PostgreSQL13withElasticsearch6-auth:Testjson-query-PASS
PostgreSQL13withElasticsearch6-auth:Testinsertreturningid-PASS
PostgreSQL13withElasticsearch6-auth:Testinsertreturningrow-PASS
PostgreSQL13withElasticsearch6-auth:Testinsertwaitingforrefresh-PASS
PostgreSQL13withElasticsearch6-auth:Testdeletereturningrow-PASS
TestingPostgreSQL13withElasticsearch7PostgreSQL13withElasticsearch7:Testread-PASS
PostgreSQL13withElasticsearch7:Testnested-read-PASS
PostgreSQL13withElasticsearch7:Testsorted-read-PASS
PostgreSQL13withElasticsearch7:Testquery-PASS
PostgreSQL13withElasticsearch7:Testjson-query-PASS
PostgreSQL13withElasticsearch7:Testinsertreturningid-PASS
PostgreSQL13withElasticsearch7:Testinsertreturningrow-PASS
PostgreSQL13withElasticsearch7:Testinsertwaitingforrefresh-PASS
PostgreSQL13withElasticsearch7:Testdeletereturningrow-PASS
PASSIf you want to run the tests for specific versions then you can then run the
tests usingtests/run.py.  This takes the PostgreSQL version(s) to test using
the--pgargument and the Elastic Search versions to test with the--esargument.  The currently supported versions of PostgreSQL are 9.4 through to 13.
The currently supported versions of Elastic Search are 5 to 7. You can pass
multiple versions to test it against all of them.Test Failure MessagesError starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in useYou are already running something that listens to 5432.
Try stopping your running postgres server:sudo /etc/init.d/postgresql stopmax virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]Your system does not have the appropriate limits in place to run a production ready instance of elasticsearch.
Try increasing it:sudo sysctl -w vm.max_map_count=262144This setting will revert after a reboot.Migrating from <=0.6.0In version 0.7.0 the TEXT representation of json objects changed from HSTORE to JSON.
If you have been mapping json objects to HSTORE columns then you should change the column type to JSON.
The arrow operator exists for json so queries should not need rewriting.