179,080 questions
0
votes
0
answers
21
views
Show all rows where is_back from another table is not null or not exist
I have a table named cars and another table named location_orders_cars.
A employee can order a car for a day and can bring it back so there is a flag location_orders_cars table named is_back.
Of ...
1
vote
1
answer
31
views
postgresql cannot cast text[] to uuid
I have an array like this:
["f383224c-aa95-40c9-a4e4-fa41747f49c5","c783234c-aa95-40c9-a4e4-fa41747f49c6"]
And I want to select with any but I got an error cannot cast text[] to ...
1
vote
1
answer
39
views
SQL query to aggregate and count non-null values across multiple columns
I have the following database schema. It looks at shoppers and how many orders they have made from three websites in a network.
ID
Name
Country
website1_Orders
website2_Orders
website3_Orders
123
...
-1
votes
0
answers
37
views
Python says it has inserted row into DB, but it hasn't
I am working on a simple auth system for one of my projects.
I have a PostgreSQL database with 2 tables, "public"."app_users" and "public"."active_logins"
The ...
0
votes
2
answers
56
views
EF Core doesn't map foreign keys properly when creating new entities
I'm having trouble creating new entities with one-to-one relationships. EF Core is not assigning the foreign keys properly.
As an example, let's take two entities:
public class User
{
public int ...
0
votes
0
answers
23
views
How to set default password for a user in percona-postgresql-operator v.2.6.0
I am trying to set up PostgreSQL in a Kubernetes cluster (in my local environment with kind), using the percona-postgresql-operator. I am trying to set a default password for a user, but it doesn't ...
-1
votes
0
answers
22
views
Save pandas dataframe in postgres database
Is there a way to save pandas dataframe as a value in a postgres database column? Let's say the column was named df_metadata
The use case is that we want to save the dataframe to later run statistical ...
2
votes
1
answer
42
views
Why is timestamptz + interval considered mutable?
I tried to create a generated column that adds timestamptz and interval columns, but Postgres complains that this expression is immutable:
create table test ( ...
0
votes
0
answers
33
views
Spring Boot doesn't catch SQLState custom exception from PostgreSQL trigger – Angular gets 500 but Postman gets 400
I'm working on a Spring Boot + PostgreSQL project where I have a trigger function that raises custom exceptions using RAISE EXCEPTION with SQLSTATE codes.
Here is the PostgreSQL trigger function:
...
0
votes
0
answers
22
views
Podman WSL2 (windows) persistent postgres container
I am trying to get postgres container running on my windows 10 machine with podman on wsl2.
command i am using is
podman run -d --name test-postgres -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin -...
0
votes
1
answer
36
views
PostgreSQL Table Field exists in Type Field;
How do I check if fields of a table exist in a user definend Type in PostgeSQL?
The Thing is that i want to compare the attributes and create a new Table only with the existing fields of the Type (...
0
votes
0
answers
84
views
PostgreSQL simple query slow on server
I use Prisma for two really simple queries in my Node backend
const excavationSiteCount: number = (await client.excavation_sites.count({where: {owner: user}}));
const artifactCount: number = (await ...
1
vote
1
answer
41
views
How to use index to search if trim is used in search value
My Postgres 17 database has a large table with 245 columns containing an indexed column ribakood:
CREATE TABLE firma2.toode
(
...
ribakood character(20) COLLATE pg_catalog."default",
...
...
0
votes
1
answer
32
views
The cache, users, jobs and personal_access_tokens tables are not created in Laravel's public folder
When creating a postgres database, the following tables are not automatically created:
enter image description here
As I understood they should be created in the 'public' folder, but it is empty.
I ...
0
votes
0
answers
46
views
How to implement data encryption in postgresql [closed]
In HRMS service I made employee,salary and other things for employee apis,have done secret manager implementation so that only user with specific roles can access the api now want to implement db ...