From: zogzog (@zogzog) <noreply+zogzog@github.com>
To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>
Subject: [psycopg/psycopg] issue #1040: Oddity with ltree + query in binary mode
Date: Fri, 04 Apr 2025 09:32:49 +0000
Message-ID: <gh-psycopg-psycopg-1040@github.com> (raw)
Here's a small test to explain it all:
```python
with conn.transaction():
conn.execute(
'create extension if not exists ltree;'
'create table if not exists tree ('
' id serial primary key,'
' path ltree'
')'
)
with conn.transaction():
conn.execute('insert into tree (path) values (\'Hello\')')
r = conn.execute('select path from tree').fetchone()
assert r == ('Hello',)
# binary mode: issue
r = conn.execute('select path from tree', binary=True).fetchone()
assert r == (b'\x01Hello',)
```
Is this a known issue ?