178,988 questions
Advice
0
votes
1
replies
32
views
PostgreSQL, unique on combination of two columns
In PostgreSQL, it is easy to set a uniqueness constraint for two columns using CONSTRAINT UNIQUE.
For example
CREATE TABLE someTable (
id serial PRIMARY KEY,
col1 int NOT NULL,
col2 int ...
0
votes
0
answers
24
views
Rails 8 test trying to find unknown relation
I've been trying to write model tests for my Ruby on Rails 8 + Postgres project, but even with the simplest tests I get the following error.
I've never had a table or a relationship called listing, ...
0
votes
1
answer
28
views
How to connect to a Postgres accessible under a pathname via JDBC?
I have a Postgres on a server which is available under https://somethig.my.domain/postgres on port 5432. I'm trying to connect to it via DataGrip (which uses JDBC driver underneath), but cannot figure ...
1
vote
2
answers
64
views
Trigger on PostgreSQL updating salary column
I am having some troubles setting a trigger in PostgreSQL. I have a table Employees with columns such as employee_id, salary and hourly_pay. The salary is annual, so I'd like to change the salary when ...
1
vote
0
answers
36
views
MacOS : Postgres dumping result with permission denied, butg sometime passed [closed]
i'm trying to dump data with script file .sh
So i got a folder in /Home with : working , and inside would be dev-sever and dev-docker
When i run docker there is no error but when i open terminal and ...
-1
votes
0
answers
30
views
How to upgrade cluster from Postgres 17 Windows to Postgres 18 Debian [migrated]
Postgres 17 cluster is in Windows server in Estonian locale. Databases are defined like
CREATE DATABASE mydb
WITH
OWNER = mydb_owner
ENCODING = 'UTF8'
LC_COLLATE = 'et-EE'
LC_CTYPE ...
Advice
1
vote
2
replies
43
views
ordering whole query by the field of multiset in jooq
in spring boot, i wanna have nested records, because if that i need to use multiset in my selects. then i need to order the whole query by fields in my multiset. but the problem is that i get a error ...
0
votes
0
answers
118
views
How to use index in simple select
Table has index on name column:
CREATE TABLE firma2.klient
(
kood character(12) primary key,
nimi character(100),
...
);
CREATE INDEX IF NOT EXISTS ...
1
vote
2
answers
109
views
How to call Postgres function from .NET? [closed]
I tried this code:
CREATE OR REPLACE FUNCTION public.t4(in iid int, OUT n1 text, OUT n2 text)
LANGUAGE plpgsql
AS $function$
BEGIN
SELECT DISTINCT n1=l.name, n2=l.comment from ...
Tooling
0
votes
1
replies
27
views
How to write test code for Prisma version 7
For testing Prisma, I used prismock or prisma-mock . But those packages are compatible with Prisma version 6 or earlier. I visit the Prisma Official website, and they are suggesting using jest-mock-...
0
votes
0
answers
32
views
Connection to remote PostgreSQL server with hashtag in password with node-postgres
I have a password for a remote PostgreSQL server that I cannot change. This password contains hashtags (#). From searching, I know that this can be a problem.
I can connect to the server from the ...
Advice
1
vote
6
replies
52
views
Determine Connectedness Components for a Graph with a RECURSIVE Cte
I have a graph given by 2-element sets of points, say in a table
CREATE TABLE edge_set (
INTEGER edge_set_id,
INTEGER point_id
)
I want to determine the graphs connectedness components. These ...
0
votes
1
answer
52
views
What is the practical difference between static and dynamic background workers in PostgreSQL?
I’m trying to understand when to use a static background worker vs a dynamic one in PostgreSQL.
From what I know so far:
Static workers are registered during postmaster startup
Dynamic workers can be ...
Advice
0
votes
3
replies
63
views
PostgreSQL: primary key based on timestamp
I am working on a highload system, which needs to process quite a lot of events, but not an insanely huge amount. The data ingested has to be editable during a short period of time, and then the need ...
0
votes
0
answers
55
views
Error when mapping a list of enums in EF Core to PostgeSQL array [closed]
I have a class with a collection of enums mapped into PostgreSQL native enum:
internal class EventStackFilter
{
// other properties omitted
public List<EventStackEventStatus> Statuses { ...