Trying to add an Array Column to existing Postgres table

You need to specify a datatype. If you want an array of strings, use text:

ALTER TABLE candidate ADD COLUMN blocked_companies text[];

if you want an array of numbers, use int:

ALTER TABLE candidate ADD COLUMN blocked_companies int[];

More details can be found in the manual:
http://www.postgresql.org/docs/current/static/arrays.html#ARRAYS-DECLARATION

But in most cases using arrays is not such a good idea (despite Postgres’ awesome array support). A properly normalized model might work better for your.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)