Skip to content

Instantly share code, notes, and snippets.

@kovid-rathee
Last active February 24, 2019 09:12
Show Gist options
  • Save kovid-rathee/694126299a8b2c917397c953e76a4a25 to your computer and use it in GitHub Desktop.
Save kovid-rathee/694126299a8b2c917397c953e76a4a25 to your computer and use it in GitHub Desktop.
Remove Invalid Characters (which are not accepted by Redshift)
drop function if exists transformation_utils.remove_invalid_characters (p_string text);
create or replace function transformation_utils.remove_invalid_characters (p_string text)
returns text AS
$body$
declare
c text;
begin
select replace(p_string,'�','') into c;
return c;
end;
$body$
language 'plpgsql';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment