Postgres sql procedure added

* Using json functions