Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSONB version to PostgreSQLJSONCustomConvertible #66

Merged
merged 1 commit into from
May 30, 2018
Merged

Add JSONB version to PostgreSQLJSONCustomConvertible #66

merged 1 commit into from
May 30, 2018

Conversation

Sorix
Copy link
Contributor

@Sorix Sorix commented May 18, 2018

Information

Fix bug when user tries to save JSONB (most time it shows when trying to save an array) and receive an error: unsupported jsonb version number 123. PostgreSQL requires JSONB version number in a first byte.

https://doxygen.postgresql.org/jsonb_8c_source.html#l00104:

jsonb type recv function
The type is sent as text in binary mode, so this is almost the same as the input function, but it's prefixed with a version number so we can change the binary format sent in future if necessary. For now, only version 1 is supported.

Tests

Current code (before PR) is not working, you can see the error in updated test at CircleCI.
Updated test is located in PR vapor/fluent-postgres-driver#58.

Fixes

That commit fixes next issues:

Fix bug "unsupported jsonb version number 123"
Copy link
Member

@tanner0101 tanner0101 left a comment

Choose a reason for hiding this comment

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

awesome, thanks!

@tanner0101 tanner0101 merged commit a891777 into vapor:master May 30, 2018
@penny-coin
Copy link

Hey @Sorix, you just merged a pull request, have a coin!

You now have 2 coins.

@tanner0101 tanner0101 added the bug Something isn't working label May 30, 2018
@tanner0101 tanner0101 self-assigned this May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unsupported jsonb version number 123 jsonb write fail
3 participants