This project is archived and is in readonly mode.
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
-
Daniele Varrazzo December 3rd, 2012 @ 02:23 PM
- State changed from new to resolved
Fixed for 2.4.6, thank you for the report.
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="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
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.