PostgreSQL custom query is not working

@nurlan Can i create a jira ticket on this?