How to change type from array to primitive in PostgreSQL? -


i'm trying change column type integer[] integer. table has no row in , i've dropped default.

alter table user alter column book_ids type integer using book_ids::integer; error:  cannot cast type integer[] integer 

i found how change type integer integer[] not other way around.

arr[1] first element of arr.

alter table user alter column book_ids type integer using book_ids[1]; 

Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -