All Questions
Tagged with postgresql python
12,807
questions
-1
votes
0
answers
32
views
How to Create Triggers Between Two Databases
In my system, I have a machine on AWS with several databases. My goal is to create some triggers/scripts that continuously read from some databases and, based on the information read, generate or not ...
-2
votes
0
answers
22
views
what is the default database configuration used in django rest framework while using postgres database [closed]
ImproperlyConfigured at /api/token
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
Request Method: POST
Request URL: http:...
0
votes
0
answers
42
views
How to Version Control a PostgreSQL Table?
Backend: Python 3.11 and Django 5.0.6
Database: PostgreSQL 15
Our app deals with reporting from the database. We don't store report SQL queries in the codebase; instead, we store them in DB tables. ...
-2
votes
0
answers
48
views
Cannot connect to a postgresql server from python (OperationalError: SSL connection has been closed unexpectedly)
it's my first time posting on stackoverflow :D
I'm trying to connect to a postgresql database.
Here is my code :
conn = psycopg2.connect(dbname=database, user=username, password=password, host=...
0
votes
1
answer
32
views
automatic cleanup of postgres db after each test
I have sqlalchemy application that talks with a postgres db. I want to do some "integration tests" using testcontainers and trying the various scenarios.
just to make things simple, let's ...
1
vote
2
answers
41
views
How to handle invalid cast operations in JSONB column queries in PostgreSQL?
I have a column called tags of type JSONB in my PostgreSQL table called EMPLOYEE.
There is a use case where I want to allow users to query this JSONB column, i.e., tags.
Users can give inputs like:
...
0
votes
1
answer
63
views
django.db.utils.OperationalError: could not translate host name "postgres.railway.internal"
django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to address: nodename nor servname provided, or not known
My Django project was working great ...
0
votes
0
answers
45
views
I have been trying to launch an application for about 4 days in Django to Render
System check identified no issues (0 silenced).
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\DEV\DJANGO\dealer_project\env\Lib\site-packages\django\db\...
0
votes
1
answer
50
views
How to store nested lists in Postgres?
How can I store nested lists in Postgres in way that's easy to use them in my Python program later?
I plan to write the lists to the database once and reuse them many times. I've been able to store ...
0
votes
2
answers
54
views
SQL not allowing deletion of related data
In SQL I have:
CREATE TABLE Customer(
cust_id INT NOT NULL PRIMARY KEY CHECK (cust_id > 0),
full_name TEXT NOT NULL,
phone TEXT NOT NULL,
...
-1
votes
0
answers
25
views
SQLAlchemy InvalidRequestError: Session Transaction Rolled Back Due to Previous Exception [closed]
I am encountering an error in SQLAlchemy when trying to execute a query. Here is the traceback:
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/orm/query.py", line 3556, in ...
0
votes
0
answers
33
views
data migration (georeferenced data) from oracle to postgres
First, the Python code should connect to an Oracle database and store the retrieved data using the pandas library. Then, a connection to the relevant PostgreSQL database will be established. A table ...
0
votes
0
answers
34
views
How to create a wrapper class around a python class which enables chaining?
I tried to create a wrapper class around an object which implements chaining (pypika queries) and realised it's really really awkward to do.
Tried to add a simple .to_df() method to pypika queries, ...
0
votes
0
answers
41
views
How to pass the query params in text query for pagination in FastAPI paginate?
I have a text query in SQL which I want to use with sqlalchemy python.
stmt=text("SELECT * from table where id=:id and name=:name")
params={"id":"1234", "name":...
0
votes
0
answers
30
views
Celery Task multiple submissions or duplications
I have a simple celery worker(redis and postgresql backend) that runs 3 periodic tasks [every 15 mins, every hour, every day].
For some reason that I haven't been able to deduce yet, my tasks are ...