Reading binary data from Postgres 9 - Mailing list psycopg

From Ian
Subject Reading binary data from Postgres 9
Date
Msg-id 1313713708.22500.YahooMailNeo@web39415.mail.mud.yahoo.com
Whole thread Raw
Responses Re: Reading binary data from Postgres 9  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
Hi list,

I am storing a NumPy array in binary form in Postgres with:

import numpy as np
...
my_array = np.array(data_list, np.float32)
cur.execute("insert into my_table values (%s)", (psycopg2.Binary(my_array),))

I've confirmed that this works fine. However when I query this binary data from the database I am having trouble deserializing/getting it back into a NumPy array. The result comes back as a read-only buffer. Does psycopg2 have an opposite of Binary to handle this?

Thanks.

psycopg by date:

Previous
From: Federico Di Gregorio
Date:
Subject: Re: Vacancy!
Next
From: Daniele Varrazzo
Date:
Subject: Re: Reading binary data from Postgres 9