Thanks for all answers so far. I'm just sweating over CONNECT
BY constructs. Somewhere in openACS code I spotted a solution
which uses two (or three?) Pl/PgSql functions emulating LEVEL
and ROWNUM, or something like that.
<p>
Is this preferred way? Or should we create index table for
each parent/child structure which should be updated on
INSERT/DELETE/UPDATE to master table? Since PostgreSQL does
not suffer from "mutating" syndrome like Oracle, will it be
possible just to write few triggers that could fire
recursively and maintain the index (parent-child mapping)
table? Or something else?