execute INSERT only if there are posts to be inserted