Skip to content

Conversation

@lidavidm
Copy link
Member

This also works for JSONB. This lets PostgreSQL know that the string data is actually JSON data so it can handle that properly.

Closes #3284.

@lidavidm lidavidm marked this pull request as ready for review August 26, 2025 08:27
@github-actions github-actions bot added this to the ADBC Libraries 20 milestone Aug 26, 2025
@lidavidm lidavidm requested review from WillAyd and zeroshade August 26, 2025 08:28
Copy link
Contributor

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Very nice work!

@lidavidm
Copy link
Member Author

@dabla, I think the other thing you would need is for us to return extension<arrow.json> instead of just string on read, if I understand right, so you can tell the difference between the types?

Also I just noticed you mention ingest doesn't work either so that will also need to be tested.

This also works for JSONB.  This lets PostgreSQL know that the
string data is actually JSON data so it can handle that properly.

Closes apache#3284.
@lidavidm
Copy link
Member Author

Looks like we can ingest into JSON, but we can't ingest into JSONB without another extension type (because we have to generate a slightly different representation in this case). So I'll leave that as a TODO. You can INSERT into a JSONB column, though, because Postgres knows what type you're trying to insert and can cast. (A workaround if you need to ingest into a JSONB column might be to ingest into a JSON temporary table and then do another INSERT.)

@lidavidm lidavidm merged commit f5c0354 into apache:main Aug 29, 2025
70 checks passed
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.

Python: JSONB column type issue with ADBC driver manager for Postgres

2 participants