178,901 questions
Advice
0
votes
2
replies
23
views
How to edit database on systemctl enable/disable?
I am converting a set of legacy startup scripts to systemd to allow for compatibility with future versions of Debian. Historically, these scripts started or didn't start on boot based on a value ...
0
votes
0
answers
52
views
Spring Boot cannot connect to PostgreSQL in Docker
I'm having a persistent issue with Spring Boot 3.5.15 connecting to PostgreSQL 16 running in Docker. I keep getting:
FATAL: password authentication failed for user "attendance"
What I've ...
Best practices
0
votes
0
replies
50
views
App with Postgres DB looking for reporting layer
Given an app with a postgres DB. How could best-practice stacks look like to add
some near-realtime reporting on recent events
daily reporting on heavily aggregated/transformed data
storage of ...
0
votes
1
answer
82
views
Migrate only data from specific schema
I am trying to migrate tables and data from SQL Server to PSQL, but I only want to migrate tables from a specific schema.
The docs specify how to include and exclude tables in a schema, but I haven't ...
-4
votes
0
answers
91
views
Weight avg complication [closed]
I want to find out what is real number of employees in one industry with code. I want that for weight average to avg wage. This is my script, and after running it I got empty output. Next procedure ...
0
votes
0
answers
60
views
dbt1005 error — postgres adapter not supported by dbt Fusion in official dbt VS Code extension v0.78.0
I am building a dbt project called Carbon-Stream using dbt-core with a PostgreSQL database running in Docker on Windows. I installed the official dbt VS Code extension by dbt Labs and configured my ...
Best practices
0
votes
13
replies
145
views
Is Python an efficient way to automate View/Table construction for database?
Is it “appropriate” to use Python to automate the creation of certain tables/views in PostgreSQL?
The thing is, some columns have too many unique values, and writing the script becomes time-consuming ...
Best practices
0
votes
2
replies
70
views
How to architect user meta data in the database that will scale
I have a database which has your typical user table. But I want to store user meta in a way which will scale. This table will store many things from preferences, to dismissed alerts and the like.
I am ...
Best practices
1
vote
3
replies
106
views
Best practice for updating nested resume data in PostgreSQL: delete-and-reinsert vs differential updates?
I'm building a resume builder application using FastAPI and PostgreSQL (via Supabase).
My data is normalized across multiple tables:
personal_info
locations
skills
experience
education
projects
...
Best practices
0
votes
6
replies
123
views
Merge rows of a SQL table to fill null with existing values
I have a SQL table like this
Id
A
B
1
value1
null
1
null
value2
Is there a nice way to make a select query returning
Id
A
B
1
value1
value2
Of course, I have many more rows lines and many more columns ...
Best practices
1
vote
4
replies
72
views
Multiple Tables or Single Table in PostgreSQL
I am designing a database schema for storing original images and their edited versions, and I am trying to determine whether a normalized two-table design or a self-referencing single-table design ...
1
vote
2
answers
181
views
Calculate customized ASCII values without using Loop/Cursor
I want to convert the following loop based query (from Oracle) to a set-based query (to PostgreSQL) without using Loop/Cursor.
The following code used to calculate/generate numeric values for the ...
2
votes
2
answers
116
views
Matching multiple pairs of values between two tables; looking for an efficient maintainable method
I have the following two tables:
Table article_description:
article_code
locale
article_description
0001
EN
SAMPLE DESCRIPTION THAT MAY CONTAIN A KEYWORD ASC
0001
NL
DUMMY OMSCHRIJVING MET KEYWOORD ...
Best practices
1
vote
1
replies
83
views
How to design a backend data class
I'm building a backend server using Ktor and Exposed with PostgreSQL. According to the docs (https://ktor.io/docs/server-integrate-database.html#add-starter-code) I created data classes like so:
@...
-1
votes
0
answers
77
views
Table with RLS, FK, text columns takes a lot of time [closed]
I have this table structure which is for a multi-tenant saas based application:
CREATE TABLE IF NOT EXISTS schema_x.table_x
(
col1 integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START ...