Postgres String Functions In Javascript