Questions tagged [postgresql]
PostgreSQL is an open-source, relational database management system (RDBMS) available for all major platforms, including Linux, UNIX, Windows and OS X. Mention your version of Postgres when asking questions. Consider dba.stackexchange.com for questions concerning the administration or advanced features.
postgresql
177,627
questions
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
3
answers
29
views
Order by the oldest relation Postgres
So I have 2 tables - Videos and Watches (with datetime). I want to order the videos by the last time watched by a given user, with the never before watched videos coming first and the rest being ...
0
votes
1
answer
23
views
Does using a transaction for read queries provide benefits under Read Committed Isolation Level in PostgreSQL?
I'm using Prisma with PostgreSQL. As I read about the transaction isolations in PostgreSQL, I wondered if I am using transactions without any benefits or if I understood the subject correctly.
async ...
0
votes
0
answers
24
views
PostgreSQL not using index on materialized view
I've got a materialized view which has 2 columns (patient_id BIGINT, department_ids TEXT[]).
It is a handy precomputed dataset used to filter patients who have received care in a hospital department ...
-1
votes
2
answers
48
views
Docker postgres connectivity isuue
Can anyone help me please with this?
what I run:
docker run --name pgres --rm \
-e POSTGRES_USER=uzer \
-e POSTGRES_PASSWORD=1234 \
-e POSTGRES_DB=sample_db \
-p 5432:5432 postgres:14....
-1
votes
0
answers
27
views
NestJs + Angular Questions [closed]
I have one question,
Is it possible to create logic kind of "folder structure creation" in nestJS or we can say using API, i want to create folder structure.
Using get request (backend side-...
0
votes
0
answers
26
views
I want to create a role with permission for SLUD only [duplicate]
I want to create a role for connecting with the back-end, and I want it to only have select, insert, update, and delete permissions to prevent SQL injection.
I use this script:
ALTER ROLE "SIUD&...
-1
votes
2
answers
32
views
Postgres Query to join multiple tables properly
I want to join two tables to get the output as shown in Table4. Below are the details:
Table1: SalesData
Date
PlatformId
UnitsSold
Revenue
ChannelId
2024-07-01
ABCD1
12
1200
1
2024-07-02
ABCD1
11
...
0
votes
0
answers
15
views
DBT not creating a table when `dbt run` is executed
I'm trying to run the default configuration that gets generated from dbt init, that looks something like this:
schema.yml
version: 2
models:
- name: my_first_dbt_model
description: "A ...
-1
votes
0
answers
27
views
postgreSQL whats wrong with my query ? Column not exists [duplicate]
why I am getting this error ?
ERROR: 42703: column "8c6984fc-5e7e-41cd-9f4c-3bc0c56eaebc" does not exist
LINE 21: WHERE u.id = "8c6984fc-5e7e-41cd-9f4c-3bc0c56eaebc" AND u....
1
vote
0
answers
24
views
Byte64 image text not rendering in localhost development environment when setting as image source (React)
I am working on a website where I am getting images from a database. The images are stored as "bytea" variables in a Postgres SQL database. As from all I've researched on stackoverflow and ...
-1
votes
0
answers
17
views
issue in running postgres locally via nodejs
const message = name === 'notice' ? new messages_1.NoticeMessage(length, messageValue) : new messages_1.DatabaseError(messageValue, length, name);
^
error: password authentication failed for user &...
-1
votes
1
answer
32
views
PostgreSQL Window Function with equality predicate
I have the following query in PostgreSQL. Everything works as expected. It returns a single row for each grp. The row returned has the greatest id within the grp.
with tbl1(id, grp, name) as (
...
0
votes
0
answers
27
views
psycopg2 and PostgreSQL --- FATAL: password authentication failed for user "xyz"
connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "xyz"
I have changed contents of /etc/postgresql/14/main/pg_hba....
0
votes
0
answers
22
views
Setting flyway schema - postgres database
I have an issue while trying to set the schema for a flyway migration. This is for a generic migration that I plan to run in several different schemas.
Migration looks like this:
CREATE TABLE foo (
...