Re: Problem with psycopg2, bytea, and memoryview

2013-08-02 Thread Frank Millman
Terry Reedy tjre...@udel.edu wrote in message news:ktbj9i$4au$1...@ger.gmane.org... On 7/31/2013 9:07 AM, Antoine Pitrou wrote: I would suggest asking the psycopg2 project why they made this choice, and if they would reconsider. Returning a memoryview doesn't make much sense IMHO. I

Re: Problem with psycopg2, bytea, and memoryview

2013-08-01 Thread dieter
Frank Millman fr...@chagford.com writes: ... At present, I loop over a range of columns, comparing 'before' and 'after' values, without worrying about their types. Strings are returned as str, integers are returned as int, etc. Now I will have to check the type of each column before

Re: Problem with psycopg2, bytea, and memoryview

2013-08-01 Thread Frank Millman
Neil Cerutti ne...@norwich.edu wrote in message news:b5sk3cfkiq...@mid.individual.net... On 2013-07-31, Frank Millman fr...@chagford.com wrote: Can anyone explain *why* the results do not compare equal? If I understood the problem, I might be able to find a workaround. A memoryview will

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Antoine Pitrou
Frank Millman frank at chagford.com writes: I have some binary data (a gzipped xml object) that I want to store in a database. For PostgreSQL I use a column with datatype 'bytea', which is their recommended way of storing binary strings. I use psycopg2 to access the database. It returns

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Frank Millman
Antoine Pitrou solip...@pitrou.net wrote in message news:loom.20130731t114936-...@post.gmane.org... Frank Millman frank at chagford.com writes: I have some binary data (a gzipped xml object) that I want to store in a database. For PostgreSQL I use a column with datatype 'bytea', which is

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Antoine Pitrou
Frank Millman frank at chagford.com writes: Thanks for that, Antoine. It is an improvement over tobytes(), but i am afraid it is still not ideal for my purposes. I would suggest asking the psycopg2 project why they made this choice, and if they would reconsider. Returning a memoryview

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Frank Millman
Antoine Pitrou solip...@pitrou.net wrote in message news:loom.20130731t150154-...@post.gmane.org... Frank Millman frank at chagford.com writes: Thanks for that, Antoine. It is an improvement over tobytes(), but i am afraid it is still not ideal for my purposes. I would suggest asking the

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Neil Cerutti
On 2013-07-31, Frank Millman fr...@chagford.com wrote: Antoine Pitrou solip...@pitrou.net wrote in message news:loom.20130731t114936-...@post.gmane.org... Frank Millman frank at chagford.com writes: I have some binary data (a gzipped xml object) that I want to store in a database. For

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Terry Reedy
On 7/31/2013 9:07 AM, Antoine Pitrou wrote: Frank Millman frank at chagford.com writes: Thanks for that, Antoine. It is an improvement over tobytes(), but i am afraid it is still not ideal for my purposes. I would suggest asking the psycopg2 project why they made this choice, and if they