I have a few tables with Text array field to copy from Postgres to Snowflake and ran into a problem. The corresponding field in Snowflake is now defined as array.
Some values in the text array field in Postgres has a single entity string without double quotes around them like the following (abc in this example is causing an error):
{abc, "bc dcd", "de ef fg"}
It looks like this (abc) is not a problem in Postgres but Snowflake doesn't accept it as a valid value. I am using Snowflake Python connector and it complains that "JSON parsing error". Any workaround this? I guess copying it as text field (not array) in Snowflake will likely fix the issue but I am wondering if there is any workaround as the array type.
text[]
orjson
? – PlosslARRAY
s. I'm not familiar with PostgreSQL, but it doesn't look like a validtext[]
either. Maybe it was transformed somehow into[abc, "bc dcd", "de ef fg"]
? Converting to text looks like a good option, but what do you really want?<br> How is this supposed to be used? – Geology{...}
not the square brackets. But anyhow: you can useto_jsonb(the_column)
to change that into a valid JSON array – Plossl