On Thu, Apr 09, 2009, Steve Holden wrote: > > import psycopg2 as db > conn = db.connect(database="maildb", user="@@@", password="@@@", > host="localhost", port=5432) > curs = conn.cursor() > curs.execute("DELETE FROM tst") > curs.execute("INSERT INTO tst (byt) VALUES (%s)", > ("".join(chr(i) for i in range(256)), )) > conn.commit() > curs.execute("SELECT byt FROM tst") > for st, in curs.fetchall(): > print len(st) > > If I change the date to use range(1, 256) I get a ProgrammingError fron > PostgreSQL "invalid input syntax for type bytea". > > If I can't pass a 256-byte string into a BLOB and get it back without > anything like this happening then there's *something* in the chain that > makes the database useless. My current belief is that this something is > fairly deeply embedded in the PostgreSQL engine. No "syntax" should be > necessary. You're not using a parameterized query. I suggest you post to c.l.py for more information. ;-) -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ Why is this newsgroup different from all other newsgroups?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4