Forum OpenACS Q&A: Response to A starting work to manage translations and locations (addresses)

Exactly how is the view not working?  It looks like it should...

I have a locations table for my birdnotes.net database which serves a similar purpose.  Rather than a fixed number of parent nodes within the table of locations, I use a separate table with two fields, i.e.  "smaller" and "bigger".  This works quite well with proper indexing on the locations table and the elements of the hierarchy table (named "contains" in my datamodel).

Note that by coincidence this is similar to the hierarchy table used by acs_objects.

If I want to return the set of all locations in Oregon, I just do this:

select * from locales l, contains c
where c.bigger = :locale_id_for_oregon and c.smaller = l.locale_id;

My locations database is complicated by the fact that in real life geographical regions don't decompose into a tree, but rather a DAG.