ClickHouse / ClickHouse/pg_clickhouse

pg_clickhouse fails to compile on PostgreSQL‑15.6: unknown type name 'pg_regex_t'

Open Beginner friendly
#358 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
283
Forks
21
Avg merge
2d 6h
Merged PRs (30d)
11

Description

When building pg_clickhouse against PostgreSQL‑15.6, compile fails in `deparseFuncExpr` of `src/deparse.c`.
The type `pg_regex_t` does not exist in PG 15.6. Using internal non‑exported type leads to incompatible pointer and `re_nsub` member access errors. `-Werror` turns these into build‑stopping errors.
Need version‑gated compatibility for PostgreSQL‑15.

cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -Wno-declaration-after-statement -Wall -Wclobbered -Wsign-compare -Werror -fPIC -I./src/include -isystem vendor/pg-clickhouse-c/clickhouse-c -isystem vendor/pg-clickhouse-c -isystem /usr/local/pgsql‑15.6/include/server -DPGCH_MSG_PREFIX='"pg_clickhouse: "' -DCHC_ERR_MSG_LEN=4096 -I. -I./ -I/usr/local/pgsql‑15.6/include/server -I/usr/local/pgsql‑15.6/include/internal -D_GNU_SOURCE -c -o src/deparse.o src/deparse.c src/deparse.c: In function 'deparseFuncExpr': src/deparse.c:4599:13: error: unknown type name 'pg_regex_t'; did you mean 'regex_t'? 4599 | pg_regex_t* regex = RE_compile_and_cache( | ^~~~~~~~~~ | regex_t src/deparse.c:4599:33: error: initialization of 'int *' from incompatible pointer type 'regex_t ' [-Werror=incompatible-pointer-types] 4599 | pg_regex_t regex = RE_compile_and_cache( | ^~~~~~~~~~~~~~~~~~~~ src/deparse.c:4608:27: error: request for member 're_nsub' in something not a structure or union 4608 | buf, regex->re_nsub ? "extractGroups(" : "arraySlice(extractAll(" | ^~ src/deparse.c:4613:46: error: request for member 're_nsub' in something not a structure or union 4613 | appendStringInfoString(buf, regex->re_nsub ? ")" : "), 1, 1)"); | ^~ cc1: all warnings being treated as errors make: *** [: src/deparse.o] Error 1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/deparse.c at deparseFuncExpr around lines 4599-4613 and inspect the PostgreSQL 15.6 headers used by RE_compile_and_cache. Rebuild pg_clickhouse with the reported PostgreSQL 15.6 command to verify the compatibility change removes the unknown-type, pointer, and re_nsub errors while preserving the existing group-handling behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, postgresql
Domain
build-system, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.