I have an array of tuples in PostgreSQL 17.
I couldn't get SELECT...INTO...FROM to work for some reason:
SELECT ARRAY[(1,2)] AS a INTO temp_table;
ERROR: column "a" has pseudo-type record[] SQL state: 42P16
To solve it, I had to convert it to text:
SELECT ARRAY[(1,2)] AS a, ARRAY[(1,2)]::text AS b
| a type record[] |
b type text |
|---|---|
| {"(1,2)"} | {"(1,2)"} |
Now I need to convert column b back to array of tuples, like column a.
How can it be done?
SELECT INTOone inside plpgsql and one outside. Which one are you using and what is the issue when using it?