On 12/31/2013 03:47 PM, David Kerr wrote:
>
> On Dec 31, 2013, at 1:30 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
>
>> On 12/31/2013 10:56 AM, David Kerr wrote:
>>>
>>> On Dec 31, 2013, at 10:50 AM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
>>
>> Another alternative would be to use the psycopg COPY methods:
>>
>> http://initd.org/psycopg/docs/usage.html#copy
>
> Yeah, i’m doing more than just bulk moving data around so the select / insert pattern
> is more appealing despite the lack of performance / simplicity / elegance of it.
>
> Thanks for the help. I got over the hump and got it working with %(name)s for everything.
One way I tackled this was to use cursor.description to get the fields
names and then build the parameter variables on the fly i.e '%(' +
field_name + ')s' and use that to build a string to put into VALUES.
>
>
>
--
Adrian Klaver
adrian.klaver@gmail.com