The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Need DB query to get pages without parents

Matt Donagan
August 5, 2022

We recently had an issue where a page had no parent page and it was not showing on the sidebar, although the page was directly accessible. I fixed the issue by "moving" the page and listing the correct parent during the move.

I would like to query the database (Postgres) to see how many other pages do not have a parent page listed, in order to see if we have other pages with the same issue.

I need help with that query.

Thank you

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 6, 2022

The database is not a good way to do this, you'd have to go digging through several different tables, making negative searches (you're actually looking for a record that isn't there, so you'd actually need to be searching for every parent-child relationship and then subtracting that from a list of pages, and then working out which ones of those are root pages and which are orphans)

It is far easier to go to Space Settings -> Manage pages -> Hidden, where Confluence will list them so you can get to them quickly.  

I'm not sure why Atlassian changed the name to "hidden", when "orphan" was more clear (maybe it's only clear to English speakers?).  The URL still has orphan in it, the example I traced through because I wasn't sure where they'd moved it to in the new admin layout was  https://aclsandbox.atlassian.net/wiki/pages/listorphanedpages.action?key=HNM

TAGS
AUG Leaders

Atlassian Community Events