psycopg2 Questions

3

Solved

Well, the question pretty much summarises it. My db activity is very update intensive, and I want to programmatically issue a Vacuum Analyze. However I get an error that says that the query cannot ...
Unamuno asked 14/10, 2010 at 9:49

19

Solved

I am working on a project for one of my lectures and I need to download the package psycopg2 in order to work with the postgresql database in use. Unfortunately, when I try to pip install psycopg2 ...
Phagocytosis asked 29/9, 2016 at 10:29

3

Solved

I need to ensure that the values in a column from a table are unique as part of a larger process. I'm aware of the UNIQUE constraint, but I'm wondering if there is a better way to do the check. I'm...
Selfconsistent asked 12/8, 2020 at 13:36

3

Solved

I'm trying to figure out why I can't access a particular table in a PostgreSQL database using psycopg2. I am running PostgreSQL 11.5 If I do this, I can connect to the database in question and rea...
Landfall asked 5/12, 2019 at 14:51

4

Solved

I can send select queries with any problem but when I send update and insert queries it start to wait the thread and don't respond anymore. I couldn't be sure but it seems like a loop. I know we m...
Pumice asked 18/9, 2011 at 0:29

3

Solved

Hi I am trying to run postgresql in alpine in docker with SQLAlchemy and flask but anytime I run my app I get this error ImportError: Error loading shared library libpq.so.5: No such file or direct...
Coldiron asked 18/12, 2020 at 5:12

3

Solved

I am loading about 2 - 2.5 million records into a Postgres database every day. I then read this data with pd.read_sql to turn it into a dataframe and then I do some column manipulation and some mi...
Whitewall asked 5/7, 2016 at 12:56

13

Solved

I'm new to Python and Django. I'm configuring a Django project using a PostgreSQL database engine backend, But I'm getting errors on each database operation. For example when I run manage.py syncd...
Wield asked 22/3, 2011 at 16:13

10

I try to install psycopg2 in a virtualenv using pip, the compilation looks ok, it says "Successfully installed psycopg2", but when I try to import it in python interpreter (in virtualenv), it indic...
Cestode asked 6/7, 2012 at 15:52

4

I was using psycopg2 in python script to connect to Redshift database and occasionally I receive the error as below: psycopg2.OperationalError: SSL SYSCALL error: EOF detected This error only ...
Deathbed asked 5/6, 2018 at 21:5

3

I've been trying for some days to connect my python 3 script to PostgresSQL database(psycopg2) in Heroku, without Django. I found some article and related questions, but I had to invest a lot of t...
Schexnayder asked 23/1, 2017 at 17:37

3

Solved

I have installed PostgreSQL by brew on macOS: brew install postgresql Tried these commands, all failed: pipenv install psycopg2 pip install psycopg2 Error: ... clang -Wno-unused-result -Ws...
Magistrate asked 6/12, 2019 at 4:37

5

Solved

I'm using Python and psycopg2 to interface to postgres. When I insert a row... sql_string = "INSERT INTO hundred (name,name_slug,status) VALUES (" sql_string += hundred_name + ", '" + hundred_sl...
Disposal asked 9/3, 2011 at 15:3

2

Solved

I have tens of millions of rows to transfer from multidimensional array files into a PostgreSQL database. My tools are Python and psycopg2. The most efficient way to bulk instert data is using copy...
Conley asked 15/11, 2011 at 22:21

2

My company recently changed our Redshift cluster and now they require an SSL connection. In the past I've connected Python/pandas to Redshift via the method I've detailed here: http://measureallthe...
Hitherto asked 24/6, 2015 at 15:32

11

I would like a general way to generate column labels directly from the selected column names, and recall seeing that python's psycopg2 module supports this feature.
Soinski asked 20/4, 2012 at 19:18

4

Solved

What's the best way to make psycopg2 pass parameterized queries to PostgreSQL? I don't want to write my own escpaing mechanisms or adapters and the psycopg2 source code and examples are difficult t...
Debacle asked 23/9, 2009 at 15:28

4

Solved

I have a Pandas dataframe that I'm inserting into an SQL database. I'm using Psycopg2 directly to talk to the database, not SQLAlchemy, so I can't use Pandas built in to_sql functions. Almost every...
Myers asked 20/8, 2015 at 0:3

3

Solved

I am tying to bulk insert a dataframe to my postgres dB. Some columns in my dataframe are date types with NaT as a null value. Which is not supported by PostgreSQL, I've tried to replace NaT (using...
Raddled asked 19/10, 2020 at 21:47

4

Solved

Just started Python a few days ago and I'm using PyCharm to develop a web application with Django. I have libpq-dev python-dev packages already installed, but it's still throwing me the same error:...
Margarethe asked 31/12, 2013 at 21:18

3

Solved

I'm trying to use a server-side curser in psycop2 as detailed in this blog post. In essence, this is achieved with from django.db import connection if connection.connection is None: cursor = con...
Tso asked 28/5, 2015 at 15:15

3

Solved

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 SQLAlchemy or pandas.to_sql? 99% of my inse...
Chilung asked 9/3, 2017 at 12:26

1

Solved

I'm trying to replicate this answer using postgreSQL and psycopg2: https://mcmap.net/q/970250/-is-it-possible-to-update-rows-from-a-key-value-pair My SQL code looks like (I just put the new line he...
Agace asked 4/4, 2022 at 14:48

2

Solved

I feel the answer to my question is in these two SO questions, but I find the answers very poorly worded (or above my pay grade) multi thread python psycopg2 Are transactions in PostgreSQL via psy...
Lockout asked 30/10, 2020 at 3:4

3

Solved

I run a Django site which has a simple ModelForm type view that is generating cursor errors. In the past two days, this view was POSTed to a couple hundred times and about 8% of the time generated ...
Foushee asked 5/6, 2020 at 13:46

© 2022 - 2024 — McMap. All rights reserved.