|
@@ -65,7 +65,10 @@ DECLARE
|
|
v_table_id int;
|
|
v_table_id int;
|
|
v_table text;
|
|
v_table text;
|
|
BEGIN
|
|
BEGIN
|
|
-SELECT tableid, tablename, reltuples INTO v_table_id, v_table, v_estimate FROM pg_categories JOIN pg_class ON tablename = relname;
|
|
|
|
|
|
+SELECT tableid, tablename, reltuples INTO v_table_id, v_table, v_estimate
|
|
|
|
+FROM pg_categories
|
|
|
|
+JOIN pg_class ON tablename = relname
|
|
|
|
+WHERE p_name = name;
|
|
SELECT 1000::double precision / v_estimate INTO v_percentage;
|
|
SELECT 1000::double precision / v_estimate INTO v_percentage;
|
|
RETURN QUERY EXECUTE 'SELECT '|| v_table_id ||' AS ordinal,
|
|
RETURN QUERY EXECUTE 'SELECT '|| v_table_id ||' AS ordinal,
|
|
'''|| p_name ||''' AS category, translation, reference
|
|
'''|| p_name ||''' AS category, translation, reference
|