That would be exactly how I would do it. Although the SQL would be rather extensive, if the pg_id's are all declared as indexes, then the query should be fairly quick. In any case, as the navigation links will not be changing daily, weekly, monthly or even yearly, then you can also introduce caching into the equation.
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
The Following User Says Thank You to Wildhoney For This Useful Post: