SET LOCAL client_encoding to retain the scope inside CREATE EXTENSION

Leaving CLIENT_ENCODING to UTF-8 will break pg_restore for non UTF-8 databases.  Use SET LOCAL so that the setting is retained in the CREATE EXTENSION only.
This commit is contained in:
Michael Kröll 2019-04-23 09:43:20 +02:00 committed by Julien Rouhaud
parent 19af48499e
commit 25d65ba413
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION hypopg" to load this file. \quit
SET client_encoding = 'UTF8';
SET LOCAL client_encoding = 'UTF8';
CREATE FUNCTION hypopg_reset()
RETURNS void

View file

@ -6,7 +6,7 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION hypopg" to load this file. \quit
SET client_encoding = 'UTF8';
SET LOCAL client_encoding = 'UTF8';
-- General functions
--