pg.ddx.io pgpartman/pg_partman GitHub issues and pull requests
help / color / mirror / Atom feed[pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
12+ messages / 3 participants
[nested] [flat]
* [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-17 14:12 "TanelPauls (@TanelPauls)" <noreply+TanelPauls@github.com>
0 siblings, 0 replies; 12+ messages in thread
From: TanelPauls (@TanelPauls) @ 2026-11-17 14:12 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
After upgrading to PostgreSQL 18.7, the background worker fails on every run. Calling the maintenance procedure manually still works.
### Environment
- PostgreSQL 18.7 (Debian 18.7-1.pgdg13+2), official `postgres:18.7` Docker image (Debian trixie)
- pg_partman 5.5.0, apt package `postgresql-18-partman` 5.5.0-1.pgdg13+2 (from apt.postgresql.org)
### Steps to reproduce
```dockerfile
FROM postgres:18.7
RUN apt-get update && apt-get install -y postgresql-18-partman
```
```sh
docker run -d --name repro -e POSTGRES_PASSWORD=x <image> \
-c shared_preload_libraries=pg_partman_bgw \
-c pg_partman_bgw.dbname=postgres \
-c pg_partman_bgw.role=postgres \
-c pg_partman_bgw.interval=10
```
```sql
CREATE SCHEMA partman;
CREATE EXTENSION pg_partman SCHEMA partman;
CREATE TABLE public.events (id bigint, created_at timestamptz NOT NULL) PARTITION BY RANGE (created_at);
SELECT partman.create_parent('public.events', 'created_at', '1 day');
```
### Actual
On every interval:
```
ERROR: cannot drop portal "<unnamed portal 1>" while it is being set up
LOG: background worker "pg_partman background worker" (PID 91) exited with exit code 1
```
### Expected
The worker runs `run_maintenance_proc()` without errors, as it does on 18.6.
### Notes
- The same setup on PostgreSQL 18.6 with `postgresql-18-partman` 5.5.0-1.pgdg13+1 runs with no errors.
- Running `CALL partman.run_maintenance_proc();` or `SELECT partman.run_maintenance();` by hand on 18.7 works.
- This is probably related to the 18.7 change "Disallow closing a portal that is still being set up" (CVE-2026-116332). The worker sets up its own portal and then calls `run_maintenance_proc()` non-atomically through `SPI_execute_extended` (`src/pg_partman_bgw.c`, around lines 419–427 and 499–507). The COMMIT inside the procedure appears to trip the new check.
- Side note for packagers: `5.5.0-1.pgdg13+2` depends on `postgresql-18 (>> 18.7)`, so installing it on an 18.6 image quietly upgrades the server to 18.7.
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-17 16:03 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
I have this fixed in the next release. Will try and have it out this week.
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-17 16:03 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 assigned @keithf4.
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-17 16:03 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 applied label "confirmed bug".
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-17 16:03 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 applied label "fixed in next release".
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-17 16:03 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 set milestone to "Next Patch".
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-19 09:36 ` "kmustkivi (@kmustkivi)" <noreply+kmustkivi@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: kmustkivi (@kmustkivi) @ 2026-11-19 09:36 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
The exact same issue shows up with pg_partman version 5.4.3 and PostgreSQL 14.25.
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-19 10:17 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-19 10:17 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
This has been fixed in version 5.5.1 which was released this week.
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-19 10:19 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-19 10:19 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 removed label "fixed in next release".
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-19 10:19 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-19 10:19 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 applied label "fixed in current release".
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-19 10:20 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 removed milestone.
^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up
@ 2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
10 siblings, 0 replies; 12+ messages in thread
From: keithf4 (@keithf4) @ 2026-11-19 10:20 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 set milestone to "5.5".
^ permalink raw [nested|flat] 12+ messages in thread
end of thread, other threads:[~2026-11-19 10:20 UTC | newest]
Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 14:12 [pgpartman/pg_partman] issue #891: pg_partman_bgw fails on PostgreSQL 18.7: cannot drop portal "<unnamed portal 1>" while it is being set up "TanelPauls (@TanelPauls)" <noreply+TanelPauls@github.com>
2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-17 16:03 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 09:36 ` "kmustkivi (@kmustkivi)" <noreply+kmustkivi@github.com>
2026-11-19 10:17 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:19 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:19 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox