Python and psycopg2 for CSV bulk upload in PostgreSQL – with examples…

In a previous post, I explored using both the COPY command and the CAST() function together in order to upload an entire CSV file’s data into a PostgreSQL database table. This post is a continuation, of sorts. However, I will use Python and the psycopg2 library, in a simple script, to handle these uploads instead of SQL. While I am still a novice with operations such as these, I feel that writing about it is a fantastic way to learn and obtain valuable feedback…

[Head this way for great PostgresSQL blogging >>>]
Advertisements

Wholesale inserts with Python, Psycopg2 and PostgreSQL.

Triple P threat to all data files!!! Hahahaha… Now that I have myself collected and together, in this blog post I will utilize Python, Psycopg2, and PostgreSQL for a bulk upload, importing data from a CSV file to a database table. (more…)

Delete existing record from PostgreSQL database with Python and Psycopg2.

Today’s blog post will show an example of how to delete an existing record from a PostgreSQL database utilizing¬†Psycopg2, a feature-rich Python library, that offers a tremendous amount of functionality for working with Python and PostgreSQL databases.

(more…)