🐏 Taming PostgreSQL GUC “extra” Data

Link: https://clickhouse.com/blog/taming-postgres-guc-extra-data

New [post] up on on the ClickHouse blog:

> I wanted to optimize away parsing the key/value pairs from the
> [pg_clickhouse] `pg_clickhouse.session_settings` GUC for every query by
> pre-parsing it on assignment and assigning it to a separate variable. It
> took a few tries, as the GUC API requires quite specific memory allocation
> for extra data to work properly. It took me a few tries to land on a
> workable and correct solution.

Struggling to understand, making missteps, and ultimately coming to a
reasonable design and solution satisfies me so immensely that I always want to
share. This piece gets down in the C coding weeds; my fellow extension coders
might enjoy it.

[pg_clickhouse]: https://pgxn.org/dist/pg_clickhouse/ "pg_clickhouse on PGXN"
[post]: https://clickhouse.com/blog/taming-postgres-guc-extra-data
"Taming PostgreSQL GUC “extra” Data"

-------------------------------------------------------------------------------

❖ Thursday, 18 Dec 2025
By David E. Wheeler
https://justatheory.com/2025/12/taming-guc-extra/

More about...

* Postgres: https://justatheory.com/tags/postgres/
* GUC: https://justatheory.com/tags/guc/
* pg_clickhouse: https://justatheory.com/tags/pg_clickhouse/