¡@

Home 

python Programming Glossary: cpy.write

Use binary COPY table FROM with psycopg2

http://stackoverflow.com/questions/8144002/use-binary-copy-table-from-with-psycopg2

point numbers to text write to COPY input cpy StringIO cpy.write ' t'.join repr x for x in num_row ' n' # Insert data database.. BytesIO # 11 byte signature no flags no header extension cpy.write pack ' 11sii' b'PGCOPY n 377 r n 0' 0 0 # Columns id node ts.. 2 4 8 for row in data # Number of columns fields always 5 cpy.write pack ' h' 5 for col fmt size in row_format value id_seq if col..