<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pg-clickhouse-chdb-updates-encoding-nesting-and-types-zshfx6gmk" -->

---
title: pg_clickhouse & chdb updates: encoding, nesting, and types
description: pg_clickhouse v0.11.0 and the chdb extension v0.1.2 ship improvements for character encoding validation, interval type mappings, and nested/JSON data handling...
canonical: https://daily.dev/posts/pg-clickhouse-chdb-updates-encoding-nesting-and-types-zshfx6gmk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: pg_clickhouse & chdb updates: encoding, nesting, and types | daily.dev
og:description: pg_clickhouse v0.11.0 and the chdb extension v0.1.2 ship improvements for character encoding validation, interval type mappings, and nested/JSON data handling...
og:url: https://daily.dev/posts/pg-clickhouse-chdb-updates-encoding-nesting-and-types-zshfx6gmk
og:image: https://api.daily.dev/og/posts/zSHFx6gMk.png
og:image:alt: pg_clickhouse & chdb updates: encoding, nesting, and types
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# pg_clickhouse & chdb updates: encoding, nesting, and types

**[ClickHouse](https://daily.dev/sources/clickhouse)** · 9 min read · 7 upvotes · 0 comments

## Summary

pg_clickhouse v0.11.0 and the chdb extension v0.1.2 ship improvements for character encoding validation, interval type mappings, and nested/JSON data handling between ClickHouse and Postgres. New check_encoding options (fail, remove, replace, truncate) handle invalid byte sequences. ClickHouse interval types now import as Postgres interval or bigint columns with pushdown support. Parameterized JSON columns now map to jsonb with working ORDER BY pushdown, and unflattened Nested types can map to two-dimensional arrays or custom composite types. Additional changes include new numeric and geo type mappings, removal of the deprecated clickhouse_raw_query() function, dropped PostgreSQL 13 support, and pushdown for SHA hash functions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://clickhouse.com/blog/pg_clickhouse-chdb>

## Questions this post answers

### How do I handle invalid byte sequence errors when reading text data from ClickHouse in pg_clickhouse?

Set the check_encoding foreign server option, introduced in pg_clickhouse v0.11.0, to control how invalid bytes are handled. Options are fail (default, raises an error), remove (strips invalid bytes), replace (substitutes invalid bytes with the Unicode replacement character under UTF-8), or truncate (cuts text at the first invalid byte). Configure it with ALTER SERVER ch_server_name OPTIONS (ADD check_encoding 'replace').

_Developers wiring ClickHouse into Postgres pipelines track extension changes like this via daily.dev._

### Does pg_clickhouse support ClickHouse interval types like IntervalMillisecond?

Yes, as of pg_clickhouse v0.11.0 and chdb_hook v0.1.2, ClickHouse interval types such as IntervalNanosecond, IntervalHour, IntervalDay, and IntervalMillisecond import as native Postgres interval columns, with pushdown support for operations like adding a duration to a timestamp. Alternatively, interval columns can be mapped to bigint by defining the target column that way instead.

_Teams evaluating ClickHouse-Postgres interoperability follow extension updates like these on daily.dev._

### What happened to the clickhouse_raw_query() function in pg_clickhouse?

The clickhouse_raw_query() function, deprecated since pg_clickhouse v0.10.0, has been dropped entirely in v0.11.0. Code using it must be updated to use clickhouse_query(server, sql) for reading rows or CALL clickhouse_perform(server, sql) for running statements that return no rows.

_Anyone maintaining pg_clickhouse integrations checks breaking changes like this through daily.dev before upgrading._

## Similar posts on daily.dev

- [What's New in pg\_clickhouse - JSONB Support, SQL value functions, Streaming, and more](https://daily.dev/posts/what-s-new-in-pg-clickhouse---jsonb-support-sql-value-functions-streaming-and-more-go94bydw3) · ClickHouse · 31 upvotes · 1 comments
- [pg\_clickhouse 0.3.1: Now With More C](https://daily.dev/posts/pg-clickhouse-0-3-1-now-with-more-c-h3naoiqtg) · Planet PostgreSQL · 1 upvotes · 0 comments
- [pg\_clickhouse v0.10: Subquery pushdown and 1000x faster TPC-H queries](https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1) · Hacker News · 18 upvotes · 0 comments
- [What's New in pg\_clickhouse v0.3.2: Postgres 19, TLS, Regex, and Memory](https://daily.dev/posts/what-s-new-in-pg-clickhouse-v0-3-2-postgres-19-tls-regex-and-memory-bsqvivpr0) · ClickHouse · 18 upvotes · 1 comments

---

Tags: [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql), [#clickhouse](https://daily.dev/tags/clickhouse)

[View this post on daily.dev](https://daily.dev/posts/pg-clickhouse-chdb-updates-encoding-nesting-and-types-zshfx6gmk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"pg_clickhouse & chdb updates: encoding, nesting, and types","url":"https://daily.dev/posts/pg-clickhouse-chdb-updates-encoding-nesting-and-types-zshfx6gmk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/pg-clickhouse-chdb-updates-encoding-nesting-and-types-zshfx6gmk"},"datePublished":"2026-09-30T16:23:26.361Z","dateModified":"2026-09-30T16:28:48.246Z","description":"pg_clickhouse v0.11.0 and the chdb extension v0.1.2 ship improvements for character encoding validation, interval type mappings, and nested/JSON data handling...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/26331e2634e76fc72ed1537387d8fa2d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/26331e2634e76fc72ed1537387d8fa2d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ClickHouse","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ClickHouse","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/clickhouse","url":"https://daily.dev/sources/clickhouse"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/pg-clickhouse-chdb-updates-encoding-nesting-and-types-zshfx6gmk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,postgresql,clickhouse","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ClickHouse","item":"https://daily.dev/sources/clickhouse"},{"@type":"ListItem","position":3,"name":"pg_clickhouse & chdb updates: encoding, nesting, and types"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/pg-clickhouse-chdb-updates-encoding-nesting-and-types-zshfx6gmk#faq","mainEntity":[{"@type":"Question","name":"How do I handle invalid byte sequence errors when reading text data from ClickHouse in pg_clickhouse?","acceptedAnswer":{"@type":"Answer","text":"Set the check_encoding foreign server option, introduced in pg_clickhouse v0.11.0, to control how invalid bytes are handled. Options are fail (default, raises an error), remove (strips invalid bytes), replace (substitutes invalid bytes with the Unicode replacement character under UTF-8), or truncate (cuts text at the first invalid byte). Configure it with ALTER SERVER ch_server_name OPTIONS (ADD check_encoding 'replace'). Developers wiring ClickHouse into Postgres pipelines track extension changes like this via daily.dev."}},{"@type":"Question","name":"Does pg_clickhouse support ClickHouse interval types like IntervalMillisecond?","acceptedAnswer":{"@type":"Answer","text":"Yes, as of pg_clickhouse v0.11.0 and chdb_hook v0.1.2, ClickHouse interval types such as IntervalNanosecond, IntervalHour, IntervalDay, and IntervalMillisecond import as native Postgres interval columns, with pushdown support for operations like adding a duration to a timestamp. Alternatively, interval columns can be mapped to bigint by defining the target column that way instead. Teams evaluating ClickHouse-Postgres interoperability follow extension updates like these on daily.dev."}},{"@type":"Question","name":"What happened to the clickhouse_raw_query() function in pg_clickhouse?","acceptedAnswer":{"@type":"Answer","text":"The clickhouse_raw_query() function, deprecated since pg_clickhouse v0.10.0, has been dropped entirely in v0.11.0. Code using it must be updated to use clickhouse_query(server, sql) for reading rows or CALL clickhouse_perform(server, sql) for running statements that return no rows. Anyone maintaining pg_clickhouse integrations checks breaking changes like this through daily.dev before upgrading."}}]}
```

