Postgres Command Line Query String To Json