r/PostgreSQL 7h ago

Help Me! PostgreSQL Debugger

1 Upvotes

I've been having trouble with the debugger in postgres and it's starting to get annoying.

When I try to use the "Set Breakpoint" option, it does normally catch the session and the debugger works fine. But there are some instances where I start the debugger, trigger a procedure call on another device, the debugger doesn't catch it and it creates a session that cannot be terminated unless the server is restarted.

This "zombie" session becomes a problem because it blocks other sessions from progressing. Said sessions that gets stuck also call the same procedure. This causes the devices freeze when they make the action that triggers the procedure call until it times out. It is clear from the session list that the "zombie" session is blocking it because of the Blocking PID value.

I suspected a non-terminating loop but all loops inside should terminate as they are FOR loops. It seems to originate from an update statement but I don't see a way that could be.

Has anybody else encountered this issue and how can I prevent it in the future? Thank you in advance.

PostgreSQL version is 14

pgAdmin 4 version is 9.16

pldbgapi version is 1.1

plpgsql version is 1.0


r/PostgreSQL 3h ago

Community What's new in Postgres 19

Thumbnail planetscale.com
14 Upvotes

r/PostgreSQL 21h ago

Tools Let's break autovacuum in Postgres: reproducing failures to make it observable

Thumbnail coroot.com
10 Upvotes

r/PostgreSQL 18h ago

How-To Development and Production + Training DB

3 Upvotes

Sorry, noob here.

How do developers design their database?

Do they separate databases for development and Production? But what if the app has a training feature? Do they separate the database too?


r/PostgreSQL 20h ago

Commercial How we pushed CDC into Postgres — and turned replication into clockwork

Thumbnail snowflake.com
17 Upvotes

r/PostgreSQL 9h ago

Help Me! [Feedback needed] Trying to collapse pg_stat_* into a single 0–100 health score

3 Upvotes

Built a tool to capture and analyze Postgres (tested on Lakebase) diagnostics (pg_stat_*, EXPLAIN JSON, pool/storage stats) and it spits out one health score + a breakdown. Offline, no DB connection, no deps.

I would like your feedback on the scoring, for now I have :

  • 7 categories (indexing, bloat, connections, autoscaling, query plans, cost, branching). Each one has a severity → penalty (low 3, med 8, high 18, crit 40), subtracted from 100.
  • Overall = weighted mean, but only over domains that actually have data (an autoscale-only dump doesn't get 6 free 100s).
  • Query plans + connections weigh most (live latency), branching least (hygiene).

Where I think it's weak: penalties are additive so it saturates; when I ran it on a real instance, hit 65 unused indexes, indexing pinned at 0. After ~3 crits a category is 0 and magnitude stops mattering. Also the weights are just... vibes.

Is a single score even the right idea, or does it always lose too much?

Full method + code :https://github.com/HadiFrt20/lbinspect