Why doesn't this command work?
ALTER TABLE candidate ADD COLUMN blocked_companies ARRAY;
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With