Partition maintenance and inherited tables leave served rows stale
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by tracing the DDL trigger and subscription reread or stop behavior, then inspect how table reads are built and how live PostgreSQL tests are organized. Reproduce the listed partition operations and the INHERITS example. Done means clients receive current rows after supported partition changes, ordinary tables are read with FROM ONLY, and live tests cover each operation and an inheritance parent.
Written by the indexing model from the issue text.
Description
Problem
A served table can gain or lose rows without any row change reaching the change feed. Clients keep a stale view until they reconnect.
-
Partition maintenance. With
publish_via_partition_root = true, a partitioned table is served under its root's name. Verified on PostgreSQL 17: these commands send nothing to the feed, although each one changes the root's rows.ALTER TABLE events ATTACH PARTITION events_feb FOR VALUES FROM ('2026-02-01') TO ('2026-03-01'); -- rows appear ALTER TABLE events DETACH PARTITION events_jan; -- rows disappear DROP TABLE events_jan; -- rows disappear TRUNCATE events_jan; -- rows disappearTRUNCATE eventson the root is sent and stops the server.CREATE TABLE … PARTITION OFadds an empty partition and needs nothing. -
Plain inheritance (
INHERITS). Reads of a parent table withoutONLYinclude its child tables' rows. The WAL reports a child's changes under the child's own name, so subscriptions on the parent never see them.CREATE TABLE notes (id int8 PRIMARY KEY, body text); CREATE TABLE pinned_notes () INHERITS (notes); INSERT INTO pinned_notes VALUES (1, 'x'); -- served in `notes`, never updated
Expected behavior
The server never keeps serving rows the parent no longer has, or leaves out rows it now has:
- For partition maintenance, the DDL trigger already fires on
ATTACH,DETACHandDROP. The server should either re-read the affected subscriptions or stop, naming the change. Dropping old partitions is routine for retention, so re-reading is likely the better choice. - A
TRUNCATEof a partition fires no DDL trigger, so it needs another signal (for example, a TRUNCATE trigger on the partitions that emits a WAL message), or a documented limitation. - For inheritance, an ordinary table (
relkind = 'r') is read withFROM ONLY, so its rows match its own changes. Partitioned roots stay as they are, sinceONLYon a partitioned root returns no rows.
Acceptance criteria
-
ATTACH(of a table with rows),DETACHandDROPof a partition of a served table don't leave clients stale. - A
TRUNCATEof a partition is either handled or documented as unsupported. -
CREATE TABLE … PARTITION OFkeeps working without a restart. - Reads of an ordinary table use
FROM ONLY, and a child table's rows no longer appear under its parent. - Live tests cover each partition operation and an inheritance parent.
- Dominant language
- Rust
- Stars
- 129
- Forks
- 7
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from juspay/streamgres
-
Make the top-L client diff cost depend on what changed, not on the limitPossibly taken @SahilKhan101 claimed this 2 days ago. Openenhancement
juspay/streamgres#64 · 1 assignee ·
Maintainers usually reply within 1 day
-
Query optimisation: share initial snapshots across LIMIT variants of the same query (donor windows)Possibly taken @sprihaanand-juspay claimed this 3 days ago. Open
juspay/streamgres#58 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 Over a week Newbie friendliness 38/100
juspay/streamgres#56 ·
Maintainers usually reply within 1 day
-
PgBouncer transaction pooling: `prepare` runs outside the read transaction and can land on another backendPossibly taken @sprihaanand-juspay claimed this 6 days ago. Open
juspay/streamgres#53 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
juspay/streamgres#49 ·
Maintainers usually reply within 1 day
All issues in juspay/streamgres
Similar issues
-
Test connection's password prompt says the password is never saved, also for a keychain profileOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
area: settings bug Haiku review: no-score ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MMFoundation/WallpaperMachine#346 ·
Maintainers usually reply within 1 day
-
Make the HTTP server's keep-alive and headers timeouts configurablePossibly taken @mattgodbolt claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
compiler-explorer/compiler-explorer#9902 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jonathanong/no-mistakes#5490 ·
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day