Re: Problem with psycopg2, bytea, and memoryview

2013-08-01 Thread Frank Millman
"Terry Reedy" 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 agre

Re: Problem with psycopg2, bytea, and memoryview

2013-08-01 Thread Frank Millman
"Neil Cerutti" wrote in message news:b5sk3cfkiq...@mid.individual.net... > On 2013-07-31, Frank Millman 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 compare equal to another

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread dieter
"Frank Millman" 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 deciding whether

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 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 recon

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Neil Cerutti
On 2013-07-31, Frank Millman wrote: > > "Antoine Pitrou" wrote in message > news:loom.20130731t114936-...@post.gmane.org... >> Frank Millman 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 da

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Frank Millman
"Antoine Pitrou" wrote in message news:loom.20130731t150154-...@post.gmane.org... > Frank Millman 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

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Antoine Pitrou
Frank Millman 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 doesn't mak

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Frank Millman
"Antoine Pitrou" wrote in message news:loom.20130731t114936-...@post.gmane.org... > Frank Millman 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

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Antoine Pitrou
Frank Millman 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 bi

Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Frank Millman
Hi all I don't know if this question is more appropriate for the psycopg2 list, but I thought I would ask here first. 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 storin