All Questions
Tagged with postgres or postgresql
175 questions
2
votes
0
answers
78
views
Generic UnitOfWork implementation with Dapper. (Updated)
Here's my attempt to implement the suggested corrections I received in my previous post. Since System.Data.IDbTransaction doesn't support ...
10
votes
2
answers
1k
views
Multithreaded UDP server that advertises itself in a PostgreSQL database and launches other servers in response to messages from a client
Description
For fun, and to learn some C++, I've decided to reimplement the entirety of EVE online as I remember it. (I'm aware this is an insane and likely unreachable goal, that's intentional).
I'...
5
votes
2
answers
719
views
A schema for awallet system that allows transfers between users
I am currently working on a wallet system that allows transfers of money between users. I tried creating this as a Stack Overflow question, but it was rejected. I'm not sure if this is the right ...
3
votes
1
answer
74
views
PostgreSQL Search Feature
The Problem
I am developing a search feature in PostgreSQL that involves a collection of JSONB documents stored in a table, which have been standardised. The goal is to enable clients to perform ...
1
vote
0
answers
112
views
Todo application using Spring Boot 3, Dockerized Postgres, Java 17, Maven
I'd like to have code review for backend of todo app.
It has 2 main functionalities:
Authentication and authorization using Spring Security and JWT token.
CRUD for tasks
In particular I'd like to ...
2
votes
1
answer
81
views
Update table with data from another table under certain criteria
I need to update a lot of data from one table based on criteria from another table.
My tables and records in those tables look like this:
This is Users table where i can have many records for single ...
2
votes
1
answer
169
views
Extracting authors and books from XML and inserting them into PostgreSQL
There is a tree of start folder, it's subfolders, their subfolders, etc. In each folder, subfolder, etc. there are the same structured XML files stored.
books.xml
...
2
votes
0
answers
130
views
A Python base class for a family of Postgres server manager classes
I'm working on a repo the purpose of which is to create and manage a local PostGIS server. (PostGIS is a bit niche, but it boils down to a few extra spatial data types and built-in SQL function. With ...
1
vote
1
answer
64
views
PostgreSQL query which return metrics joining different tables
I have a query that can be seen on this fiddle and I'm relatively new to PSQL, having a few months of experience.
DB Fiddle
As mentioned in the comment I should put the query here and the code is ...
1
vote
0
answers
110
views
Go REST API feedback [closed]
My intention is to create an API as generic and DRY as possible using Go. To achieve this, I have made some more or less common decisions:
To use AJAX call to avoid reloading page when updating the ...
4
votes
1
answer
148
views
Django User Model to authenticate using email address and password
This is my second Django project for an actual client and I want some review on one of my important models.
This model will be responsible for authenticating users using their E-Mail Addresses and ...
0
votes
1
answer
49
views
Comparing two columns across tables for a remaining subset
How can I find the unique phone numbers (and collapse them into a single column) from table_1 (while keeping the IDs and date fields), and remove phone numbers that appear in table_2?
table_1
id
...
5
votes
1
answer
153
views
PostgreSQL: Grouping and Aggregating on multiple columns
Problem Statement:
I am working on this simple dataset from Kaggle. I have provided a snippet of data with only required columns in below table. Dataset is quite simple, it has all IPL (cricket) ...
1
vote
2
answers
100
views
Querying and rendering an HTML table of ISP performance statistics
I have multiples measurements and I want to render it into tables like this
Measurements
Operator
browsings
FTP DL
FTP UL
Location
Event
Date
Operator
avg
min
max
avg
min
max
avg
min
max
Verizon
...
1
vote
2
answers
2k
views
A discord.py bot that logs every messages sent in a discord server
Hello Code Review community !
I'm making a bot with discord.py that listens to every message sent in a server and stores it in a database that could be retrieved by admin/mod later.
Here's the ...
6
votes
1
answer
1k
views
Simple Connection Pooling with psycopg2 and PostgreSQL
I am currently using a SimpleConnectionPool from psycopg2 to lease transactions to a PostgreSQL database and would like a review ...
2
votes
1
answer
972
views
Creating SQL Table from a Go Struct
I have been building an API in Go, which I want to link to a Postgres SQL table. I have always used NoSQL previously but thought ...
4
votes
1
answer
809
views
Historical Funding Rate Miner for ftx.com
I recently started to take a look at the Go programming language and decided to write a small project without practical use.
The objectives were:
Regularly poll the latest funding rates from https://...
6
votes
1
answer
844
views
Air Quality/Environment Monitoring Web App using Plotly Dash
Overview & Motivation
This project manages and displays sensor data (temperature, humidity, Air Quality Index). The sensor data is displayed by the sensor manufacturer, PurpleAir, but their tool ...
2
votes
0
answers
38
views
A task to store user's favorited projects in postgres using python
I am not happy with two functions calling get_user() since while testing I mock get_user and to test with get_user_returns_null case, it returns Null for both ...
2
votes
1
answer
125
views
Selecting changes from a temporal table
I'm using Temporal Tables on postgresql (https://github.com/arkhipov/temporal_tables) and C# with dapper.
I'm storing an entity together with its changes.
Here's an example entity, with an Id and two ...
3
votes
2
answers
111
views
Fetching all nodes of a directed graph by an id of any node
Task: Rowset of all reachable(in any direction) nodes from any node in a graph. In other words I need to extract all nodes of a particular graph from a table in the database where graph specified by ...
2
votes
0
answers
50
views
Handling failures in DB transactions
This code is meant to retry the db operation when a DB connection breaks: OperationalError.
A transaction can fail for example when a db is being restarted and a commit fails. Or when a network error ...
3
votes
1
answer
127
views
Modelling user preference system with categories
I am modelling a user preference system with the following requirements
a user can have attributes (foods they eat)
a user can have dynamic categories of preferences
users which have all their ...
2
votes
1
answer
89
views
My Django custom user model
I followed a video on YouTube to create a custom user model, this is my attempt:
...