Why do you want to do this from SQL and for what purpose? That is one of the most painful methods you could possibly go for. There are space export options as well as content tools, besides the fact that page content will be stored in storage format in the database.
Moreover, what do you consider as "belonging to space" - are we talking about just pages, blogs, or are we also talking about space actors, notifications, subscriptions, attachment, labels and so forth, that's quite a lot of tables you would have to join.
@Radek Dostál - It will help us diagnose a problem with a particular space. I am most interested in pages, blogs (and their previous versions/children), and attachments (and previous versions) to those pages and blogs.
space actors, notifications, subscriptions, labels are not needed at the moment.
With great difficulty, the data structure in Confluence is not what you expect it to be and you're going to need to think about dozens of queries in order to extract that.
The manual deletion thing you've found is nothing to do with reporting, it's there for when things are genuinely broken in the database and removing a page that way is the very last resort, and hence highly focussed on doing just a delete with minimal collateral damage.
Why are you trying to find everything that is in a space? If that really is what you want for some reason, then why are you not simply using the space tools to get a list of pages and attachments (as those two are likely to be really what you're interested in).
Ok. It probably won't be that useful, and more to the point, SQL is an awful way to try to get these lists out.
What exactly is the problem you are having? It's very likely we can help you identify the cause and fix without torturing ourselves with database queries.
Go “behind the screen” to meet some of the Confluence Cloud team. In this video series, we tackle some of the hard-hitting questions you never knew you wanted the answer to! Meet some of the ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events