pg.ddx.io  psycopg/psycopg GitHub issues and pull requests  
help / color / mirror / Atom feed
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 ?

view thread (10+ messages)  latest in thread

Message-ID: <gh-psycopg-psycopg-1040@github.com>
Permalink:  ../gh-psycopg-psycopg-1040@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox