     tmp                   TEXT;
     table_name            TEXT;
 BEGIN
-    FOR form_name IN SELECT DISTINCT short_name FROM forms WHERE short_name IS NOT NULL AND short_name != '' AND status = 'Published' LOOP
+    FOR form_name IN SELECT DISTINCT short_name FROM forms WHERE short_name IS NOT NULL AND short_name != '' ORDER BY short_name LOOP
         -- For each form, find all the question short names that appear on it
+        RAISE DEBUG 'Processing form name %', form_name;
         i := 0;
         colnames_clause := '';
         cols_plus_vals_clause := '';

CREATE FUNCTION build_form_tables() RETURNS void
    LANGUAGE plpgsql
    AS $$

END;
$$;

CREATE FUNCTION create_single_form_table(form_name text, table_count integer, colnames_clause text, cols_plus_vals_clause text) RETURNS void
    LANGUAGE plpgsql
    AS $$
