Repository navigation
Fix PostgreSQL Date32 values not being correctly read - #95999
Merged
Merged
Conversation
PostgreSQL DATE values outside the ClickHouse `Date` range (1970-2149) were being incorrectly read due to UInt16 overflow. This changes the PostgreSQL `date` type mapping from `Date` to `Date32`, which uses Int32 storage and supports dates from 1900-2299. Changes: - Map PostgreSQL `date` type to `Date32` instead of `Date` - Add `Date32` support for reading PostgreSQL date arrays - Add `Date32` support for writing date arrays back to PostgreSQL Fixes #73084 Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
|
Workflow [PR], commit [d6111fb] Summary: ❌
|
kssenii
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PostgreSQL DATE values outside the ClickHouse
Daterange (1970-2149) were being incorrectly read due to UInt16 overflow. This changes the PostgreSQLdatetype mapping fromDatetoDate32, which uses Int32 storage and supports dates from 1900-2299.Changes:
datetype toDate32instead ofDateDate32support for reading PostgreSQL date arraysDate32support for writing date arrays back to PostgreSQLFixes #73084
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
DATEcolumns from PostgreSQL are now inferred asDate32in ClickHouse (in previous versions they were inferred asDate, which led to overflow of the values outside of a narrow range). Allow insertingDate32values back to PostgreSQL. Closes #73084.Version info
26.2.1.270