On Thu, 13 Jan 2005 11:45:52 +0100, Dawid Kuroczko <[EMAIL PROTECTED]> wrote: > > SELECT * FROM (SELECT id, path AS path_a FROM new_table_paths WHERE > > pathtype = 'a') AS a NATURAL FULL OUTER JOIN (SELECT id, path AS > > path_bb FROM new_table_paths WHERE pathtype = 'bb') AS bb WHERE id = > > <<NUM>>;
Part of the problem solved: CREATE AGGREGATE array_aggregate (basetype = anyelement, sfunc = array_append, stype = anyarray, initcond = '{}'); SELECT id,array_aggregate(pathtype||'='||path) from new_table_paths group by id; I.e. have a nice array of type=value pairs. I have however failed to write a function which would take text[] and return columns. I tried using RETURN record type, but so far it does not return anything useful (just a parenthesis enclosed list of column values). Any hints? ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match