Skip to content
← Back to activity

Solution skill

PostgreSQL client interface errors

Version 2Sign in to save

Complete solution

Fixes QuestDB 8.2.0 PGWire corruption when text and binary protocol clients (e.g. JDBC and psql) connect concurrently. Workaround: set pg.legacy.mode.enabled to true; or upgrade to 8.2.1. Use when PostgreSQL client errors appear randomly under mixed clients. Not for single-client setups.

Fix first: the PGWire corruption in QuestDB 8.2.0 happens when text and binary protocol clients (e.g. JDBC and psql) connect concurrently. Workaround it or upgrade.

  1. Set pg.legacy.mode.enabled to true. The reporter confirmed no more issues after upgrading to 8.2.1, so upgrading is the cleaner fix.
  2. Expected: the random client interface errors stop.

When to use: PostgreSQL client errors appear randomly when querying QuestDB with mixed text and binary protocol clients.

When not to use: a single client type (the corruption needs the concurrency).

Compatibility: QuestDB 8.2.0 (broken), 8.2.1 (fixed). Contributor mtopolnik. Reported in questdb/questdb#5202.

Variants:

  • "questdb postgresql client interface errors"
  • "questdb pgwire corruption"
  • "questdb 8.2.0 jdbc psql concurrent"

Root cause: PGWire corruption under concurrent text and binary protocol clients.

Edge cases: the PG interface is exposed at port 8812 in the docker image; the bug is in the wire handling, not your client config.

Evidence

In gh:questdb/questdb#5202 the issue was: Issue questdb/questdb#5202 (closed, 21 comments): ### To reproduce To create and init a sample table: ``sql CREATE TABLE bugtest( timestamp TIMESTAMP, symbol SYMBOL, price DOUBLE, amount DOUBLE ) TIMESTAMP(timestamp) PARTITION BY DAY; INSERT INTO bugtest VALUES ('2021-10-05T11:31:35.878Z', 'AAPL', 245, 123.4), ('2021-10-05T12:31:35.878Z', 'AAPL', 245, 123.3), ('2021-10-05T13:31:35.878Z', 'AAPL', 250, 123.1), ('2021-10-05T14:31:35.878Z', 'AAPL', 250, 123.0); `` The problem appears sometime, randomly, when query from a client using PostgreSQL driver (exposed at port 8812 in the docker image). The verified answer: [mtopolnik (contributor)]: The PGWire corruption in QuestDB 8.2.0 happens when text and binary protocol clients (e.g. JDBC and psql) connect concurrently. Workaround: pg.legacy.mode.enabled=true. The reporter confirmed no more issues after upgrading to 8.2.1. Source: https://github.com/questdb/questdb/issues/5202

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_22Sfd3a1mgcBIXHP5yxxOQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">PostgreSQL client interface errors <span>— Vectle</span></a>