Questions tagged [pg8000]

pg8000 is one of many Pure-Python PostgreSQL interfaces for the Python programming language.

pg8000 is one of many PostgreSQL interfaces for the Python programming language. It is written entirely in and does not rely on any external libraries (such as a compiled python module, or ’s library). It is DB-API 2.0 compatible Pure-Python interface to the PostgreSQL database engine.

pg8000’s name comes from the belief that it is probably about the 8000th PostgreSQL interface for Python. pg8000 is distributed under the terms of a modified BSD license.

PLease use this tag if your query is related to the use of pg8000 or its implementation.

62 questions
2
votes
0 answers

What's the proper SSL parameter to pass into sqlalchemy's create_engine?

I'm having trouble figuring out the proper parameters for connecting to a Postgres database using Django on Heroku with Python 3.7.10 and sqlalchemy 1.3.23. I know that's not the latest release of sqlalchemy, but this started failing the other week…
simplycoding
  • 2,770
  • 9
  • 46
  • 91
2
votes
0 answers

Efficient Creation of Panda's DataFrame's from Parallel Queries

I have a script where I need to create a large data frame from querying a database. I have created a class which divides the query into separate processes dividing the Primary Key on the where clause and pushing the batches of records into a queue.…
2
votes
2 answers

Need overview explanation of dbase connectivity using python

I have been working with python and postgreql for over a year. I can connect and work with postgres databases by blindly using various libraries. But whenever I change platform (most recently from macOS laptop to remote ubuntu server) I go through…
2
votes
0 answers

Cannot Connect to Redshift using federated ADFS and IAM via psycopg2

For user access to Redshift, we are using federated security between ADFS and IAM. We are able to successfully connect and interact with Redshift via dBeaver and other tools using a JDBC connection string, as well as with Python using a user on the…
wmtaff
  • 31
  • 2
2
votes
2 answers

Parameterize a quoted string in Python's SQL DBI

I am using pg8000 to connect to a PostgreSQL database via Python. I would like to be able to send in dates as parameters via the cursor.execute method: def info_by_month(cursor, year, month): query = """ SELECT * FROM info WHERE…
Tim McNamara
  • 18,019
  • 4
  • 52
  • 83
1
vote
0 answers

Proper pg8000 + SQLAlchemy Setup for Google Cloud Function

my apologies in advance as I see there are a bunch of answers that are close to what I need, but no cigar - I'm a C# developer mostly, but am stuck on what should be basic boilerplate setup. I need a small PostGRE SQL client for relatively basic…
Xsjado
  • 347
  • 1
  • 10
1
vote
2 answers

How to specify a search path with SQL Alchemy and pg8000?

I'm trying to connect to a postgres db using SQL Alchemy and the pg8000 driver. I'd like to specify a search path for this connection. With the Psycopg driver, I could do this by doing something like engine = create_engine( …
kamykam
  • 300
  • 2
  • 11
1
vote
0 answers

How to pass a nested array to Postgres stored procedure using pg8000.connect

In Postgres 11 I have a stored procedure which takes as a parameter a nested array. Here is the proof of concept schema and stored proc: CREATE TYPE child_type AS ( i INT, c TEXT ); CREATE TYPE parent_type AS ( p TEXT, children…
Javide
  • 2,477
  • 5
  • 45
  • 61
1
vote
0 answers

How to create sessions for databases in pytest?

I have some pytest project where I do some postgresql requests. I have some functions like get_json, get_user, get_message to get some specific objects from databases and I use these funcs inside of my fixtures. These funcs looks kinda like…
1
vote
1 answer

SQLAlchemy 1.4 "operator does not exist" errors with pg8000

It seems that the previous versions we were on (SQLAlchemy 1.3.23) automatically coerced strings to the appropriate variable type for the query. For example: session.query(my_data).filter(my_data.the_date = '2022-07-01').all() '2022-07-01' would…
BrainPermafrost
  • 644
  • 2
  • 7
  • 20
1
vote
1 answer

MLFLOW and Postgres getting Bad Request error

I have been pulling my hair trying to figure out what's wrong with mlflow. Iam deploying mlflow v1.26 in google cloudRun . back end artitfactory is google storage and backend database is google cloudsql postgres v13 instance. here is my entrypoint…
SaD
  • 63
  • 4
1
vote
0 answers

sqlalchemy postgresql pg8000 return affected rows

How can I return affected rows when using SQLAlchemy + PG8000 for PostgreSQL. Before you respond with, use rowcount, SQLAlchemy mentions that: This attribute returns the number of rows matched, which is not necessarily the same as the number of rows…
dataviews
  • 2,466
  • 7
  • 31
  • 64
1
vote
1 answer

Connection network error writing to google cloud postgresql database

I am a newbie to web development. My task is to download a large amount of data from a web api, and to upload them into a postgres database on google cloud. Because the amount of data is very large, I have a for-loop that scrapes the data…
1
vote
0 answers

SQLAlchemy, Postgres: Run SQL without transaction

I am using SQLAlchemy and pg8000 to connect to a Postgres database. I have checked table pg_stat_activity, which shows me a few select queries in 'idle in transaction' state, many of those. But the application much more reads than writes, that is,…
Leonel
  • 28,541
  • 26
  • 76
  • 103
1
vote
0 answers

Difference between pg8000 and SQLAlchemy

Can anyone please help me on finding the advantage of pg8000 over SQLAlchemy? We are using Python to connect to postgresql and sometimes to Google Firebase. So, which will be helpful for interaction and better performance. -Srivathsava
Bommi
  • 11
  • 2