@ Other readers:
See the first answer posted by Mark Byers. I used the "answer", and not "commented" on his post, since I needed to use tables / links, etc., which are not available when commenting on the answers. :)
@Mark Byers:
Thanks for the link ... It really helped me, and I was able to figure out how to create a path between the servers ... See what I could do.
in_id | in_timestamp | out_timestmap | name | hops_count | path | id1 | timestamp1 | timestamp2 | data1 | 1 | {id1} | id2 | timestamp2 | timestamp3 | data1 | 2 | {id1,id2} | id3 | timestamp3 | timestamp4 | data1 | 3 | {id1,id2,id3} | id4 | timestamp4 | timestamp2 | data1 | 4 | {id1,id2,id3,id4} |
* path generated using 'in_id'
I used the following query ...
WITH RECURSIVE foo AS ( SELECT t_alias1, 1 AS hops_count, ARRAY[in_id] AS hops FROM log_parsing.log_of_sent_mails t_alias1 WHERE in_server = 'other-server1' UNION ALL SELECT t_alias2, foo.hops_count + 1 AS hops_count, hops || in_id FROM foo JOIN log_parsing.log_of_sent_mails t_alias2 ON t_alias2.in_id = (foo.t_alias1).out_id ) SELECT (foo.t_alias1).in_id, (foo.t_alias1).name, (foo.t_alias1).in_timestamp, hops_count, hops::VARCHAR AS path FROM foo ORDER BY hops
But I still could not reach the final stage. This is what I want to end up with ...
in_id | in_timestamp | out_timestmap | name | hops_count | path | id4 | timestamp1 | timestamp5 | data1 | 4 | {id1,id2,id3,id4}|
* observe the time stamp. This is necessary because I do not want the client to know about the internal infrastructure. Therefore, the time delay between timestamp1 and timestamp5 is important to him.
Any clues how can I achieve this !?
ps I would try to contact Quassnoi . :)