Displaying 1 result from an estimated 1 matches for "new_id_field".
2013 Jun 26
0
json text to text array migration questions
...extended
| |
When I do " select my_id_field::json from table1", it returns something like
[]
[]
[]
["abc"]
[]
[]
[]
I like to change this from type json to text[] and included the following
in the migration
execute "alter table table1 add column new_id_field text[] default
''{}''::text[]"
execute "UPDATE table1 SET new_id_field = [my_id_field] where my_id_field
is not null"
I ended up with data like [["abc"]] and [[]], which was not what I wanted
Questions:
1) how do I convert the json type to text[]?
2) in...