iterating over a postgresql table and updating rows from python -


I am using Python 3 and psycopg2 to connect to a postgrascape table.

Two columns in the table: First there is some changing string and the second is an empty string.

I want to go to all rows and for each row, read the string in the first column, calculate some dragon-implementation function on it, and update the second column with that result.

What would be the most effective (and hopefully idiomatic) way?

Please assume that I should be connected to DB Python

In the most effective way, to copy a column into a text file, Feed through the dragon, minimize the table, and then copy the resultant two columns back.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -