Call replication lag function on postgres database