diff --git a/routes/operations.js b/routes/operations.js index adaefd3..2d32df4 100644 --- a/routes/operations.js +++ b/routes/operations.js @@ -86,7 +86,12 @@ module.exports = function(pool) { client = await pool.connect(); await client.query('BEGIN'); - await client.query(`DECLARE pf_cur CURSOR FOR SELECT * FROM ${tbl}`); + await client.query(` + DECLARE pf_cur CURSOR FOR + SELECT f.*, l.note AS pf_note, l.operation AS pf_op + FROM ${tbl} f + LEFT JOIN pf.log l ON l.id = f.pf_logid + `); // Accumulate rows from the cursor, then emit a single Arrow record batch. // Per-batch tableFromJSON() builds independent dictionaries, which forces the diff --git a/routes/tables.js b/routes/tables.js index 2487645..7c9eca3 100644 --- a/routes/tables.js +++ b/routes/tables.js @@ -12,8 +12,8 @@ module.exports = function(pool) { t.table_name AS tname, c.reltuples::bigint AS row_estimate FROM information_schema.tables t - LEFT JOIN pg_class c ON c.relname = t.table_name - LEFT JOIN pg_namespace n ON n.oid = c.relnamespace AND n.nspname = t.table_schema + LEFT JOIN pg_namespace n ON n.nspname = t.table_schema + LEFT JOIN pg_class c ON c.relname = t.table_name AND c.relnamespace = n.oid WHERE t.table_schema NOT IN ('pg_catalog', 'information_schema', 'pf') ORDER BY t.table_schema, t.table_name `);