Skip to content

Manually Controlling JSONB Serialization/Deserialization #10944

Discussion options

You must be logged in to vote

Hi,

It seems odd that I'm able to successfully skip the automatic JSON serialization by defining a bind_processor, but I'm not able to do the same thing for deserialization with result_processor

well you can control what gets passed to the dialect, but once the result_processor runs the dialect has already de-serialized the data from the db.

I think yout best option here is probably to either de-register the deserializer in the dialect or update your StringJSONB type to cast to text in bind_expression.

Personally I would make the db compute that hash, using a computed column and one of the hashing function supported by pg https://www.postgresql.org/docs/current/pgcrypto.html

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rmorshea
Comment options

@CaselIT
Comment options

@rmorshea
Comment options

@rmorshea
Comment options

Answer selected by rmorshea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants