James is trying to get JSON from a kafka topic into a schema with BYTEA in postgres. What format should the JSON property be in for a BYTEA in postgres schema?
James Corbett
Asked on May 22, 2023
When working with JSON data from a Kafka topic and storing it in a BYTEA column in a Postgres schema, you can use a VARCHAR column in the table to read the data in JSON format and then cast it into BYTEA.
Here is an example of casting a VARCHAR to BYTEA in Postgres:
SELECT '\xDeadBeef'::bytea;
SELECT '12CD'::bytea;
SELECT '\x12CD'::bytea;