Postgresql Get Function Javascript Code