Skip to content

Instantly share code, notes, and snippets.

@jasonmp85
Created March 8, 2018 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonmp85/a44f17b32334621235eac6a01f497f99 to your computer and use it in GitHub Desktop.
Save jasonmp85/a44f17b32334621235eac6a01f497f99 to your computer and use it in GitHub Desktop.
Repro steps for citusdata/citus#2009
CREATE TABLE dist (id integer);
CREATE TABLE ref (id integer);
SELECT create_distributed_table('dist', 'id');
SELECT create_reference_table('ref');
CREATE FUNCTION dist_func()
RETURNS void LANGUAGE plpgsql AS $$
BEGIN
EXECUTE 'SELECT id, $1 FROM dist' USING 1;
END; $$;
CREATE FUNCTION ref_func()
RETURNS void LANGUAGE plpgsql AS $$
BEGIN
EXECUTE 'SELECT id, $1 FROM ref' USING 1;
END; $$;
SELECT dist_func();
SELECT ref_func();
SET auto_explain.log_min_duration TO 0;
SET auto_explain.log_nested_statements TO on;
SELECT dist_func();
SELECT ref_func();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment