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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -