Stringquery="SELECT graphs.graph_id, title, type, owner, rowlimit, array_agg(data_table) AS tables, array_agg(data_column) AS columns, array_agg(USAGE) AS usages, array_agg(AGGREGATE) AS aggregates, array_agg(label) AS labels "+
"FROM userdata.graphs "+
"JOIN userdata.columns ON graphs.graph_id = columns.graph_id "+
"WHERE graphs.graph_id = "+id+
"WHERE graphs.graph_id = ?"+
" GROUP BY graphs.graph_id, title, type, owner, rowlimit; ";