Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Test and if necessary repair issues inserting `NULL` to get a default value when a column has an explicit `DEFAULT`

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, postgresql, sql
Domain
backend, databases

Research direction

Start with the NULL-handling block in src/binary.cpp at lines 429-443 and inspect the existing HTTP and binary driver tests and ClickHouse table definitions. Add cases using explicit DEFAULT values, including foreign PostgreSQL tables with and without constraints, then verify the drivers' NULL behavior and determine whether both should match.

Written by the indexing model from the issue text.

Description

data types drivers

From the ClickHouse Docs:

The expression expr is optional. If it is omitted, the column type must be specified explicitly and the default value will be 0 for numeric columns, '' (the empty string) for string columns, [] (the empty array) for array columns, 1970-01-01 for date columns, or NULL for nullable columns.

Currently the binary driver refuses to insert a NULL into a non-Nullable column, but the http driver allows it. Add tests with explicit DEFAULT values on the ClickHouse tables and ensure that the http driver does the right thing when inserting a NULL (with and without a corresponding constraint on the foreign Postgres table).

Determine whether the binary driver behavior should be the same, and if so remove this block and fix issues accordingly:

https://github.com/ClickHouse/pg_clickhouse/blob/a9f4fc06667764368c6696231865165f977cdbf8/src/binary.cpp#L429-L443

Dominant language
C
Stars
284
Forks
21
Avg merge
23h 1m
Merged PRs (30d)
20

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ClickHouse/pg_clickhouse

All issues in ClickHouse/pg_clickhouse

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.