Postgresql Insert Into Array Javascript Length Validation