|
From: Greg L. <gre...@ea...> - 2003-11-01 00:45:23
|
At 10:04 AM 10/31/2003, Billy G. Allie wrote:
>Greg Landrum wrote:
>>
>>Greetings,
>>
>>I'm just getting starting with pyPgSQL (I'm in the process of switching
>>over from Interbase/Firebird) and I've hit some odd behavior with bytea
>>columns.
>>
>>I am trying to store pickles in bytea columns of a table and I appear to
>>be encountering problems in the quoting rules. Here's a session:
>>
>You need to tell pyPgSQL that you are inserting a bytea string. you can do
>this as follows:
>
>curs.execute('insert into throwaway values (%s)',
>PgBytea(cPickle.dumps(range(1,129))))I hope this answers your question.
It does, thanks for the help. I had assumed (incorrectly!) that the
adaptor would magically figure this stuff out for me. The PgBytea thing
does the trick though. Thanks!
-greg
----
greg Landrum (gre...@ea...)
Software Carpenter/Computational Chemist
|