Showing posts with the label psycopg2

[FIXED] Get psycopg2 count(*) number of results

Issue Whats the correct way to get the number or rows returned by this query? I'm specifically …

[FIXED] Compose dynamic SQL string with psycopg2

Issue I use psycopg2 in python (2.7.10) to connect to a postgresql DB. The docs are pretty clear a…

[FIXED] syntax to guard against SQL-injection of named identifiers

Issue I'm reading the psycopg2 documentation & wondering how to parametrize SQL identifie…

[FIXED] POSTGRES ALTER procedure syntax error I can't figure out

Issue Here is the error: ERROR: [GET_ALL_DATASETS_BY_DATE] syntax error at or near "LANGUAGE&…

[FIXED] Error: pg_config executable not found when installing psycopg2 on Alpine in Docker

Issue I'm trying to build a Flask app using Postgres with Docker. I'd like to connect to an…

[FIXED] DatabaseError: current transaction is aborted, commands ignored until end of transaction block?

Issue I got a lot of errors with the message : "DatabaseError: current transaction is aborte…

[FIXED] Query String Composition in Psycopg2

Issue I am trying to run a SQL "SELECT" query in Postgres from Python using Psycopg2. I …

[FIXED] Passing table name as a parameter in psycopg2

Issue I have the following code, using pscyopg2: sql = 'select %s from %s where utctime > …