TEXT_EQUAL CREATE OR REPLACE FUNCTION text_equal_ci(text_value1 text, text_value2 text) RETURNS boolean AS $$ BEGIN RETURN (lower(text_value1) = lower(text_value2)); END; $$ LANGUAGE plpgsql IMMUTABLE;