psycopg2 Questions

3

Solved

I currently have a connection string in the format of: "localhost://username:password@data_quality:5432" What is the best method of using this to connect to my database using psycopg2? e...
Karelian asked 1/2, 2022 at 11:40

14

Solved

I have created a deployment package for AWS Lambda with my python file and the dependencies including sqlalchemy and psycopg2. The code works perfectly in accessing the DB locally. But when I impor...
Bullfight asked 30/6, 2017 at 22:20

6

I'm trying to create a new lambda layer to import the zip file with psycopg2, because the library made my deployment package get over 3MB, and I can not see the inline code in my lambda function an...
Elastomer asked 31/7, 2020 at 14:56

2

I've been trying to connect my databse to pgadmin4. I connected it successfully but now my heroku app returns internal server error. In order to debug this I do heroku logs -t and it returns Import...
Alpert asked 20/5, 2020 at 16:34

13

Solved

I am trying to run alembic migration and when I run alembic revision --autogenerate -m "Added initial tables" It fails saying sqlalchemy.exc.ArgumentError: Can't load plugin: sqlalchemy.dialec...
Coelenterate asked 26/3, 2013 at 22:44

9

Using psycopg2 package with python 2.7 I keep getting the titled error: psycopg2.DatabaseError: SSL SYSCALL error: EOF detected It only occurs when I add a WHERE column LIKE ''%X%'' clause to my p...
Harrie asked 9/6, 2014 at 22:53

8

I'm trying to run a code that uses psycopg2 to manipulate a Redshift instance. I have tried by importing a wheel file as I see they are supported in Glue python jobs. I see the library is installed...
Communistic asked 4/8, 2020 at 11:34

5

I want to speed up my program so i'm trying to setup pypy + psycopg2cffi. This program opens a xml, parses it and then insert some data in a database. I'm using currently python3, postgresql and ps...
Hochheimer asked 20/2, 2017 at 10:27

2

Solved

I'm attempting to update several rows at once using a tuple of tuples. I figured out how to construct the sql statement from this post, but implementing it in psycopg2 has proven to be more challen...
Micamicaela asked 9/11, 2017 at 0:49

8

Solved

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 way to run a django project on it. Hav...
Coccus asked 3/7, 2020 at 12:35

6

Solved

I have a python application that opens a database connection that can hang online for hours, but sometimes the database server reboots and while python still have the connection it won't work with ...
Outgrowth asked 15/8, 2009 at 13:17

2

Solved

According to http://docs.sqlalchemy.org/en/rel_0_9/core/pooling.html#disconnect-handling-pessimistic, SQLAlchemy can be instrumented to reconnect if an entry in the connection pool is no longer val...
Protractile asked 29/1, 2015 at 17:16

9

Solved

I am using Python with psycopg2 and I'm trying to run a full VACUUM after a daily operation which inserts several thousand rows. The problem is that when I try to run the VACUUM command within my c...
Bibliofilm asked 19/6, 2009 at 11:26

6

Solved

Let's say I have a json that looks like this: some_json = {'key_a': {'nested_key': 'a'}, 'key_b': {'nested_key': 'b'}} Note that key_a and key_b are optional keys mapped to dictionaries and may...
Frosty asked 7/3, 2015 at 23:35

2

I'm getting the following error message when I try to open up a connection to a postgres database. Perhaps it's related to OpenSSL, but I can't understand the error message. Can anyone help? >&...
Fatherhood asked 15/9, 2014 at 18:1

10

Solved

It's the first time that I can't find the answer about some tech problems Here's my problems: >> conn=psycopg2.connect(database="mydb", user="postgres", password="123",port=5432) Traceback ...
Haustorium asked 31/3, 2011 at 13:7

2

I am experiencing a problem with a Django application that is exceeding the maximum number of simultaneous connections (100) to Postgres when running through Gunicorn with async eventlet workers. W...
Hooker asked 20/3, 2015 at 15:45

4

Solved

I'm building a standalone executable using Cython on Linux. I have the following code: import psycopg2 as pg conn = pg.connect('dbname=**** user=**** password=****') cur = conn.cursor() cur.exec...
Newsy asked 21/3, 2014 at 18:46

21

Solved

I got a lot of errors with the message : "DatabaseError: current transaction is aborted, commands ignored until end of transaction block" after changed from python-psycopg to python-psy...
Lyonnaise asked 5/6, 2010 at 6:5

3

I'm trying to execute 3 different postgresql queries with different table. Each query takes 2 seconds to execute. I was wondering if it's possible to run all 3 queries at the same time so that I ca...
Detonate asked 24/7, 2016 at 2:38

7

Solved

I installed psycopg2 using conda on Windows 10. https://anaconda.org/anaconda/psycopg2 I did it in a clean new conda environment (named wr). I then tried to run this sample app but I am getting thi...
Notarize asked 12/10, 2020 at 8:22

7

Solved

My standard procedure for accessing a PostgreSQL database on a remote server is to first create an ssh tunnel as: ssh [email protected] -L 5432:localhost:5432 -p 222 and then run my query i...
Treadle asked 26/2, 2014 at 16:1

6

I have to construct a dynamic update query for postgresql. Its dynamic, because beforehand I have to determine which columns to update. Given a sample table: create table foo (id int, a int, b in...
Prop asked 13/1, 2016 at 18:33

15

Solved

I am currently trying to install libpq-dev to install psycopg2. The problem is, when I try to install it, an error occurs saying I don't have the latest libpq5 version. However when I try to downlo...
Pleasure asked 7/9, 2020 at 23:48

4

Solved

I've been stuck on a part of a Udemy course. Even the (very helpful) tutor on there has run of ideas. When I try and run my script I get: ModuleNotFoundError: No module named 'psycopg2' I've d...
Thrift asked 30/1, 2020 at 11:58

© 2022 - 2024 — McMap. All rights reserved.