--
-- util__not_null_exists/2
--
create or replace function util__not_null_exists(
  p_table_name text,
  p_column text
) returns bool as $$

DECLARE
BEGIN
      return (
        coalesce((
        select is_nullable = 'NO'
          from information_schema.columns
         where table_name  = lower(p_table_name)
           and column_name = lower(p_column)), false));
END;
$$ language plpgsql;