Skip to content

Add INSERT support for UUID, INET types#134

Merged
theory merged 1 commit intomainfrom
uuid-inet-insert
Jan 22, 2026
Merged

Add INSERT support for UUID, INET types#134
theory merged 1 commit intomainfrom
uuid-inet-insert

Conversation

@theory
Copy link
Copy Markdown
Collaborator

@theory theory commented Jan 22, 2026

Teach the binary engine to convert ClickHouse IPv4 and IPv6 types to Postgres INET, then to convert Postgres UUID and INET values to ClickHouse binary values for inserts. Also fix a crash when attempting to insert an unsupported type with the binary engine.

Teach chfdw_datum_to_ch_literal to convert Postgres UUID and INET values to ClickHouse literal strings.

Add tests to binary_inserts and http_inserts test files that create tables using ClickHouse UUID, IPv4, and IPv6 columns, import them as Postgres UUID and INET columns, insert values, and fetch them from ClickHouse.

While at it, add a comment to clickhouseAcquireSampleRowsFunc() suggesting that it be implemented using the ClickHouse SELECT SAMPLE feature.

Resolves #127.

@theory theory requested a review from serprex January 22, 2026 18:59
@theory theory self-assigned this Jan 22, 2026
@theory theory added bug Something isn't working data types Improve data type support drivers Improve binary and/or http driver support labels Jan 22, 2026
@theory theory marked this pull request as ready for review January 22, 2026 19:00
Teach the binary engine to convert ClickHouse `IPv4` and `IPv6` types to
Postgres `INET`, then to convert Postgres `UUID` and `INET` values to
ClickHouse binary values for inserts. Also fix a crash when attempting
to insert an unsupported type with the binary engine.

Teach `chfdw_datum_to_ch_literal` to convert Postgres `UUID` and `INET`
values to ClickHouse literal strings.

Add tests to `binary_inserts` and `http_inserts` test files that create
tables using ClickHouse `UUID`, `IPv4`, and `IPv6` columns, import them
as Postgres `UUID` and `INET` columns, insert values, and fetch them
from ClickHouse.

While at it, add a comment to `clickhouseAcquireSampleRowsFunc()`
suggesting that it be implemented using the ClickHouse `SELECT SAMPLE`
feature.
@theory theory merged commit a19cb7b into main Jan 22, 2026
36 checks passed
@theory theory deleted the uuid-inet-insert branch January 22, 2026 19:50
@theory theory mentioned this pull request Jan 22, 2026
75 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working data types Improve data type support drivers Improve binary and/or http driver support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

INSERT into ClickHouse table with UUID column fails: unexpected column type for 2950: UUID

2 participants