Postgresql Declare Array Variable Javascript Function Expression