178,981 questions
0
votes
0
answers
51
views
postgres function "is not unique" [closed]
I am using PostgreSQL 18.0 and I have written a function with default parameters which inserts movie into the table. However, when I add the argument which must be added, it gives error:
SQL Error [...
1
vote
2
answers
9k
views
postgres / docker: password authentication failed for user
So I am trying to set up my environment for a laravel / react application.
I am having trouble making a connection with the database.
The issue arises when I run composer install, or try to access my ...
1
vote
1
answer
14k
views
Postgresql server closed the connection unexpectedly
Having one of the most unusual problems I ever encountered.
I'm having my PostgreSQL database installed on a windows server, and listening on all ip addresses:
listen_addresses = '*'
I can access and ...
5
votes
3
answers
49k
views
Python psycopg2 syntax error
I am new to python and working on using the psycopg2 to insert data in postgres database. I am trying to insert items but get the error message
"Psycopg2.ProgrammingError: syntax error at or near "...
28
votes
2
answers
22k
views
Duration of PostgreSQL ALTER COLUMN TYPE int to bigint
Let's say I have a table that has an id that is an INTEGER GENERATED BY DEFAULT AS IDENTITY
I'm looking to document how to change the type, if in the future an integer is too small and I need to ...
0
votes
0
answers
65
views
Purview SHIR scan to Posgresql hosted on premise
Purview scan using SHIR to on prem RHL hosted postgresql fails with the error
"The version of the linked service not supported"
I tried replicating by deploying postgres1ql on windows and ...
2
votes
1
answer
47
views
Storing store time of day ranges where timezone matters
I need to store some store hours that exist in different time zones and may be interacted with in different timezones through an admin portal where it will display store time and local time.
I know ...
0
votes
0
answers
35
views
Cannot connect to PostgreSQL over Cloudflare Tunnel
I’m running into a problem exposing a PostgreSQL database through a Cloudflare Tunnel, and I’m hoping someone with deeper Cloudflare Zero Trust/WARP experience can help me understand what’s going on.
...
0
votes
0
answers
26
views
Spring native query (declare..begin..end) with parameters
I have trouble passing parameters for a native query with declare..begin..end style.
This code doesn't work:
@Test
@Transactional
void foo() {
em.createNativeQuery("""
do
...
11
votes
3
answers
14k
views
PostgreSQL - Insert data into multiple tables simultaneously
I am having a data insertion problem in tables linked by foreign key. I have read in some places that there is a "with" command that helps in these situations, but I do not quite understand how it is ...
Advice
1
vote
2
replies
71
views
AWS How to identify/recommend the instance type for an RDS?
I am currently working on recommendation for aws rds instance type recommendation. We have identified the instances which are underutilised.
I want to know how to recommend a better version of rds ...
3
votes
0
answers
94
views
How to text-search in PostgreSQL when using RLS?
Over the past week, I’ve been working on implementing text search in a NestJS application using PostgreSQL. The challenge is that the app supports multiple tenants, all sharing the same tables, so we ...
0
votes
0
answers
186
views
Supabase Storage RLS Violation Despite Correct Policy Check?
I'm encountering a persistent RLS violation when trying to upload files to Supabase Storage using the JS client (supabase-js). The goal is to allow only authenticated users listed in a public.admin ...
1
vote
1
answer
58
views
Prevent user from manipulating subset of columns by RLS on view with no RLS on table
I want to use use VIEWS for column security. db<>fiddle
create table users(user_id, first_name, create_time)as values
(1, 'Adam', 'yesterday'::timestamptz)
, (2, 'Bob' , 'today');
create ...
0
votes
0
answers
64
views
Is it possible to use a table alias generated in a lateral subquery in another lateral subquery?
The doubt arises from a scenario like this:
I have a table named one_table that has many related rows in another table named another_table, via foreign key like this another_table(one_table_id) ...
11
votes
5
answers
6k
views
Treating `null` as a distinct value in a table unique constraint
I have a table which I use to define default and custom options for a client. If the custom_id field has a value then it represents a record for a unique custom job. If it is empty then the record ...
18
votes
6
answers
54k
views
Error when migrating models to database Prisma
I'm starting a project where I have to learn a new technology and I chose to build a full-stack app with Prisma and Next.js. I'm using both for the first time. I've built front-end apps w/ React.js ...
-3
votes
0
answers
49
views
Error in PostgreSQL when running Rails and PostgreSQL using Docker Compose [closed]
I'm running Docker Compose on Ubuntu 24, and when accessing PostgreSQL from within the backend container, I get the following error:
root@60128607c5ab:/backend# psql -p 5433 -U postgres
psql: error: ...
3
votes
3
answers
1k
views
Fast access to a PostgreSQL database from AutoHotKey
I'm searching for a way to interact with a PostgreSQL database from an AHK script.
All the ways I currently found include running psql.exe from the command-line and then parsing output. Of course, ...
2
votes
1
answer
45
views
Symfony/Doctrine: PostgreSQL Migration Issue – Undefined column error only in HTTP Kernel (CLI works)
Symfony/Doctrine: PostgreSQL Migration Issue – Undefined column error only in HTTP Kernel (CLI works)
I'm working on a Symfony 7.3 project running on PHP 8.2. I recently migrated the database from ...
4
votes
3
answers
144
views
Regex function to extract numbers from string-type values, separated by "-", to get the difference of each two values
I'm 100% new to Regex so I've been floundering about on regex101 trying to figure out how to get my desired output. I am using PostgreSQL to write a query to extract a set of values from the string. ...
-3
votes
0
answers
66
views
The Rails console is trying to connect to PostgreSQL via Docker and is giving an error [closed]
I'm trying to access PostgreSQL from within my backend application using Docker, but I'm getting the following error:
User.last
#=> There is an issue connecting to your database with your username/...
2
votes
1
answer
80
views
Using pg_try_advisory_xact_lock for events processing with strict ordering
Suppose I am implementing a local Event-Driven service with internal events to decouple logic.
For database we use Postgres 17 and PgBouncer with transactional mode. It's just a single instance.
...
6
votes
4
answers
22k
views
Postgres can't listen to a specific IP address
I'm trying to block access to my PostgreSQL and allow access only to Localhost and my machine external IP, something like: "172.211.xx.xx". This IP is provided by my ISP (Internet Service ...
1
vote
1
answer
8k
views
mkdir: cannot create directory ‘/home/postgres/pgdata/data’: permission denied
I am trying to run a a project with docker-compose and I am getting mkdir: cannot create directory ‘/home/postgres/pgdata/data’: permission denied. This problem only occurs on windows, on macOS the ...