Open onderkalaci opened 4 years ago
Once we fix it, we should test in the context of #4034 as well
Another example Marco noted which involves reference tables
CREATE OR REPLACE FUNCTION public.mean()
RETURNS int
LANGUAGE sql
AS $$
INSERT INTO test SELECT * FROM ref ORDER BY random() LIMIT 1 RETURNING x;
$$;
CREATE TABLE evil (m int default mean(), d int);
SELECT create_distributed_table('evil', 'm');
BEGIN;
INSERT INTO evil (d) SELECT s FROM generate_series(1,100) s;
INSERT INTO evil (d) SELECT s FROM generate_series(1,100) s;
END;
While working on #4034, we considered cases where a COPY command might nest another call other COPY commands (or any other command basically). I traced back to 9.2, and I can reproduce until there.
It turns out we have some other issues around it: