dbeaver / dbeaver/dbeaver

Add new database "load users" gives an error for `invalid byte sequence`

Open
#22,100 16 comments 0 reactions 0 assignees View on GitHub
x:postgresql xf:metadata
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 8h
Merged PRs (30d)
188

Description

### Description

Insert new database "load users" doesn't use the initialization SQL to set client encoding to `Win1252` and gives an error for `invalid byte sequence`.

![Diver property `allowEncodingChanges` set to `true`](https://github.com/dbeaver/dbeaver/assets/52160996/9f31da7c-5737-439d-98ad-cf63b6d79ce9)

![Bootstrap SQL: `set client_encoding = 'Win1252';`](https://github.com/dbeaver/dbeaver/assets/52160996/bf2d8d4e-a57f-44d1-92e1-dc04a0e0b4d5)

![Error of UTF8 char set in users when inserting new database](https://github.com/dbeaver/dbeaver/assets/52160996/054f8f66-e2ff-444b-a511-083348ca7ecb)

Error:

```
Erro SQL [22021]: ERROR: invalid byte sequence for encoding "UTF8": 0xe3 0x89
ERROR: invalid byte sequence for encoding "UTF8": 0xe3 0x89
ERROR: invalid byte sequence for encoding "UTF8": 0xe3 0x89
```

### DBeaver Version

Community Edition 23.3.0.202312031432

### Operating System

Windows 11 Pro Version 10.0.22621 Build 22621

### Database and driver

Database name and version: PostgresSQL 15.0
Diver name: PostgresSQL JDBC Dirver (I'm not sure how to find the version)

### Steps to reproduce

Create a PostgresSQL database and connect to it. Make some users using `Win1252` only characters.

Click here:

![Create new database (Alt + Insert) button](https://github.com/dbeaver/dbeaver/assets/52160996/474b731f-1d8c-472b-81d1-0a256b1f8e08)

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.