             ) AS cmd,
             lower(item_group_oid) AS relname,
             21 AS suborder
-            FROM dm.metadata_crf_ig_item
+            FROM metadata_crf_ig_item
             INNER JOIN dm_metadata_study AS dms
                 ON metadata_crf_ig_item.study_name = dms.study_name
             

            ) AS cmd,
            lower(item_group_oid) AS relname,
            22 AS suborder
            FROM dm.response_set_labels AS drsl
            INNER JOIN dm_metadata_study AS dms
                ON drsl.study_name = dms.study_name
            WHERE 
                EXISTS (
                    SELECT
                        item_oid
                    FROM dm.metadata_crf_ig_item AS mcii
                    WHERE
                        drsl.item_oid = mcii.item_oid
                        AND mcii.item_data_type = 'INT'

  $BODY$
    DECLARE r RECORD;
    BEGIN
        EXECUTE format('SET LOCAL search_path TO %1$s', filter_study_name_schema);
        RETURN QUERY
        WITH views AS (
                SELECT
