function str_endswith for pgsql