Loading file_catalog/05-data.sql +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ Initialization test for vospace Node table; for now ownerID and groupID are set equal to the rapID */ INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES ('NULL', '', 'container', '3354', '3354'); -- / INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES (NULL, '', 'container', '3354', '3354'); -- / INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES ('', 'home', 'container', '3354', '3354'); -- /home INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES ('2', 'curban', 'container', '3354', '3354'); -- /home/curban INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES ('2.3', 'store', 'container', '3354', '3354'); -- /home/curban/store file_catalog/06-os_path_view.sql 0 → 100644 +13 −0 Original line number Diff line number Diff line CREATE VIEW node_os_path AS SELECT nodeid, '/' FROM node WHERE path = '' UNION SELECT nodeid, '/' || string_agg(name, '/') AS os_path FROM ( SELECT name, p.nodeid FROM node n JOIN ( SELECT UNNEST(string_to_array(path::varchar, '.')) AS rel_id, nodeid FROM node ) AS p ON n.nodeid::varchar = p.rel_id ORDER BY p.nodeid, nlevel(n.path) ) AS j GROUP BY nodeid; Loading
file_catalog/05-data.sql +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ Initialization test for vospace Node table; for now ownerID and groupID are set equal to the rapID */ INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES ('NULL', '', 'container', '3354', '3354'); -- / INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES (NULL, '', 'container', '3354', '3354'); -- / INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES ('', 'home', 'container', '3354', '3354'); -- /home INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES ('2', 'curban', 'container', '3354', '3354'); -- /home/curban INSERT INTO Node (parentPath, name, type, ownerID, creatorID) VALUES ('2.3', 'store', 'container', '3354', '3354'); -- /home/curban/store
file_catalog/06-os_path_view.sql 0 → 100644 +13 −0 Original line number Diff line number Diff line CREATE VIEW node_os_path AS SELECT nodeid, '/' FROM node WHERE path = '' UNION SELECT nodeid, '/' || string_agg(name, '/') AS os_path FROM ( SELECT name, p.nodeid FROM node n JOIN ( SELECT UNNEST(string_to_array(path::varchar, '.')) AS rel_id, nodeid FROM node ) AS p ON n.nodeid::varchar = p.rel_id ORDER BY p.nodeid, nlevel(n.path) ) AS j GROUP BY nodeid;