Re: pg_execute_from_file review

Dimitri Fontaine <dimitri@2ndquadrant.fr>

From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
To: Itagaki Takahiro <itagaki.takahiro@gmail.com>
Cc: Alvaro Herrera <alvherre@commandprompt.com>, Dimitri Fontaine <dimitri@2ndquadrant.fr>, Joshua Tolley <eggyknap@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-30T09:48:48Z
Lists: pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@gmail.com> writes:
> client_encoding won't work at all because read_sql_queries_from_file()
> uses pg_verifymbstr(), that is verify the input with *server_encoding*.
>
> Even if we replace it with pg_verify_mbstr(client_encoding, ...) and
> pg_do_encoding_conversion(from client_encoding to server_encoding),
> it still won't work well when error messages are raised. The client
> expects the original client encoding, but messages are sent in the
> file encoding. It would be a security hole.

I'll confess I'm at a loss here wrt how to solve your concerns.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support