Skip to main content
The 2024 Developer Survey results are live! See the results

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.

1 vote
1 answer
30 views

How do I decrypt data originally encrypted with `pgp_pub_encrypt` with the `gpg` command line?

For reasons, I have data that was originally encrypted with the pgp_pub_encrypt function in PostgreSQL, using public/private keys that I have, like this: INSERT INTO testtable(testdata) VALUES(...
Jon Buys's user avatar
  • 529
0 votes
1 answer
27 views

psql error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory

I was installing postgres on macos sonoma (apple M1 chip) and after installing, then starting the service and finally running psql in the terminal I ran into this error psql: error: connection to ...
Njeri Ngigi's user avatar
0 votes
1 answer
38 views

SQL full outer join, default value to column in other table

I'm attempting to do a full outer join in Postgres to see how data changes between the past 24 hours and the 24 hours before that ("today" and "yesterday" euphemistically). Some ...
callmetwan's user avatar
  • 1,280
0 votes
0 answers
50 views

Wrong index is chosen when data are not random

I created a simple table: CREATE TABLE logs ( user_id int4 NOT NULL, create_time timestamptz NOT NULL DEFAULT now() ); Inserted some random data: INSERT INTO logs (user_id) (SELECT RANDOM() *...
dafie's user avatar
  • 1,033
0 votes
0 answers
24 views

How do I update a column based on a match to 2nd table using another column from my target table?

This is a postgresql DB. I have users in my users table that are associated with a customer entity by a customer_id column. The customer is broken down into smaller segments by department and the ...
MikeD's user avatar
  • 13
0 votes
0 answers
36 views

PostgreSQL deployment via ARM template failing due to too many configuration changes

I'm trying to deploy a PostgreSQL database via ARM template, along with around 33 config changes during deployment. Some of the configurations are updated but the rest fail with '<server>' is ...
thmswlkr's user avatar
0 votes
0 answers
11 views

Typeorm PostgreSQL schema acts like not existing even it exists

I have a database in postgres with different schemas. I want to use schema named g which contains my tables, see: This is what app module looks like: ... TypeOrmModule.forRootAsync({ imports : [...
Martin Fric's user avatar
0 votes
0 answers
13 views

How to Upsert Nested Relations in Prisma, using connectOrCreate? connectOrCreate doesn't update deeply nested relation

I'm working on an application using Prisma ORM with a schema that includes Profile, Contact, and SocialMedia models. I need to perform an update operation on a Profile, which should also handle ...
Jakub Kanna's user avatar
1 vote
1 answer
50 views

how to calculate the amount?

In postgresql using query WITH RECURSIVE rel_rec AS ( SELECT 1 AS depth, *, ARRAY[lvl] AS child_path FROM types_of_work WHERE parent_id IS NULL ...
dutik's user avatar
  • 27
0 votes
0 answers
17 views

Can't use ACCESS EXCLUSIVE MODE for locking table in Spring boot app

On my project i use QueryDSL for access to Postgres db. Recently i got task to set lock on table so only one instance of app can use table (locks on rows can't be used). I tries to use in code ACCESS ...
Ar.Kuzmin's user avatar
0 votes
0 answers
21 views

Apostrophes in fields causing unterminated CSV quoted field error during import /copy operation

I am trying to execute a copy command to import data from a .csv file to my Postgres database. ( I'm working with PGAdmin 4.8.7 (desktop) and PostgreSQL 16.3.2.) A sample script is as follows: copy &...
Alandmuse's user avatar
1 vote
1 answer
22 views

Query produces "function unnest(unknown) is not unique error", but is executed fine by the application

I was playing around with composite types in Postgres and Npgsql, and noticed interesting behaviour. I have a UDT in the db created as follows: CREATE TYPE ids_test AS (first int, second int); In ...
Vlad Stryapko's user avatar
0 votes
0 answers
28 views

Filtering by time zone in postgres sql using EF Core

I'm developing an app using ASP.NET Core 8 and EF Core 8. I have installed the package Npgsql.EntityFrameworkCore.PostgreSQL Version=8.0.2. I have a scenario where I need to filter an entity by date ...
thanzeel's user avatar
  • 582
0 votes
0 answers
16 views

PrismaClientInitializationError: Can't reach database server

I'm unable to get the site running and connect to the database. I keep getting this error whenever I do npm run dev. I have even attempted to set connect_timeout to 1 and pool_timeout to 0, pgbouncer ...
Ahmed B's user avatar
  • 49
-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:...
Brian Nzuki's user avatar

15 30 50 per page