duckdb / duckdb/pg_duckdb

Error When Querying pg_settings with pg_duckdb installed

Open
#1,005 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
3.2k
Forks
205
PR merge metrics
No merged PRs in 30d

Description

### What happens?

```
Traceback (most recent call last):
File "", line 2, in
File "/site/home/postgres/.venv/lib64/python3.9/site-packages/psycopg/cursor.py", line 189, in fetchone
record = self._tx.load_row(self._pos, self._make_row)
File "/site/home/postgres/.venv/lib64/python3.9/site-packages/psycopg/_py_transformer.py", line 331, in load_row
record[col] = self._row_loaders[col](val)
File "/site/home/postgres/.venv/lib64/python3.9/site-packages/psycopg/types/string.py", line 117, in load
return data.decode(self._encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 32: invalid start byte
```

### To Reproduce

I also saw the same results on psycopg2
```
import psycopg
conn = psycopg.connect('host=/run/postgresql port=5433 dbname=my_db_name')
cur = conn.cursor()
cur.execute("SELECT name, setting, unit, context, vartype, boot_val, min_val, max_val, sourcefile, pending_restart FROM pg_settings;")
cur.fetchall()
```

### OS:

Linux x86_64

### pg_duckdb Version (if built from source use commit hash):

1.0.0

### Postgres Version (if built from source use commit hash):

17.5

### Hardware:

_No response_

### Full Name:

Andrew Jackson

### Affiliation:

Andrew Jackson

### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

### Did you include all relevant data sets for reproducing the issue?

Yes

### Did you include all code required to reproduce the issue?

- [x] Yes, I have

### Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

- [x] Yes, I have

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Python psycopg reproduction against PostgreSQL 17.5 with pg_duckdb 1.0.0 installed, focusing on the SELECT from pg_settings and the psycopg cursor fetch path shown in the traceback. Done means the query can fetch all rows without the reported UnicodeDecodeError, with a regression test covering the reproduced setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.