It appears that when you add a E' (because this works on Postgres) on commands such as:
SET search_path TO E'public'; /* ERROR: syntax error at or near "'public'" LINE 1: SET search_path TO E'public'
The net result for Redshift is an error. I have found in your dbconnection.pas code that the E is added for Postgres, and since I invoke the Postgres dialog because Postgres/Redshift are similar, I get the error. Any thoughts on how to avoid this error?