Category "psycopg2"

Creating db tables with SQLAlchemy and running Celery tasks raises "error with status PGRES_TUPLES_OK and no message from the libpq"

I have an application that runs 2 tasks every minute. Both of them have almost the same code, except for the API endpoint they communicate with (see below). Whe

Parameter substitution when calculating the distance between each row and a common point results in psycopg2 parse error

I have two models with no relation Port and a WareHouse each with a lat and long fields. I want to be able to get the distance for each warehouse from the Port

Why can't my airflow webserver initialize properly?

When I create a dummy DAG following the Apache guide to airflow in Docker and run docker-compose up, the webserver container repeatedly fails and restarts with

copying a table across servers with psycopg3

I'm working from and example in the psycopg3 documentation to copy a table from one database to another: link dsn_src = 'postgresql:///dev_db' dsn_tgt = 'postgr

complex UPDATE query in psycopg2

I've stumbled upon an interesting problem while trying to compose an SQL query using psycopg2.sql I have a function that takes in some kind of data in a dict fo

Heroku H10 error when deploying Flask application with Psycopg2

Runs locally, but not when deployed to Heroku (see error message). I tried adding a runtime.txt file with the Python version, and tried most of suggestions to s

GeoPandas.GeoDataFrame: type "geometry" does not exist

Ubuntu 20.04.3 LTS (WSL2) fiona 1.8.21 geopandas 0.10.2 geopandas-base 0.10.2 geopy

psycopg2.OperationalError: could not translate host name "<address>" to address: Temporary failure in name resolution

I have looked through similar posts on SO and they seem to be specific to using Docker environments and haven't been much helpful. Ours is a little different, w

sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres

I'm trying to connect to a Postgres database with SQLAlchemy. I've installed psycopg2. However, I get the error sqlalchemy.exc.NoSuchModuleError: Can't load plu

how to pass asc desc as params in python psycopg2 raw sql execution?

i have a sample query template to accept dynamic parameters to execute: ps_conn = psycopg2.connect(...) ps_cursor = ps_conn.cursor() ps_cursor.execute(''' S

AWS other modules cant be imported as soon as psycopg2 module is installed

I have installed some python libraries ands added them to a layer of a function. I have got the error which said "errorMessage": "No module named 'psycopg2'" So

Glue 3.0 has Psycopg2 but "No module named 'psycopg2._psycopg'"?

I'm using AWS Glue 3.0 and am trying to connect to Redshift using Psycopg2. At first I was uploading a whl file version of it and it would give me the error abo

Failing to install psycopg2-binary on new docker container

I have encountered a problem while trying to run my django project on a new Docker container. It is my first time using Docker and I can't seem to find a good w

psycopg2: Can't adapt type 'UUID'?

I am using psycopg2 to try to insert an entry into a table where the type of the data is the Postgres type 'uuid'. According to this page, I should be able to

Apple M1: install psycopg2 package Symbol not found: _PQbackendPID

pg_config venv ❯ which pg_config /Applications/Postgres.app/Contents/Versions/latest/bin/pg_config pip3 install -r requirements.txt requirements.txt

Python Postgres Package: psycopg2 copy_from vs copy_expert

Requirement: To load millions of rows into a table from S3 using Python and avoid memory issue I see there are two methods psycopg2's copy_from and copy_expert

Integer out of range when inserting large number of rows to postgress

I have tried multiple solutions and way around to solve this issue, probably something is still I am missing. I want to insert a list of values to my database.

Postgresql/psycopg2 password authentication error even though user and password are correct

I am new to web development in Python and would really appreciate some help. I am trying to set up psycopg2/peewee on WSL (Windows machine). In my Python code I

Postgres 9.5 upsert command in pandas or psycopg2?

Most of the examples I see are people inserting a single row into a database with the ON CONFLICT DO UPDATE syntax. Does anyone have any examples using SQLAlch

How to create a temporary table by passing in data to psycopg2?

I have a pandas dataframe that I want to pass into a psycopg2 execute statement as a temporary table. This should be very simple: pseudo-code... string = """