Skip to content

feat: reading data from hstore columns#437

Merged
staticlibs merged 3 commits intoduckdb:mainfrom
cbrachem:feat/hstore
Apr 13, 2026
Merged

feat: reading data from hstore columns#437
staticlibs merged 3 commits intoduckdb:mainfrom
cbrachem:feat/hstore

Conversation

@cbrachem
Copy link
Copy Markdown
Contributor

Here's the PR announced in #436. @staticlibs would you mind checking it out?

Does this PR need an accompanying PR for the docs? As of right now, this extension mostly contains functionality that's needed for the actual communication with Postgres. My PR ist just two string conversion functions. Maybe a "misc" section at the bottom of the docs page, or a section that lists "QOL" functions that are not direcly related to postgres connectivity?

@cbrachem cbrachem marked this pull request as draft April 11, 2026 18:46
@cbrachem
Copy link
Copy Markdown
Contributor Author

need to downgrade because I've been using c++17 stuff

@cbrachem
Copy link
Copy Markdown
Contributor Author

Integration tests say the function postgres_hstore_get does not exist:

1. test/sql/misc/postgres_hstore.test:18
================================================================================
Query unexpectedly failed (test/sql/misc/postgres_hstore.test:18)
 (test/sql/misc/postgres_hstore.test:18)!
================================================================================
SELECT postgres_hstore_get('a=>b', 'a');
================================================================================
Actual result:
================================================================================
Catalog Error: Scalar Function with name postgres_hstore_get does not exist!
Did you mean "list_reverse_sort"?

Yet when I download the extension from this build run and load it into a DuckDB instance, it looks like it's working:

memory D load '~/Downloads/postgres_scanner.duckdb_extension';
memory D select postgres_hstore_get('a=>b', 'a');
┌──────────────────────────────────┐
│ postgres_hstore_get('a=>b', 'a') │
│             varchar              │
├──────────────────────────────────┤
│ b                                │
└──────────────────────────────────┘

Why doesn't it load the functions during integration tests? What am I missing? @staticlibs Do you have an idea?

@staticlibs
Copy link
Copy Markdown
Collaborator

Why doesn't it load the functions during integration tests? What am I missing? @staticlibs Do you have an idea?

Unittester has some peculiar logic for loading the extension listed in require. As a workaround you can run the ATTACH before calling a function or add the following after the requires:

statement ok
PRAGMA enable_verification

@cbrachem
Copy link
Copy Markdown
Contributor Author

cbrachem commented Apr 12, 2026

Unittester has some peculiar logic for loading the extension listed in require. As a workaround you can run the ATTACH before calling a function or add the following after the requires:

statement ok
PRAGMA enable_verification

I already have the pragma line in postgres_hstore.test, right after require postgres_scanner. I have noticed that the postgres_binary_read_*.test test files state LOAD postgres_scanner; after the require. On my machine, that did the trick. Now fingers crossed that it also works in CI.

@cbrachem cbrachem marked this pull request as ready for review April 12, 2026 18:42
Copy link
Copy Markdown
Collaborator

@staticlibs staticlibs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looks good to me.

@staticlibs staticlibs merged commit 689f281 into duckdb:main Apr 13, 2026
15 checks passed
@cbrachem
Copy link
Copy Markdown
Contributor Author

Thanks for the PR! Looks good to me.

Thanks for your quick review. Please let me know if I should prepare a PR for the documentation.

@staticlibs
Copy link
Copy Markdown
Collaborator

Please let me know if I should prepare a PR for the documentation.

Yes, this won't harm, just I myself won't be able to review it.

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.

2 participants