This project is archived and is in readonly mode.

#141 ✓resolved
Psycopg website

empty string in composite data types

Reported by Psycopg website | December 3rd, 2012 @ 01:51 PM

Submitted by: Christian von Kietzell

Psycopg incorrectly returns empty strings in composite data types as None instead of ''.

For example:

sql> CREATE TYPE testtype AS (id INT, label TEXT);

python> import psycopg2
python> import psycopg2.extras
python> db = psycopg2.connect(...)
python> caster = psycopg2.extras.register_composite('testtype', db)
python> cursor = db.cursor()
python> cursor.execute("SELECT (1, '')::testtype")
python> cursor.fetchone()[0]
testtype(id=1, label=None)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="">the new tracker</a>.
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins