How to connect postgresql with kibana via metricbeat

Yes, if you want to visualize the data in the the tables you cannot use beats, but you can use logstash.

The plugin can be configured with a scheduler, in that case the query is executed periodically and the result indexed in elasticsearch, with a document per row, if you want to keep documents updated you need to specify a document_id in the elasticsearch output, as in the second example in this blogpost.

Another option, if the data in your database is never updated and you want to index in each execution only the more recent rows, is to use sql_last_value in your query.