sql-table-name-parser
sql-table-name-parser copied to clipboard
find tables in: select ... into t1 from t2
trafficstars
Hi there!
I have a Postgres function that looks like
CREATE OR REPLACE FUNCTION t1_dummy2_func() RETURNS integer AS $$
DECLARE
v_rowcount int;
BEGIN
FOR i IN 1..10 LOOP
select count(*) INTO v_rowcount
from t1
where c2 = cast(gen_random_uuid() as varchar(30));
END LOOP;
return v_rowcount;
END;
$$ LANGUAGE plpgsql;
Don't think abut what the function does, it's just a dummy implementation
When I parse that for tables, I get: v_rowcount
But I expect the following result: v_rowcount and t1
Ok v_rowcount is really a variable... but it's OK to get some extra information.
But I am missing the table t1 totally
Can this be fixed?