Skip to content

Conversation

@theory
Copy link
Collaborator

@theory theory commented Dec 9, 2025

Add support for JSONB to INSERT statements and, when importing tables, map the ClickHouse JSON type to PostgreSQL JSONB. This increases the what users can do with these values; they can still use JSON for manually-created tables.

Does not yet include binary engine support for JSON, which will requires support from clickhouse-cpp (ClickHouse/clickhouse-cpp#450).

The format of the `pg_clickhouse.session_settings` GUC was

    key = val, key = 'val'...

But that doesn't match options passed to `CREATE SERVER` and the like,
which requires space, not an equal sign, between option names and
values:

    key val, key 'val'...

In the future we'll want to merge these options with the GUC, so it's
better if they use the same format.

So add a new parameter to `chfdw_parse_options()`, `bool with_equal`,
and only require an equal sign between the name and value when it't
true. Then change calls to it to not require a comma for the GUC, but to
still require them for the `clickhouse_raw_query()` connection string,
to align with the libpq behavior.

Update the GUC tests and documentation to reflect this change.
Add support for JSONB to `INSERT` statements and, when importing tables,
map the ClickHouse JSON type to PostgreSQL JSONB. This increases the
what users can do with these values; they can still use JSON for
manually-created tables.

Does not yet include binary engine support for JSON, which will requires
support from clickhouse-cpp (ClickHouse/clickhouse-cpp#450).
@theory theory merged commit 1c53576 into main Dec 10, 2025
34 checks passed
@theory theory deleted the jsonb branch December 10, 2025 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants