create function run()
returns integer as'
declare
  v_bool	boolean;
begin
  if not acs_util__has_children(''acs_object'', ''acs_object_types'', ''supertype'') then
    raise notice ''Type "acs_object" should have children'';
  end if;

  if acs_util__has_children(''made_up_type'', ''acs_object_types'', ''supertype'') then
    raise notice ''Type "made_up_type" should not have children'';
  end if;

  if not acs_util__boolean_query(''select * from acs_objects'', ''f'') then
    raise notice ''Query 1 should be true'';
  end if;

  if acs_util__boolean_query(''select * from acs_objects'', ''t'') then
    raise notice ''Query 2 should be false'';
  end if;

  if acs_util__boolean_query(''select * from acs_objects where 1=2'', ''f'') then
    raise notice ''Query 3 should be false'';
  end if;

  if not acs_util__boolean_query(''select * from acs_objects where 1=2'', ''t'') then
    raise notice ''Query 4 should be true'';
  end if;

  return null;
end;' language 'plpgsql';

select run();
select acs_util__sql_to_tcl_string('This_string_should_not_have_braces');
select acs_util__sql_to_tcl_string('This string should have braces');
drop function run();