Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid byte sequence for encoding "UTF8" #874

Open
VaibhaveS opened this issue Aug 27, 2024 · 0 comments
Open

Invalid byte sequence for encoding "UTF8" #874

VaibhaveS opened this issue Aug 27, 2024 · 0 comments

Comments

@VaibhaveS
Copy link
Contributor

pgcopydb assumes that the data is in UTF-8. With a setup like below pgcopydb clone would fail while COPYing.

1. CREATE DATABASE source with encoding 'SQL_ASCII' WITH template0;
2. \c source 
3. CREATE TABLE foo(t TEXT);
4. SET CLIENT_ENCODING = 'SQL_ASCII';
5. INSERT INTO foo VALUES(E'\377');

Since client_encoding is given as utf8 in the COMMON_GUC_SETTINGS, we need to change it according to the one in source.

source=# set client_encoding = 'utf8';
SET
source=# select * from foo;
ERROR:  invalid byte sequence for encoding "UTF8": 0xf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant