Fixes https://emqx.atlassian.net/browse/EMQX-10629 During health checking, we check whether tables in the SQL statement exist. Such check was done by asking the backend to parse the statement using a named prepared statements. Concurrent health checks could then result in the error: ```erlang {error,{error,error,<<"42P05">>,duplicate_prepared_statement,<<"prepared statement \"get_status\" already exists">>,[{file,<<"prepare.c">>},{line,<<"451">>},{routine,<<"StorePreparedStatement">>},{severity,<<"ERROR">>}]}} ``` This could lead to an inconsistent state in the driver process, which would crash later when a message from the backend (`READY_FOR_QUERY`, "idle"): ``` 2023-07-24T13:05:58.892043+00:00 [error] Generic server <0.2134.0> terminating. Reason: {'module could not be loaded',[{undefined,handle_message,[90,<<"I">>,... ``` Added calls to `epgsql:sync/1` for functions that could return `{error, sync_required}`. Also, redundant calls to `parse2` were removed to reduce the number of requests. |
||
|---|---|---|
| .. | ||
| src | ||
| test | ||
| BSL.txt | ||
| docker-ct | ||
| README.md | ||
| rebar.config | ||
EMQX PostgreSQL Bridge
PostgreSQL is an open-source relational database management system (RDBMS) that uses and extends the SQL language. It is known for its reliability, data integrity, and advanced features such as support for JSON, XML, and other data formats.
The application is used to connect EMQX and PostgreSQL. User can create a rule and easily ingest IoT data into PostgreSQL by leveraging EMQX Rules.
Documentation
-
Refer to Ingest Data into PostgreSQL for how to use EMQX dashboard to ingest IoT data into PostgreSQL.
-
Refer to EMQX Rules for the EMQX rules engine introduction.
HTTP APIs
-
Several APIs are provided for bridge management, which includes create bridge, update bridge, get bridge, stop or restart bridge and list bridges etc.
Refer to API Docs - Bridges for more detailed information.
Contributing
Please see our contributing.md.
License
EMQ Business Source License 1.1, refer to LICENSE.