Is there any way to extract a URL to a post from Discourse backend DB?

You might have a look at What cool data explorer queries have you come up with?.

The url is /t/post.topic_id/post.post_number if I remember the field names exactly right.