I am trying to import a table from PostgreSQL to SQL Server. One of the fields in the Postgre table is "bytea" data type. When I open the table in dBeaver, that column contains json data.
I created an ODBC system user that connects to PostgreSQL for SSIS. When I viewed the table data using SSIS ODBC Source, it shows encrypted data for that field. After the data was imported to SQL Server table varbinary(max) column, it contains the encrypted data. I cast the data to varchar(max) "cast([bytes] as varchar(max))". It returns "’", no json data.
My question is
(1) Why SSIS ODBC Source shows encrypted data instead of the original json data?
(2) What has to be done in order to bring in the original json data?
The data is encoded in PostgreSQL - and SSIS is showing the data in its actual format. DBeaver understands this encoding and is decoding the values for you.
You need to decode the value in PostgreSQL on output to SSIS so the JSON data is passed as text.
I am not familiar enough with PostgreSQL - nor with JSON - but it seems to me they have functionality available that will convert the bytea data to JSON which can then be passed directly to SSIS.