pgsql-hackers/digest / threads mailing list source generated · LLM-summarized

The pgsql-hackers
Weekly Digest

A reader's guide to the discussions, patches, and bickering on the primary development mailing list of PostgreSQL. Summaries are produced by a generative model — useful for orientation, not for citation.

Tuesday, June 9, 2026
50 hot threads
Note Thread statuses and summaries are generated by an LLM-based system and may contain inaccuracies. Always defer to the linked archive thread before quoting.

Hot Threads

showing 50 of 50 threads
01 [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement Patch Review 33 msgs Jun 8, 13:28
opened Oct 15, 13:37 ·last activity Jun 8, 13:28

The proposer introduced pg_get_policy_ddl() to reconstruct CREATE POLICY statements, initially as a function with regclass, name, and an optional pretty boolean. Over several iterations, the function's signature was updated to align with a new VARIADIC options text[] style, similar to pg_get_database_ddl(). Early feedback included minor documentation and style suggestions. A significant issue was identified by Reviewer 1 in v10: the generated DDL for simple boolean USING/WITH CHECK expressions (e.g., USING true) lacked necessary parentheses, causing syntax errors upon re-execution. The proposer addressed this in v11 by ensuring expressions are always parenthesized, mimicking pg_dump's behavior, and added a round-trip regression test to verify correctness. Reviewer 1 confirmed that v11 fixed the issue and passed all tests. Commenter 2 also acknowledged their previous oversight regarding the parentheses.

Recent reply
Jun 8, 12:41 Commenter 2 provides a brief acknowledgement, reiterating their previous acceptance of the correction regarding the need for parentheses in the generated DDL for policy expressions.
archive ↗
02 NULL pointer dereference in syslogger with load_libraries() and -DEXEC_BACKEND at startup Committed 15 msgs Jun 9, 00:28
opened May 25, 07:45 ·last activity Jun 9, 00:28

The proposer reported a NULL pointer dereference in the syslogger during startup when `shared_preload_libraries` are used with `logging_collector` and `-DEXEC_BACKEND`. Through bisecting, the issue was traced to a commit that assigned `MyBackendType` earlier in the process, causing the syslogger to attempt writing to a log file before it was open. A reviewer provided a patch introducing a new boolean flag, `syslogger_setup_done`, to explicitly track when the logging file descriptors are ready. This solution was discussed, refined to include other logging paths, and ultimately committed, resolving the bug.

2 recent replies
Jun 8, 23:20 The proposer thanked the committer for pushing the fix to address the NULL pointer dereference in the syslogger, confirming that the solution effectively resolved the identified issue.
Jun 8, 18:03 The latest reply from Reviewer 1 confirms that the proposed patch, which introduces a syslogger_setup_done flag, has been applied. The reviewer also notes that related code paths in csvlog.c and jsonlog.c were updated, and comments were added for clarity. An observation about early elog(WARNING) messages appearing only in postmaster's stderr was made but deemed acceptable.
archive ↗
03 RFC: Logging plan of the running query Patch Review 47 msgs Jun 8, 12:30
opened Feb 3, 12:46 ·last activity Jun 8, 12:30

This long-running thread proposes a feature to log the execution plan of a running query, without requiring EXPLAIN ANALYZE. The initial patches aimed to allow logging on demand via pg_log_query_plan() and introduce a log_query_plan_pending GUC. Early discussions focused on the mechanism for logging, especially in cases where a query might finish before LogQueryPlan() is invoked. a core developer provided detailed suggestions for a race-free test case involving advisory locks and injection points, which the proposer implemented. Further testing and robustness checks were performed, including looping the test and inserting sleeps, which did not reveal failures. The thread was rebased multiple times. A new reviewer recently rebased the patch (v54), fixed a missing hook call, updated TAP test numbers, fixed Meson build references, adjusted auto_explain.c, and applied pgindent. The new reviewer expressed the importance of this infrastructure for progressive explain features.

2 recent replies
Jun 8, 11:48 The latest reply from the proposer (message 47) acknowledges receipt of the rebased v54 patch from reviewer 1. The proposer expresses appreciation for the help and states that they will review the updated patch within a few days.
Jun 8, 06:08 A new reviewer has rebased the patch (v54) to account for recent PostgreSQL changes and included minor fixes. The reviewer also performed a detailed code review, affirming the importance of this logging infrastructure for future features like progressive explain. The message contains specific technical points for further consideration on the patch.
archive ↗
04 [BUG] [PATCH] Allow physical replication slots to recover from archive after invalidation Patch Review 9 msgs Jun 8, 19:28
opened Dec 15, 18:54 ·last activity Jun 8, 19:28

This thread addresses a regression in PostgreSQL 18 concerning physical replication slots. Previously, physical slots invalidated due to `max_slot_wal_keep_size` could be reacquired if WAL was available via archive recovery. However, commit f41d8468 made this impossible, preventing standbys from resuming streaming and necessitating manual slot recreation. The proposer initially suggested a direct fix to allow reacquisition, but a reviewer highlighted that invalidated slots offer no WAL protection, posing a risk. The proposer revised the approach, introducing an opt-in `auto_revalidate` mechanism for physical slots. This feature enables self-healing for specific invalidation reasons (WAL_REMOVED, IDLE_TIMEOUT) by allowing acquisition with a warning and clearing the invalidation upon successful WAL streaming. A v2 patchset, including core infrastructure, SQL functions, view exposure, comprehensive TAP tests, and documentation, was submitted for review.

Recent reply
Jun 8, 19:15 The proposer rebased the v2 patchset onto the current master branch, resolving a test-numbering conflict. No logical changes were made to the patchset during this rebase, and it has now been formally applied to the commitfest for further review.
archive ↗
05 Logging parallel worker draught Patch Review 18 msgs Jun 8, 16:29
opened Dec 26, 14:25 ·last activity Jun 8, 16:29

This thread discusses a patch that adds logging for parallel worker usage in PostgreSQL, particularly focusing on cases where fewer workers are launched than planned (a "shortage"). The proposer initially included logging for both parallel queries and maintenance commands (VACUUM, CREATE INDEX). A reviewer suggested limiting logging to parallel queries only for simplicity and consistency with existing verbose options for maintenance tasks, proposing a simpler log line format and renaming the GUC setting from "failure" to "shortage". The proposer argued for including maintenance operations due to observability needs in audited systems and centralization of logs/configuration. Subsequent patch versions incorporated simplifying the log message and renaming the setting to "shortage". A committer joined the review, questioning the purpose of one patch, pointing out existing similar logging for VACUUM, suggesting adding logging for parallel GIN index builds, and raising concerns about duplicate log messages with `VERBOSE` mode. The proposer rebased the patch, merged one component, and added GIN index logging, reiterating the distinct use case for auditing. The latest discussion revolves around the format of the error message and the implications of consistency.

2 recent replies
Jun 8, 16:11 The latest reply, from a committer, advises against splitting `errmsg()` messages across multiple lines for better grepability, citing personal preference and potential issues with partial searches. The committer also points out a grammatical error in a proposed message and suggests moving a specific clause out of the translatable message, further questioning if another part should be an `errdetail`.
Jun 8, 11:34 The latest reply from reviewer 1 (message 17) reports that the v11 patch series, submitted by the proposer, failed to build cleanly on the current master branch. The build errors indicated that several identifiers related to parallel worker logging (e.g., log_parallel_workers, LogParallelWorkersIfNeeded()) were referenced but undefined, preventing compilation of multiple backend files. This issue blocked any further runtime testing of the patches.
archive ↗
06 Add pattern matching support for LISTEN/NOTIFY channels Discussing 5 msgs Jun 9, 00:28
opened Jun 8, 21:36 ·last activity Jun 9, 00:28

The proposer suggested adding glob-style pattern matching to `LISTEN` channel names for PostgreSQL 20, providing a proof-of-concept patch and initial benchmarks. A reviewer directed the proposer to previous threads on similar topics. Another reviewer expressed skepticism, questioning the necessity of server-side support given existing alternatives and noting that the current implementation negates the benefits of targeted wakeups from v19. The proposer acknowledged these concerns and is now exploring alternative approaches, such as pattern matching against message payloads rather than channel names.

2 recent replies
Jun 8, 23:08 The proposer acknowledged the validity of concerns regarding the proposed implementation and its impact on targeted wakeups. They suggested exploring alternative approaches, such as implementing pattern matching on the message payload using a `WHERE` clause syntax within the `LISTEN` command.
Jun 8, 22:16 The reviewer expressed skepticism about implementing pattern matching at the server level for LISTEN channels. They suggest that similar functionality can already be achieved by listening to a single channel and performing pattern matching on message payloads. The reviewer also raises concerns that the current implementation might negatively impact performance by undoing the benefits of targeted wakeups, and questions if matching the message body might be a more suitable approach.
archive ↗
07 Fix bug of CHECK constraint enforceability recursion Patch Review 30 msgs Jun 9, 01:28
opened May 26, 03:51 ·last activity Jun 9, 01:28

This thread focuses on fixing a bug in the new feature that allows altering `CHECK` constraint enforceability. The proposer identified that when a parent table's constraint was set to `ENFORCED`, it failed to properly update corresponding constraints in child tables (both regular inheritance and partitioned) that had previously been set to `NOT ENFORCED`. Initial patches aimed to correct this recursion, but complex multiple inheritance scenarios presented by a commenter required further refinement of the logic to ensure that enforced parent constraints were correctly considered up the inheritance hierarchy. Later, a reviewer suggested adding `check_stack_depth()` for deep inheritance chains and optimizing `table_open` calls for performance. An additional discussion involved best practices for `errmsg()` formatting, leading to further refinements in the error messages. The thread is ongoing with the proposer having submitted a v10 patch.

3 recent replies
Jun 9, 00:32 The proposer acknowledges and accepts the reviewer's feedback regarding `errmsg()` formatting standards, committing to follow them in future PostgreSQL code contributions. In response, the latest patch (v10) has been updated to split the "because" clause into an `errdetail` and replace the literal "NOT ENFORCED" with a `%s` placeholder within the main error message string for improved translatability and consistency.
Jun 8, 14:52 The latest reply from Reviewer 1 offers feedback on the errmsg() formatting in the proposed patch. The reviewer expresses a preference for single-line error messages to improve grepability and make grammatical mistakes more apparent, citing personal workflow. The reviewer also suggests further refinement to the content of the error message itself, specifically regarding the "NOT ENFORCED" clause and the use of errdetail.
Jun 8, 11:51 The latest reply from the proposer (message 28) addresses two points raised by reviewer 2. The proposer agreed to add check_stack_depth() to the recursive function and fine-tuned the proposed refactoring for ATCheckCheckConstrHasEnforcedParent to ensure parent tables are opened at most once and only when necessary. However, the proposer disagreed with the suggestion to force errmsg() messages onto a single line, citing existing precedents for multi-line error messages and minimal impact on grepability. The new patch version (v9) incorporates these changes.
archive ↗
08 t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline Patch Review 9 msgs Jun 8, 22:28
opened Jun 6, 09:00 ·last activity Jun 8, 22:28

The thread addresses a buildfarm failure in `035_standby_logical_decoding.pl` where `pg_recvlogical` fails to read WAL segments that have been removed due to a timeline switch during standby promotion. The proposer identified a race condition in `logical_read_xlog_page()` where `walsender` attempts to read WAL from an old timeline (timeline 1) while the server has promoted to a new one (timeline 2). A reviewer confirmed the diagnosis and suggested a similar fix for `read_local_xlog_page_guts()`. The proposer submitted a four-patch series: 0001 fixes the race by checking `GetWALInsertionTimeLineIfSet()` when `RecoveryInProgress()` is true; 0002 adds a test for this fix; 0003 applies the fix to `read_local_xlog_page_guts()`; and 0004 adds a test for 0003. The discussion also covers backpatching considerations for older versions. The latest exchange involves a reviewer's intent to review the patch set and a brief discussion about the optimal injection points for testing.

3 recent replies
Jun 8, 14:34 The reviewer acknowledges the proposer's clarification regarding the testing approach. They confirm their intent to review the proposed patch set, indicating that while they had applied a preliminary patch for evaluation, a full review of the complete solution is forthcoming.
Jun 8, 14:21 The latest reply from commenter 1 confirms the validity of the proposed fix and refines the testing approach. Commenter 1 expresses a preference for the `v1-0002` test strategy over an alternative reproducer, citing clearer injection point naming, avoidance of new injection points in `walsender.c`, and reliance on a single injection point. This feedback is aimed at streamlining the testing for the submitted patches.
Jun 8, 13:00 Commenter 2 reiterates and confirms the detailed explanation of the race condition provided in a previous message by Commenter 1, explaining how a logical walsender, delayed during promotion, might attempt to read pre-promotion WAL segments from an old timeline that have already been removed.
archive ↗
09 expand refint docs with usage info Committed 5 msgs Jun 8, 16:29
opened May 26, 16:53 ·last activity Jun 8, 16:29

This thread proposes a documentation patch to clarify usage information for `refint`'s trigger arguments, specifically addressing potential SQL injection concerns that were reported to the security team. While `refint` is slated for complete removal in v20, the proposer believes the documentation update is still valuable and should be back-patched to v14. The security team concluded that forcibly quoting arguments would cause more breakage than prevent exploits, as trigger arguments are typically controlled by the trigger author. A reviewer suggested mentioning the deprecation, but the proposer preferred to keep that for the actual removal effort. Two other reviewers agreed with the patch. The proposer confirmed it was committed.

Recent reply
Jun 8, 15:36 The latest reply from the proposer explicitly states "Committed.", indicating that the proposed documentation patch, which expands `refint` usage information, has been integrated into the codebase.
archive ↗
10 ci: CCache churns through available space too quickly Patch Review 5 msgs Jun 8, 19:28
opened Jun 5, 20:09 ·last activity Jun 8, 19:28

This thread discusses an issue in GitHub Actions CI where Ccache rapidly exhausts available cache space due to inefficient management across branches. The proposer identified two key problems: caches are uploaded too frequently, even when the hit ratio is high, and a flawed cache key design causes branches named similarly to the default branch to incorrectly use the main branch's cache. A patch was proposed to mitigate these issues by introducing logic to upload new caches only when the existing cache entry's hit ratio is low and by refining the cache key mechanism. The proposer also sought feedback on restructuring the CI configuration using 'composite actions' for better organization, but a reviewer deemed it unnecessary. The reviewer confirmed the patch's effectiveness, noting a minor typo in the commit message.

3 recent replies
Jun 8, 19:28 The latest reply from the proposer is an acknowledgement to the reviewer's feedback. It confirms receipt of the review comments, which primarily consisted of validating the patch's functionality and pointing out a minor typo in the commit message.
Jun 8, 16:10 The latest message from the proposer is a simple acknowledgement following a previous message where the attached patch was marked as removed. This typically indicates that the patch has been adopted and is no longer directly attached to the public thread because it has been committed or integrated into the codebase.
Jun 8, 10:30 The latest reply from reviewer 1 (message 2) confirms that the patch from the proposer works as described and improves ccache efficiency. Reviewer 1 agrees with the proposer's approach, including the decision not to use composite actions, and identifies a minor typo in the commit message ("effictively" should be "effectively").
archive ↗
11 [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements Patch Review 4 msgs Jun 8, 21:28
opened Jun 3, 12:58 ·last activity Jun 8, 21:28

The proposer introduced a patch to add `pg_get_table_ddl()` function, similar to existing `_ddl` functions, to reconstruct `CREATE TABLE` statements along with associated `ALTER TABLE`, `CREATE INDEX`, `CREATE RULE`, and `CREATE STATISTICS` statements. It supports various column-level and table-level features, with options for fine-tuning output. Triggers and policies are noted as TODOs. The proposer opted to reuse existing C helpers. Initial testing was done using `pg_regress`. A reviewer suggested an option for schema-qualified output. Another reviewer reported several bugs related to check constraints on partitions, inherited generated columns, and named not-null constraints not being replayed correctly.

3 recent replies
Jun 8, 21:12 The reviewer identified several bugs in the proposed `pg_get_table_ddl()` function. Specifically, it fails to correctly reconstruct check constraints on partitions, inherited stored generated columns, and named not-null constraints, leading to errors when re-executing the generated DDL.
Jun 8, 19:11 A reviewer suggested enhancing the `pg_get_table_ddl()` function by adding a 'schema-qualified' boolean option. This option would allow users to generate DDL statements without explicit schema qualification, which would be beneficial for scenarios involving schema duplication.
Jun 8, 11:30 The latest reply from the proposer (message 2) announces the submission of v2 of the patch. This new version addresses a Meson build failure and has been rebased on top of the current master branch. The content of the patch remains substantively the same as the initial proposal.
archive ↗
12 Proposal: Conflict log history table for Logical Replication Patch Review 28 msgs Jun 8, 14:28
opened Jun 2, 07:41 ·last activity Jun 8, 14:28

This extensive thread discusses the implementation of a conflict log history table for logical replication. Early in the thread (inferred from message context), a reviewer suggested that the `conflict_log_destination` option should be a string to allow for combined values like 'log, table' and future extensibility, rather than an enum. Subsequent messages delve into detailed patch reviews. Commenter 1 provided extensive feedback on patch `v45-0004`, focusing on `describeSubscriptions` and suggesting improvements for combining `appendPQExpBuffer` calls, maintaining column order, and using a common function for conflict log table names. Commenter 2 raised a concern about explicit `LOCK TABLE` operations on Conflict Log Tables (CLTs) potentially blocking apply workers. Commenter 3 initially favored disallowing such locks but later agreed that allowing them, with users accepting responsibility for consequences, was a cleaner approach if implementing timeouts was complex. Commenter 3 then submitted an updated patch addressing most issues, excluding those from commenter 1 on patch `0004`. Commenter 2 then reported further issues in the `v46` patches, including `NULL` values for `remote_commit_ts`, stale `remote_xid` in two-phase transactions, and an `Assert()` that should be an `ERROR`. Commenter 2 also identified an internal `ERROR: errstart was not called` when `InsertConflictLogTuple()` fails, suggesting `TRY-CATCH` block improvements. Commenter 4 addressed some of commenter 1's earlier comments on a different patch (`v45-0003`) regarding assert placement and field order, confirming some issues were handled in `v47`.

3 recent replies
Jun 8, 13:31 The latest reply from commenter 3 provides a concise acknowledgment regarding the ongoing review of the `v46` patches. Commenter 3 confirms receipt of commenter 2's detailed feedback, indicating that the patch review process remains active and that identified issues are being considered for resolution in subsequent patch versions. This underscores the continuous refinement of the proposed logical replication conflict logging feature.
Jun 8, 11:39 The latest reply from reviewer 2 (message 25) highlights two issues observed with the v46-0002 patch. Firstly, a forced failure in InsertConflictLogTuple() during debugging resulted in an "ERROR: errstart was not called" message. Secondly, reviewer 2 suggests that InsertConflictLogTuple() in the non-error path should also be wrapped in a TRY-CATCH block, to prevent the apply worker from halting if that insert fails. Reviewer 2 asks whether such failures should cause the worker to halt or merely emit a warning, seeking input from other developers.
Jun 8, 06:12 The latest message from proposer 1 thanks another proposer for an updated patch (v46-001), indicating continued work and iteration on the proposed solution. The message then starts listing specific points, suggesting an ongoing detailed review of the new patch version, likely addressing previous feedback and identified issues.
archive ↗
13 log_checkpoints: count WAL segment creations from all processes Discussing 9 msgs Jun 8, 08:29
opened Mar 23, 07:39 ·last activity Jun 8, 08:29

This thread proposes enhancing log_checkpoints output to accurately reflect WAL segment creations from all processes, not just those from PreallocXlogFiles(). The proposer's initial patch introduced a shared-memory atomic counter (walSegmentsCreated) and a baseline (walSegsCreatedLastCheckpoint) to track and report new segments between checkpoints. After initial feedback, regression tests were added, and minor documentation tweaks and integer overflow comments were addressed. Subsequently, commenter 1 (reviewer 3) suggested exposing this counter in pg_stat_checkpointer for monitoring and raised questions about atomicity, int overflow ranges, and testing under wal_level=minimal. Most recently, reviewer 4 proposed a significant design simplification: using a single, atomically resettable counter with pg_atomic_exchange_u64 instead of the current two-field cumulative and baseline approach, asking for the proposer's rationale behind the original design. This suggests a re-evaluation of the counter's implementation.

Recent reply
Jun 8, 06:37 The latest reply from reviewer 4 suggests a fundamental design change for the WAL segment counter. Instead of a cumulative atomic counter and a non-atomic baseline, the reviewer proposes using a single, atomically resettable counter with pg_atomic_exchange_u64. This alternative aims for greater simplicity, true atomicity, and memory efficiency, prompting the proposer to justify the existing two-field approach.
archive ↗
14 pg_createsubscriber: allow duplicate publication names Committed 12 msgs Jun 9, 01:28
opened Jun 1, 13:12 ·last activity Jun 9, 01:28

This thread discusses a limitation in the `pg_createsubscriber` utility where it prevented specifying the same publication name multiple times, even if these publications resided in different databases. The proposer argued that this restriction became problematic with a new PG19 feature that allows `pg_createsubscriber` to reuse existing publications, as publication names are database-local. A reviewer confirmed the issue and suggested considering subscription names as well. However, another commenter raised concerns about potential replication slot name conflicts if duplicate subscription names were permitted without explicit `--replication-slot` options. As a result, the proposer decided to prioritize the fix for publication names for PG19, deferring the more complex handling of subscription names to a future release. The patch addressing the publication name duplication issue was subsequently accepted and committed.

3 recent replies
Jun 9, 00:38 The proposer expresses gratitude to the reviewer for committing the fix for duplicate publication names in `pg_createsubscriber`. The proposer also confirms that the corresponding item has been moved to the "resolved" section, indicating the successful completion and integration of the proposed change into the codebase.
Jun 8, 09:30 The latest reply from reviewer 1 (message 11) confirms that the fix for allowing duplicate publication names in pg_createsubscriber has been pushed. Reviewer 1 states that the "open item" for this patch can be closed the following morning if no build farm complaints arise and no further comments are received.
Jun 3, 02:25 The latest reply from a reviewer confirms that the updated patch, now in its v6 iteration, is satisfactory. The reviewer notes that the OIDs are correctly within the suggested development range, and the underlying arithmetic functions and their corresponding tests remain robust and accurate as previously verified. The patch is now considered ready for commitment.
archive ↗
15 Subquery pull-up increases jointree search space Patch Review 13 msgs Jun 8, 16:29
opened Feb 9, 17:22 ·last activity Jun 8, 16:29

This thread explores the problem of subquery pull-up transformations potentially degrading query planning performance by expanding the `jointree` search space, especially when exceeding the `join_collapse_limit`. The proposer observed performance regressions with correlated subplans and initplan-to-join transformations, suggesting mechanisms for users or extensions to manage this or an in-core solution to stop pull-ups when the collapse limit is reached. Initial discussion by core developers considered raising `join_collapse_limit` and `from_collapse_limit` defaults given modern hardware, but acknowledged exponential planning time growth and the need to identify and mitigate pathological cases. The proposer later identified the main issue as SubLinks being moved high in the `jointree`, losing their filtering effect. A patch was provided to address this by ensuring pulled-up SubLinks are inserted into the minimal safe `join tree`. Subsequently, another developer conducted stress tests, highlighting significant memory consumption during planning for larger joins. A committer then provided a trivial patch to fix specific memory leaks in `find_mergeclauses_for_outer_pathkeys` and `generate_join_implied_equalities`, reducing memory usage by about 30%.

3 recent replies
Jun 8, 15:27 The latest reply confirms the effectiveness of a trivial patch to reduce memory usage during query planning, noting significant memory savings. The commenter also presents memory consumption profiles from different collapse limits, obtained using `heaptrack`, and confirms consistency with previous findings. The discussion emphasizes the changing memory profile with increasing join complexity.
Jun 8, 11:04 The latest reply from reviewer 2 (message 11) confirms the effectiveness of reviewer 1's trivial patch in reducing memory usage during query planning. Reviewer 2 reports that for a 12-table join, memory usage dropped from ~2.7GB to ~1.8GB, and for a larger 13-table join, it reduced from ~17GB to ~13GB, saving approximately 30% in both cases. Reviewer 2 supports committing this specific fix, noting it cannot worsen plan time and might reduce page faults. However, reviewer 2 emphasizes that further memory reduction and investigation into other join features are needed to safely increase join_collapse_limit in the future.
Jun 8, 07:45 The latest reply from the proposer reiterates the origin of the thread's concerns, stemming from performance issues in ORM environments where query planning time is critical. The proposer emphasizes that collapse_limit settings are crucial for maintaining predictable planning and execution times, especially given the unpredictable number of joins in such queries.
archive ↗
16 DOCS - missing SGML markup in some ALTER PUBLICATION examples Committed 5 msgs Jun 9, 00:28
opened Jun 2, 02:10 ·last activity Jun 9, 00:28

The proposer identified missing SGML markup in ALTER PUBLICATION examples within the PostgreSQL documentation and provided a trivial patch to correct it. A reviewer approved the patch, noting that it should be committed to HEAD (PG19) once the beta1 tag was released. After the release, the patch was successfully pushed into the codebase, resolving the documentation inconsistency.

3 recent replies
Jun 8, 23:48 The proposer acknowledged and thanked the committer for successfully pushing the patch to fix the SGML markup issue in the ALTER PUBLICATION documentation examples.
Jun 8, 09:26 The latest reply from reviewer 1 (message 4) confirms that the documentation fix has been pushed. This action resolves the identified grammatical inconsistency in ALTER PUBLICATION error messages.
Jun 2, 02:57 The latest reply from the reviewer clarifies that the patch will be committed to the HEAD branch (PostgreSQL 19) but will wait for the `beta1` tag to appear before being pushed.
archive ↗
17 Use correct type for catalog_xmin Committed 5 msgs Jun 9, 00:28
opened Jun 5, 10:03 ·last activity Jun 9, 00:28

The proposer identified a type mismatch in the `old_catalog_xmin` variable, noting it was incorrectly defined as `XLogRecPtr` instead of `TransactionId` in a recent commit. A patch was provided to correct this. Reviewers agreed that although the mismatch did not cause functional issues due to its usage in an equality check, the type was conceptually incorrect and should be fixed. It was decided to backpatch the fix through v17. The committer confirmed the patch has been successfully pushed and backpatched to the specified versions.

3 recent replies
Jun 8, 23:21 The committer announced that the patch to correct the type of `old_catalog_xmin` from `XLogRecPtr` to `TransactionId` had been pushed and successfully backpatched to v17, thanking the contributors for their input.
Jun 8, 06:07 The latest commenter gives a "+1" to the suggested fix and the proposal to backpatch it through version 17. This indicates agreement and support for the patch, particularly its backpatching to older stable branches, which is a strong signal for impending commit.
Jun 5, 11:52 A commenter confirmed the bug report, agreeing that the type mismatch was likely a copy-paste error from the specified commit. The commenter explicitly stated, 'Patch LGTM,' indicating approval for the proposed fix.
archive ↗
18 Fix domain fast defaults on empty tables Rejected 10 msgs Jun 8, 18:29
opened Jun 5, 07:48 ·last activity Jun 8, 18:29

The thread discusses a bug introduced by a recent commit (a0b6ef29a) where ALTER TABLE ADD COLUMN ... DEFAULT for domain types with non-volatile constraints fails with a hard error (e.g., division by zero) even on empty tables. This behavior is a change from previous versions and is inconsistent with CREATE TABLE behavior. The proposer offered two solutions: one using PG_TRY/PG_CATCH and another bypassing the fast path for empty tables. Reviewer 1 expressed strong dislike for both proposed solutions, citing concerns about error suppression and the need for new table access method routines. Reviewer 1 also suggested reverting the original commit (a0b6ef29a) and redesigning the optimization for a future version (v20), arguing that the original commit introduced inconsistent default expression error handling. Commenters also debated the pg_dump implications and noted similar inconsistencies for non-domain types. The general consensus appears to be against the current patch approaches, with a recommendation to revert the original feature.

3 recent replies
Jun 8, 18:12 The latest reply from Reviewer 1 reiterates concerns about the inconsistency introduced by the original feature. The reviewer highlights that treating domain CHECK constraint errors differently from other runtime errors in default expressions is a flawed approach, advocating for more consistent error handling rather than less.
Jun 8, 15:40 The latest reply from a committer strongly advises against splitting `errmsg()` strings across multiple lines, citing readability and grepability concerns. The committer also identifies a grammatical error in one of the proposed error messages, suggesting a correction, and questions whether a portion of the message should be an `errdetail`.
Jun 8, 08:20 The latest reply from commenter 3 argues that the pg_dump concern, previously raised as a major issue, is unfounded. The commenter clarifies that pg_dump does not convert CREATE default expressions into ALTER TABLE ADD COLUMN statements, which would trigger the reported error. This also shows that errors for invalid default expressions during ALTER TABLE ADD COLUMN are consistent with non-domain types, suggesting the observed behavior might not be a bug.
archive ↗
19 Add RISC-V Zbb popcount optimization Patch Review 17 msgs Jun 8, 18:29
opened Mar 21, 16:54 ·last activity Jun 8, 18:29

The thread initially proposed a patch to add RISC-V Zbb popcount hardware optimization. Early discussion questioned the safety of the implementation without runtime checks and the practical benefit of such an optimization for PostgreSQL workloads, despite demonstrations of significant speedup for popcount operations. The conversation then shifted to address a critical auto-vectorization bug in Clang (versions < 22) on RISC-V, which caused des_init() and potentially other code (like zic.c) to miscompile and lead to failures in the build farm. After extensive investigation, it was confirmed that the bug is a Clang LoopVectorize wrong-code issue. The proposer subsequently submitted a patch to disable auto-vectorization for RISC-V systems when compiled with Clang versions older than 22. The latest activity indicates that the proposer re-attached the popcount optimization patches alongside this crucial bug fix, hoping to get both accepted for the upcoming release.

3 recent replies
Jun 8, 17:50 The latest reply from the proposer re-attaches a bundle of patches, including a critical fix to disable auto-vectorization for RISC-V compiled with Clang versions older than 22, addressing a known miscompilation bug. Also included are the original RISC-V Zbb popcount optimization patches. The proposer expresses hope that all three patches can be adopted for v19, citing the growing importance of the RISC-V platform.
Jun 1, 20:54 The proposer provided a detailed analysis of the Clang auto-vectorization bug, confirming it's a LoopVectorize wrong-code issue affecting scatter-store loops. The pg_memory_barrier() approach was deemed an incidental and fragile fix and will be dropped. Empirical testing showed Clang versions 20.1.2 and 21.1.8 miscompile, while Clang 22.1.6 is correct. The next steps will likely involve a strategy to manage this compiler version dependency.
May 29, 17:26 The latest reply from the proposer corrects an earlier statement, clarifying that `make check` does execute `zic.c`, although a bug might remain unnoticed due to limited test coverage of the `tzdata` files. The proposer indicates they are still waiting for LLVM/Clang to finish compiling, which is necessary to further investigate the Clang auto-vectorization bug affecting RISC-V builds.
archive ↗
20 PostgreSQL 19 Beta 1 release announcement draft Discussing 16 msgs Jun 9, 00:28
opened May 29, 03:23 ·last activity Jun 9, 00:28

The proposer initiated a review of the PostgreSQL 19 Beta 1 release announcement draft. Several participants provided extensive feedback, suggesting improvements such as highlighting key features (e.g., `pg_plan_advice`, 64-bit MultiXactOffset, `GROUP BY ALL`, `LISTEN/NOTIFY` scalability), refining descriptions for JSONPATH functions and the `REPACK` command, and adding a note about "greasing the protocol." A separate discussion also arose regarding the visibility and accessibility of beta packages on the download pages, with suggestions for clearer guidance for users.

3 recent replies
Jun 8, 23:41 A commenter responded to the explanation regarding the absence of beta packages in the main download dropdown. They agreed with the reasoning but suggested making it clearer on the announcement page and download pages where users can find instructions for beta package installation to prevent confusion for new users.
Jun 5, 13:27 The proposer clarifies that PostgreSQL beta packages are intentionally not listed in the main download page dropdowns to reduce the risk of users installing pre-release software in production environments. Information for accessing beta packages is available on specific package repository homepages and a dedicated "Beta/RC releases" page. The proposer also expresses openness to adding more direct links to this beta information to improve discoverability.
Jun 4, 23:42 The latest reply, from a commenter, points out a practical issue with the download link provided in the released PostgreSQL 19 Beta 1 announcement. The commenter notes that PostgreSQL 19 is not yet listed on the download page and asks if the link is incorrect or if the version needs to be added to the selection list.
archive ↗
21 pg_rewind does not rewind diverging timelines Discussing 17 msgs Jun 8, 21:28
opened Apr 30, 08:19 ·last activity Jun 8, 21:28

The proposer identified a rare but critical `pg_rewind` scenario where two diverging timelines could have the same TLI and LSN after multiple crashes during standby promotion, causing `pg_rewind` to incorrectly identify them as the same timeline and potentially leading to data loss. The proposed solution involves adding a UUID to the `XLOG_END_OF_RECOVERY` record and history file to distinguish such timelines. Reviewers provided feedback on the UUID implementation, suggesting using `gettimeofday()` for timestamps, and reported a Windows-specific test failure. A commenter questioned the "heavyweight" nature of UUIDs, suggesting strengthening existing history-based matching, but the proposer clarified why TLI and LSN alone are insufficient in this specific edge case. Another reviewer suggested considering an alternative approach to TLI allocation, by introducing randomness to prevent collisions, to maintain TLI as the sole branch identifier. The latest message also identified several issues in the patch, including a missing `MemoryContextSwitchTo`, ignored `rewind_parse_uuid` return value, a potential change in `pg_rewind`'s requirement for target history files, and potential ABI break.

3 recent replies
Jun 8, 19:52 The reviewer identified several technical issues with the latest patch, including a missing `MemoryContextSwitchTo` call, an ignored return value from `rewind_parse_uuid`, a potential change in `pg_rewind`'s requirement for target history files, and concerns about whether the proposed changes would introduce an ABI break.
Jun 8, 10:48 The latest reply from reviewer 3 (message 16) raises a concern about the proposed UUID-based fix. Reviewer 3 suggests that adding a UUID to the timeline history file might be addressing the problem too late. If two independent promotions select the same numeric TLI, the issue lies in TLI allocation itself, potentially leading to name collisions in the archive. Reviewer 3 proposes making TLI allocation less collision-prone (e.g., adding randomness) instead of introducing a second identifier, arguing this would maintain the simpler existing operational model where TLI is the sole branch identifier.
Jun 2, 05:29 The latest reply from commenter 1 acknowledges the proposer's detailed explanation for the necessity of UUIDs in timeline history. While initially concerned about UUIDs being "heavyweight" for operational convenience, the commenter now agrees that if the goal is to completely rule out the rare possibility of identical TLI/LSN for truly divergent histories, a unique identifier like a UUID is indeed required.
archive ↗
22 Remove redundant DISTINCT when GROUP BY already guarantees uniqueness Discussing 2 msgs Jun 8, 21:28
opened Jun 8, 11:12 ·last activity Jun 8, 21:28

The proposer submitted a patch to optimize SQL queries that include both `DISTINCT` and `GROUP BY` clauses. The optimization aims to prevent the planner from creating a redundant `Unique` plan node when the `GROUP BY` clause already guarantees the uniqueness of the output rows. This applies under specific conditions: when using plain `GROUP BY` (not `GROUPING SETS`), plain `DISTINCT` (not `DISTINCT ON`), and when all `GROUP BY` keys are included in the `DISTINCT` clause. An example demonstrated a reduction in the query plan complexity. A reviewer suggested checking for `hasTargetSRFs` and potentially refactoring to reuse existing similar logic in `query_is_distinct_for`.

2 recent replies
Jun 8, 20:55 The reviewer suggested an additional check for `hasTargetSRFs` within the proposed optimization function. The reviewer also recommended exploring whether the logic could be merged with or refactored from the existing `query_is_distinct_for` function to avoid code duplication.
Jun 8, 11:12 The latest reply from the proposer (message 1) introduces a patch to remove redundant DISTINCT operations in queries that also contain a GROUP BY clause. The proposer explains that if the DISTINCT keys fully encompass the GROUP BY keys, the DISTINCT step is unnecessary as the GROUP BY already ensures unique rows based on those keys. The patch aims to optimize the planner by skipping the redundant de-duplication node in such cases, outlining the specific conditions for this optimization and providing an illustrative example.
archive ↗
23 Adjust pg_stat_get_lock() prorows to match lock types Rejected 6 msgs Jun 8, 19:28
opened May 4, 02:23 ·last activity Jun 8, 19:28

The proposer observed that the `pg_stat_get_lock()` function's `prorows` estimate in `pg_proc.dat` (10 rows) did not match its actual return count (12 rows). A patch was submitted to update `prorows` to 12 and make minor comment tweaks, with the argument that a more accurate count would aid the planner. However, multiple reviewers countered that `prorows` serves as a rough estimate for the planner, not an exact count. They cited other system functions where estimates widely differ from actual returns and argued that striving for exact synchronization would introduce unnecessary maintenance overhead without demonstrating any tangible planning problems. A suggestion was also made to explicitly clarify in the documentation that `prorows` is an estimate. The overall consensus pointed to the rejection of the proposed `prorows` adjustment.

3 recent replies
Jun 8, 18:46 The latest reply from a core developer supports the suggestion to explicitly clarify in the documentation that `prorows` is intended as a planner estimate rather than an exact row count. This reinforces the collective sentiment against the proposed patch to precisely match the `prorows` value to the function's actual output.
Jun 8, 05:45 The latest reply from reviewer 3 concurs with reviewer 2, rejecting the proposed change. Reviewer 3 emphasizes that prorows is merely a planner estimate and does not need to be an exact row count, citing pg_stat_get_io() as an example where prorows significantly differs from the actual row count without causing issues.
Jun 8, 05:20 A reviewer expressed skepticism regarding the proposed `prorows` adjustment, stating that it's an estimate, not an exact count, and the difference between 10 and 12 rows is not worth fixing. The reviewer also highlighted the potential for increased maintenance overhead if `prorows` were to be strictly synchronized with the number of lock types, suggesting that planning problems should be addressed directly if they arise.
archive ↗
24 Fix DROP PROPERTY GRAPH "unsupported object class" error Committed 22 msgs Jun 8, 19:28
opened Apr 22, 16:19 ·last activity Jun 8, 19:28

This thread addressed a bug where `DROP PROPERTY GRAPH` operations resulted in an "unsupported object class" error when event triggers were active. The issue was traced to `getObjectTypeDescription()` and `getObjectIdentityParts()` lacking `switch` cases for `PropgraphElementLabelRelationId` and `PropgraphLabelPropertyRelationId`. The proposer submitted a patch to add these missing cases, ensuring `DROP PROPERTY GRAPH`, `DROP PROPERTY GRAPH IF EXISTS`, and `DROP SCHEMA CASCADE` function correctly with property graphs. Discussions centered on the clarity and wording of object descriptions, particularly for label properties, and the implications of exposing these internal catalog details to event triggers. After several revisions and clarifications, including concerns about confusing object identity outputs and the need for more descriptive labels, the v7 patch was committed. The commit included additional fixes related to translation markers and `ObjectTypeMap` entries.

3 recent replies
Jun 8, 18:43 The core developer reiterated concerns about the clarity of the `pg_identify_object()` output for property graph elements. The developer found the "object of object of..." naming convention confusing and advocated for including explicit object type labels, arguing that even for machine-readable output, clearer labeling helps human developers avoid errors when processing these identifiers.
Jun 8, 04:59 Commenter 2 clarified the distinction between the machine-consumable output of `pg_identify_object()` and the human-readable output of `pg_describe_object()`. They stated that `pg_describe_object()`'s descriptions for property graph elements, which are derived from `getObjectDescription()`, already adhere to the project's style guidelines for object naming, addressing previous concerns about readability in server messages.
Jun 8, 00:28 The latest reply from core developer 2 reiterates a concern about the clarity and style of the object descriptions generated for property graph elements. This core developer points out that the current phrasing (e.g., "e of e of create_property_graph_tests.gt") is hard to parse and violates PostgreSQL's error style guide which requires explicitly stating the type of object being cited.
archive ↗
25 Upload only the failed tests logs to the Postgres CI (Cirrus CI) Patch Review 6 msgs Jun 8, 16:29
opened Apr 7, 16:18 ·last activity Jun 8, 16:29

The proposer suggests optimizing PostgreSQL CI artifact uploads by only retaining logs from failed tests, thereby reducing upload times (e.g., from 300s to 70s on macOS) and storage costs, and improving the visibility of failures. Initially, a Python script was proposed for Meson builds, but it faced issues on NetBSD and Windows due to `python3` availability. A revised approach (v2) integrated the script via `meson compile`, placing it in `src/tools/ci/`. Version 3 adapted the solution for GitHub Actions, running the clearing command only if a job fails, which significantly reduced log size from ~8MB to ~1MB. A reviewer suggested copying logs to a new location instead of deleting, invoking the script directly via Ninja instead of `meson compile` for performance, and making the solution work for Autoconf builds eventually. The proposer agreed to some changes and clarified challenges with Autoconf and Python3 dependencies.

2 recent replies
Jun 8, 16:21 The latest reply is from the proposer, acknowledging the reviewer's feedback. The proposer seeks clarification on whether successful test logs should also be uploaded, proposing a structured output for successful and failed tests. The proposer agrees to switch from `meson compile` to direct Ninja invocation and explains the initial reasons for the current approach, citing the lack of a `test.success` equivalent in Autoconf and Python3 availability issues on some OSes.
Jun 5, 12:23 The proposer provided v3 of the patch, modifying the approach for GitHub Actions. It implements the log clearing as a step that runs only if the job fails. This change is reported to reduce the compressed log size from ~8MB to ~1MB and makes it much easier to identify failed tests. An example GitHub Actions run demonstrating the patch's effect is provided for review.
archive ↗
26 Avoid orphaned objects dependencies, take 3 Patch Review 28 msgs Jun 8, 22:28
opened May 19, 17:02 ·last activity Jun 8, 22:28

This thread continues a long-standing effort to prevent orphaned object dependencies. An initial patch (0001), based on a developer's suggestion to use heavyweight locks during DDL to conflict with DROP operations, was committed to address orphaned objects, with a reviewer noting its alignment with existing shared dependency handling. Subsequently, the focus shifted to a related Time-Of-Check To-Time-Of-Use (TOCTOU) vulnerability where a REVOKE operation could occur between an initial permission check and dependency recording. The proposer submitted a new patch series aiming to solve this by tracking ACL checks and re-checking permissions if invalidations occur before locking. A commenter raised concerns that this approach, unlike `RangeVarGetRelidExtended()`, doesn't coordinate name lookup, potentially leaving a TOCTOU window for schema drops. The commenter also suggested simplifying a loop in the proposed code, which the proposer agreed to. The latest discussion revolves around how the tracking mechanism handles multiple ACL checks with different modes for the same object.

3 recent replies
Jun 8, 21:55 The commenter raises a question regarding the handling of multiple tracked ACL checks for the same object if they specify different modes. They ask whether both checks would need to be performed or if the modes should be combined within the tracking entry, indicating a potential edge case in the proposed ACL tracking mechanism.
Jun 5, 13:12 The proposer agrees with a commenter's suggestion to remove the loop in the recheck path for ACLs, noting that the latest patch version (v24) already incorporates this change. The proposer acknowledges a minor trade-off where a lock might momentarily be acquired on an object without privileges, but it would be quickly released after the subsequent recheck.
Jun 4, 17:17 The latest reply from commenter 1 questions the necessity of a loop within the proposed recheckAclAndLock() function. The commenter suggests a linear sequence of operations: name lookup and initial ACL check, then, when recording dependencies, acquire a lock, verify object existence, and finally recheck tracked ACLs. This feedback highlights a potential simplification or clarification needed in the current patch's logic for handling ACL re-checks.
archive ↗
27 Remove the refint contrib module (for v20) Patch Review 5 msgs Jun 8, 21:28
opened Jun 5, 19:27 ·last activity Jun 8, 21:28

The proposer suggested removing the `refint` contrib module for PostgreSQL v20, citing its long-standing documentation as superseded by built-in foreign keys and the increasing maintenance cost relative to its value as sample code. The patch set includes removing the module's files and adjusting `pg_upgrade` tests for cross-version compatibility. Reviewers unanimously agreed with the removal, and one suggested adding an `appendix-obsolete` entry to the documentation and a back-patched notice about its upcoming removal. Another reviewer supported the removal, noting that `refint` no longer meets current code standards and would require significant work to improve. The proposer submitted a v2 patch incorporating the `appendix-obsolete` entry.

3 recent replies
Jun 8, 19:14 The proposer submitted a v2 patch that addresses previous feedback by including an `appendix-obsolete` entry for the `refint` module in the documentation. This change ensures that existing documentation links remain functional. The proposer also indicated plans to send a back-patched notice about the module's removal in v20 after this patch is merged.
Jun 5, 22:09 The latest reply from reviewer 2 strongly supports the removal of the `refint` module. This reviewer details why the module no longer serves well as example code, pointing out issues with comments, inconsistent error handling (mixing `elog` and `ereport`), and the questionable use of `SPI_prepare` instead of `SPI_execute_with_args` after recent changes. This assessment reinforces the argument that the module would require significant work to meet current standards, making its removal preferable.
Jun 5, 21:05 The latest reply expresses strong support ("++1") for the proposed removal of the `refint` module. The reviewer also raises a question about whether a formal entry in the `appendix-obsolete` section of the documentation is required to acknowledge the module's discontinuation.
archive ↗
28 (SQL/PGQ) cache lookup failed for label Patch Review 21 msgs Jun 8, 21:28
opened May 8, 08:39 ·last activity Jun 8, 21:28

The proposer reported a bug where `ALTER PROPERTY GRAPH ... DROP LABEL` could cause a `cache lookup failed for label` error when querying a view that depends on the dropped label. This issue arises from missing dependency information. A patch was provided to address this. Several reviewers positively reviewed the patch, and it was marked as "Ready for Committer". Subsequently, the proposer identified two additional, related problems: one concerning the expansion of empty labels in views (to ensure proper `pg_dump` and dependencies) and another involving labels shared by vertex and edge tables. The proposer decided to commit the initial fix first, and later provided patches for these new issues in the same series. Another participant reported a related issue, which was then identified as a duplicate of a patch already being discussed in a different thread, and confirmed that the patch from that other thread resolved their issue. A separate new thread was then initiated by a commenter to discuss a specific cleanup issue related to orphaned `pg_propgraph_property` entries.

3 recent replies
Jun 8, 20:15 A reviewer reported a CI failure for a follow-up patch, specifically an assertion error in `replace_correlation_vars_mutator` related to `varlevelsup` values. This indicates an issue with the handling of variable levels during the optimization process, requiring further investigation.
Jun 5, 14:37 The latest reply from commenter 7 confirms that they have initiated a new thread to specifically discuss the issue of orphaned `pg_propgraph_property` entries that occur after dropping a label. This action streamlines the discussion by redirecting a distinct problem to its own dedicated forum, as previously advised by commenter 3.
Jun 4, 15:04 The original reporter confirmed successful testing of the v20260601 patches on master, noting that they "looks good." They also identified a related issue concerning `RemoveRelations()` in `propgraphcmds.c` where the `drop_label` condition was not correctly included in the cleanup of orphaned `pg_propgraph_property` entries, providing a diff for this new observation.
archive ↗
29 [PATCH] Add support for SAOP in the optimizer for partial index paths Patch Review 12 msgs Jun 8, 16:29
opened Dec 5, 14:59 ·last activity Jun 8, 16:29

This thread proposes adding support for ScalarArrayOpExpr (SAOP), such as `ANY()` and `IN()`, in the optimizer for partial index paths. Previously, only `BitmapOr` paths were considered for partial indexes. The proposer developed a new function, `generate_bitmap_saop_paths`, based on existing code. A reviewer provided detailed feedback, suggesting a precheck for suitable indexes, using a Bitmapset to track suitable indexes, consolidating tests, shrinking row counts, and benchmarking performance overhead in worst-case scenarios. The proposer responded with a significant refactor (v2, v3) to address these points, including a "best choice index" logic for `IN()` clauses and moving tests. After further rebasing for a commitfest entry (v4), the proposer conducted performance tests with a "SAOP-saturation-test.sql" script. This testing exposed a shortcoming where only the synthesized equality clause was matched, leading to two new optimization patches. The proposer confirmed that, with these additions, planner and execution timings are consistent with established code and improved.

2 recent replies
Jun 8, 14:56 The latest reply from the proposer provides a rebased version of the patch set (now including two new optimization patches) and describes a "larger" stress test (`SAOP-saturation-test.sql`) that exposed a previous shortcoming. The proposer states that the new patches address this by improving functionality to handle cases where only synthesized equality clauses were matched. Performance and execution timings are reported as consistent with master and improved, with the optimizer choosing the same paths as existing OR chains.
Jun 7, 17:20 The proposer clarified that the previous patch submission used an incorrect format for the commitfest and stated the intention to resubmit using the `git format-patch` command. This action reflects the proposer's ongoing effort to correctly prepare the patch for formal review and inclusion in the upcoming commitfest cycle.
archive ↗
30 synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication Patch Review 88 msgs Jun 8, 12:30
opened Feb 24, 22:08 ·last activity Jun 8, 12:30

The proposer highlighted an inconsistency in synchronized_standby_slots behavior: it requires ALL-of-N physical replication slots to catch up before logical decoding can proceed, which conflicts with quorum-based (ANY M of N) synchronous replication. In a quorum setup, if one standby fails, logical decoding blocks even if the transaction is safely committed on a quorum of standbys. The proposal is to make synchronized_standby_slots quorum-aware by allowing ANY M (slot1, slot2, ...) syntax, similar to synchronous_standby_names, to return true when M of N slots have caught up. The default behavior remains unchanged, and a separate GUC is preferred. Detailed discussions ensued regarding how to handle duplicate slot names specified in the GUC: whether to automatically resolve them, or raise an error. Initial thoughts favored skipping duplicates internally. Later, the consensus shifted towards normalizing duplicates internally without erroring, but raising an error if N > M (where N is required slots and M is unique available slots after deduplication). This aligns with synchronous_standby_names for duplicates but enforces configurability for N > M immediately.

3 recent replies
Jun 8, 09:51 The latest reply from reviewer 1 (message 88) announces the submission of updated patches. These patches incorporate trivial changes suggested by reviewer 2 in an earlier top-up patch. The changes mainly consist of documentation updates, improvements to comments, and minor indentation fixes in various code locations.
Jun 8, 06:08 The latest message from the proposer acknowledges receipt of a patch containing trivial changes from a reviewer. The proposer states an intention to review these changes and provide feedback, indicating that the patch review process is actively continuing for the proposed feature.
Jun 5, 10:02 The latest message, from reviewer 1, provides a patch with a few trivial changes, asking the implementer to consider them if acceptable. This indicates ongoing refinement of the patch based on the discussion regarding duplicate entries and error handling in synchronized_standby_slots.
archive ↗
31 Fix bug of UPDATE/DELETE FOR PORTION OF with inheritance tables Committed 9 msgs Jun 8, 18:29
opened May 7, 03:40 ·last activity Jun 8, 18:29

This thread addresses a bug in UPDATE/DELETE FOR PORTION OF operations when used with inheritance tables. The original issue caused leftover rows, resulting from a portion update or delete, to be incorrectly inserted into the parent table instead of the correct child table where the original data resided. Additionally, there was a problem with attnum mapping for range columns in multiple-inheritance scenarios. The proposer initially submitted a patch, which was then re-worked by commenter 1 as part of a larger series of fixes related to FOR PORTION OF. After a request from the proposer, the patch was separated into a standalone fix for the inheritance/leftover bug, incorporating a refactoring. The final version (v3) was confirmed to resolve the reported bug and was subsequently committed.

2 recent replies
Jun 8, 17:33 The latest reply from Reviewer 1 confirms that the patch addressing the bug with UPDATE/DELETE FOR PORTION OF on inheritance tables has been committed. This indicates the successful resolution and integration of the fix into the codebase.
Jun 7, 03:03 The proposer confirmed that the latest patch (v3) effectively resolves the original bug concerning UPDATE/DELETE FOR PORTION OF with inheritance tables. The fix correctly ensures that leftover data ranges are inserted back into the appropriate child table. The proposer also praised the patch for its clean design and successful decoupling from a related 'UPDATE OF' trigger issue, making it a focused solution.
archive ↗
32 Separate catalog_xmin from xmin in walsender hot standby feedback Patch Review 2 msgs Jun 8, 12:30
opened Apr 30, 08:29 ·last activity Jun 8, 12:30

The proposer identified an issue where hot standby feedback, without a physical replication slot, can incorrectly hold back VACUUM on user data tables on the primary due to the standby's catalog_xmin (potentially from a logical replication slot) being used as the xmin for all data. This can lead to significant table bloat. The proposed fix involves adding a catalog_xmin field to PGPROC to track it separately from xmin, mirroring the behavior of replication slots. This new proc_catalog_xmin would only affect catalog_oldest_nonremovable and shared_oldest_nonremovable. The proposer provided a v2 patch with test stability improvements and performance benchmarks showing negligible impact.

Recent reply
Jun 8, 11:29 The latest reply from reviewer 1 (message 2) acknowledges the proposer's v2 patch. Reviewer 1 raises concerns about adding a separate catalog_xmin field to PGPROC. The concerns include the additional four bytes required in PGPROC for all backend processes (even when not needed for walsender) and potential stale reads if xmin and catalog_xmin are updated separately. Reviewer 1 suggests that the idea of "ephemeral slots," previously hinted at in comments, might be a more promising direction to explore.
archive ↗
33 [PATCH] Doc: Mention OFF as an alias for EXPLAIN SERIALIZE NONE Patch Review 3 msgs Jun 8, 16:29
opened Jun 7, 03:28 ·last activity Jun 8, 16:29

This thread discusses a documentation-only patch to mention "OFF" as an undocumented alias for "NONE" in the `EXPLAIN SERIALIZE` option. The proposer identified inconsistencies across the codebase: `ParseExplainOptionList()` accepts "OFF" as an alias, but it's not documented, not in the `ExplainSerializeOption` enum, not in `psql` tab completion, and not covered in regression tests. To maintain backward compatibility, the proposer chose to only document the alias for now, leaving other inconsistencies for future patches. A reviewer questioned the necessity of documenting this convenience alias, drawing parallels to undocumented boolean-style representations for GUC parameters. However, the reviewer conceded that for `SERIALIZE`, documenting "OFF" might prevent confusion due to its enum-like values, suggesting a minimal wording change. The proposer agreed to the minimal wording.

3 recent replies
Jun 8, 15:31 The latest reply from the proposer acknowledges the reviewer's feedback and agrees with the suggestion for minimal wording. The proposer plans to revise the documentation to use "NONE (or OFF)" and has verified the updated HTML and man pages. This signifies progression in addressing the documentation inconsistency.
Jun 8, 02:51 The latest reply, from reviewer 1, questions the value of documenting `OFF` as an alias for `EXPLAIN SERIALIZE NONE`, drawing parallels to other undocumented boolean-style aliases for enum-valued parameters. Reviewer 1 acknowledges a slightly stronger argument for documenting `OFF` than for simple numeric aliases, but suggests a more concise wording like "SERIALIZE NONE (or OFF)" if the documentation change is pursued.
Jun 7, 03:28 The proposer submitted a documentation-only patch. It aims to formally document OFF as a valid alias for EXPLAIN SERIALIZE NONE, a behavior already implemented in the parsing logic but not yet officially mentioned. The patch prioritizes backward compatibility by not altering existing code and suggests addressing other related inconsistencies in subsequent patches.
archive ↗
34 bugfix - fix broken output in expanded aligned format, when data are too short Committed 12 msgs Jun 8, 08:29
opened Mar 23, 19:42 ·last activity Jun 8, 08:29

The thread discusses a bug in fe_utils where psql's expanded aligned output format (\x, \pset format aligned) was broken when displaying tables with data shorter than the header. The proposer identified the issue and provided a patch to fix it, which also included a regression test and addressed an unintended forcing to wrapped mode. Reviewer 1 suggested minor improvements to a comment and to ensure the expanded mode was explicitly turned off after the test. After a rebase by the proposer, reviewer 2 took over the review and subsequently committed the fix. The fix ensures that the calculation for available data width in expanded aligned mode correctly handles cases where data is shorter than the header, preventing layout issues.

3 recent replies
Jun 8, 06:39 The latest reply from the proposer thanks reviewer 2 for committing the patch. This confirms that the bug fix for broken expanded aligned output in psql when data is too short has been successfully integrated into the codebase.
Jun 8, 05:45 The latest message from a committer explicitly states that the patch has been committed to the codebase, providing the commit hash. This marks the successful resolution and integration of the proposed bug fix.
Jun 8, 01:36 The latest reply from Reviewer 2 observes that the patch seems to have an incorrect method for calculating column width. The reviewer notes the patch's prolonged pending status and indicates a plan to conduct a thorough re-evaluation of the entire solution.
archive ↗
35 Report oldest xmin source when autovacuum cannot remove tuples Discussing 35 msgs Jun 8, 17:28
opened Oct 31, 06:31 ·last activity Jun 8, 17:28

This thread proposes adding the reason for the oldest xmin to VACUUM logs to help diagnose and prevent table bloat. The proposer argues that current logs only indicate a blockage, requiring manual querying of volatile views which is difficult for post-hoc analysis. The initial patch outputs the blocker's reason and PID. Commenters suggested that a SQL-visible interface for current xid/xmin holders would be more useful for proactive monitoring. The proposer agrees on the value of a SQL view but emphasizes the importance of logs for historical analysis, especially when a blocker has disappeared. Another participant is already working on such a view, and the discussion shifted towards having both a logging mechanism and a SQL view, potentially sharing a common internal function.

3 recent replies
Jun 8, 16:35 The latest reply from reviewer 5 offers further comments on the patch. The reviewer personally dislikes multi-line error messages due to grepability issues and suggests consolidating them. The reviewer also points out a grammatical error and questions whether a part of the error message should be errdetail, contributing to an ongoing discussion on error message formatting.
Jun 6, 18:40 A commenter attached a patch implementing a helper function that could be used for both the proposed VACUUM logging and a future SQL-visible interface to report xid horizon information. The commenter indicates that while this shared function design is beneficial, it's not strictly necessary at this stage, as refactoring to integrate it later would be straightforward.
Jun 3, 17:36 The latest reply strongly supports logging xmin blocker information directly at the point VACUUM is blocked. The commenter emphasizes its critical utility for support escalations and problem prevention, aligning with the proposer's approach of capturing the exact blocker during horizon calculation rather than reconstructing it later, despite acknowledging potential collision issues.
archive ↗
36 [PATCH] Preserve replication origin OIDs in pg_upgrade Patch Review 19 msgs Jun 8, 17:28
opened Apr 28, 11:19 ·last activity Jun 8, 17:28

This thread discusses a patch to pg_upgrade that addresses a problem with replication origin IDs (roidents) not being preserved during upgrades of subscriber clusters. The existing pg_upgrade process can cause roidents to be reassigned or swapped, leading to update_origin_differs conflicts due to incorrect commit-timestamp records. The proposed solution involves modifying pg_dumpall to dump and restore all replication origins with their original roidents and LSN positions, and adjusting CREATE SUBSCRIPTION to use these preserved roidents. Discussions covered backward compatibility (supporting PG17+), handling of long replication origin names, and adding a consistency check to pg_upgrade to prevent errors if the new cluster already has conflicting replication origins. The proposer has submitted multiple patch versions, addressing various review comments and bug reports.

2 recent replies
Jun 8, 17:06 The latest reply from reviewer 3 briefly affirms the proposer's explanation regarding the PG17 version check for dumping replication origins. This indicates agreement on the proposed version cutoff for this feature's backward compatibility.
Jun 5, 10:09 The latest reply from reviewer 3 offers several comments on the patch: noting that pg_dumpall dumps all replication origins, not just subscription ones, and highlighting that the current implementation truncates origin names longer than 64 bytes during binary upgrade. This indicates a remaining issue and further points for refinement.
archive ↗
37 First draft of PG 19 release notes Discussing 94 msgs Jun 8, 14:28
opened Apr 15, 01:18 ·last activity Jun 8, 14:28

This thread focuses on the review and refinement of the first draft of the PostgreSQL 19 release notes. The proposer initially shared the draft, which contained 212 features, and outlined plans to document the creation methodology. Commenter 1 identified an inaccurate description of `pg_read_all_data()` and `pg_write_all_data()` as functions rather than roles, prompting the proposer to correct and re-categorize the item. Commenter 2 noted duplicate names in an entry for psql tab completion, which the proposer agreed to fix. Another commenter suggested including a psql tab completion fix for `REPACK` boolean options, but the proposer decided against it, explaining that such fixes are generally only added for existing commands. Commenter 3 provided comprehensive feedback on the 'Incompatibilities' section, suggesting wording changes and reordering of explanations, and offered improvements for 'Optimizer', 'General Performance', 'System Views', and 'Monitoring' sections. The proposer accepted several suggestions while explaining the rationale behind the current internal ordering of items within sections, which prioritizes grouping similar items for readability.

3 recent replies
Jun 8, 14:13 The latest reply from the proposer clarifies the internal ordering principles used for items within sections of the release notes. The proposer reiterates that while the most important item is typically placed first, subsequent items are grouped by similar characteristics to enhance readability, even if it means not strictly adhering to an overall importance order. This addresses an earlier comment regarding item placement in the 'Optimizer' section.
Jun 8, 03:43 The proposer responded to detailed feedback from commenter 4. They agreed to rephrase "prevent" to "Disallow" and adjust the security text placement for database/role names, and similarly reword the `pg_upgrade` message for `inet`/`cidr` opclasses to "disallow upgrading." They added a missing link for parallel vacuum workers but declined to reorder the "extended statistics" item, preferring their current grouping logic.
Jun 6, 13:08 The latest reply from commenter 4 offers a comprehensive list of editorial suggestions for the release notes. These include refining verb usage (e.g., "reject" instead of "prevent"), improving the order of items, ensuring consistent wording, adding missing links to documentation, and clarifying the conceptual distinction between autoanalyze and autovacuum logging configurations for better understanding.
archive ↗
38 index prefetching Discussing 72 msgs Jun 7, 02:28
opened Feb 18, 04:21 ·last activity Jun 7, 02:28

This extensive thread focuses on developing index prefetching functionality to enhance index scan performance through significant architectural changes to the table access method (AM) interface, including slot-based index scan interfaces and batch processing (`amgetbatch`). Multiple patch versions (v20-v26) were submitted, addressing bitrot, refining logic, and incorporating feedback on details like `int8` arithmetic for ring buffers and the optimal use of `TupleTableSlot` for index-only scans. Initially targeting Postgres 19, the developers decided to defer the patchset to Postgres 20 due to the need for more polish. Work has since resumed, with the latest patches showing robust performance gains and significant improvements, such as enabling GiST indexes to utilize `gistgetbatch` and eliminating the need for index-only scans to use a buffered `TupleTableSlot`.

Recent reply
Jun 7, 00:52 The latest reply introduces v26, signifying the resumption of work for Postgres 20 and addressing numerous previously outstanding issues. Key improvements include resolving slot-related concerns by enabling index-only scans to forgo buffered `TupleTableSlot`s and directly use a `HeapTuple`. Additionally, the reply highlights the successful implementation of `gistgetbatch`, which brings substantial performance benefits to GiST index scans, further validating the generality of the `amgetbatch` design. A fix for a long-standing GiST index-only scan bug is also noted, with a trade-off for ordered scans.
archive ↗
39 Fix comment in report_sequence_errors() Committed 3 msgs Jun 8, 12:30
opened Jun 7, 14:35 ·last activity Jun 8, 12:30

The proposer identified an incorrect comment in the report_sequence_errors() function in sequencesync.c. The comment incorrectly stated that case (c) referred to "missing sequences on the subscriber," whereas the actual code logic and warning message refer to sequences missing on the publisher side. The proposed fix is a simple change to correct the comment from "subscriber" to "publisher" to accurately reflect the function's behavior. Reviewer 1 confirmed the fix and mentioned adding clarity about inconsistent definitions on the subscriber side.

3 recent replies
Jun 8, 09:15 The latest reply from reviewer 2 (message 3) acknowledges that the patch looks good. Reviewer 2 asks reviewer 1 if this comment fix will be committed as part of a larger set of minor/typo fixes, implying a decision on commitment is pending or already made in combination with other minor changes.
Jun 8, 00:28 The latest reply from the reviewer confirms the proposer's observation about the incorrect comment regarding missing sequences on the publisher side. The reviewer indicates that they have accepted the change ("Grabbed these, thanks") and also suggests a minor additional clarification for the first comment within the function to explicitly cover inconsistent definitions on the subscriber side.
Jun 7, 14:35 The proposer identified an inaccuracy in a comment within the `report_sequence_errors()` function. The comment for case (c) states 'missing sequences on the subscriber,' but the associated code handles sequences missing on the *publisher*. The proposer suggests changing 'subscriber' to 'publisher' in the comment to correct this discrepancy.
archive ↗
40 Unexpected reindex when altering column types for partitioned tables Proposed 1 msgs Jun 8, 14:28
opened Jun 8, 13:50 ·last activity Jun 8, 14:28

The proposer identifies an issue where `ALTER TABLE ALTER COLUMN TYPE` operations on partitioned tables unexpectedly trigger a reindex, even for type changes that typically do not require it. This behavior is attributed to the current `ATRewriteCatalogs` process, which drops the parent table's partitioned index (cascading to child indexes) before child tables are processed, preventing child indexes from being properly remembered for rebuilding without reindexing. The proposed solution includes three patches. The first patch adds a regression test to demonstrate the bug. The second patch modifies `ATRewriteCatalogs` to batch deletions, ensuring child indexes are tracked and recreated first, potentially avoiding unnecessary reindexing. It also introduces a new `AT_PASS_OLD_PARTITIONED_INDEX` step for parent index recreation. The third patch extends similar changes to index-backed constraints.

Recent reply
Jun 8, 13:50 The only message in this thread proposes a solution to an unexpected reindex problem in partitioned tables during `ALTER COLUMN TYPE`. The proposer outlines the root cause related to the timing of index deletions in `ATRewriteCatalogs` and presents a three-patch solution. This includes adding a regression test, modifying `ATRewriteCatalogs` to ensure proper handling and tracking of child indexes, and applying similar logic to index-backed constraints.
archive ↗
41 Fix tuple deformation with virtual generated NOT NULL columns Committed 7 msgs Jun 8, 13:28
opened Jun 4, 05:57 ·last activity Jun 8, 13:28

The proposer identified a bug where virtual generated NOT NULL columns were not correctly handled during tuple deformation, leading to incorrect values (e.g., 0 instead of 20) being returned for subsequent columns. The issue stemmed from an incorrect calculation of firstNonGuaranteedAttr in TupleDescFinalize(), which failed to consider virtual generated attributes as non-guaranteed. The proposer submitted a patch to include ATTRIBUTE_GENERATED_VIRTUAL in the check. Commenter 1 confirmed the bug and suggested a related concern about attcacheoff, which the proposer addressed in v2. A reviewer then committed a slightly adjusted version of the patch, simplifying a condition and adding an Assert() for future checks. The proposer agreed with the adjustments. Commenter 2 later suggested adding more tests for the fix.

3 recent replies
Jun 8, 13:01 Commenter 2, after the patch has been committed, suggests that it would be beneficial to add more tests to cover the fix, specifically for the scenario of virtual generated NOT NULL columns in tuple deformation.
Jun 7, 01:43 The latest reply from the proposer acknowledges the committer's pushed fix. The proposer agrees that the committer's adjusted version is cleaner, particularly regarding the removal of a redundant check for `cattr->attgenerated`. The proposer also clarified that their initial concern about the performance impact of unconditionally fetching `TupleDescAttr` was likely an overestimation for the context of `TupleDescFinalize()`, which does not run on a per-tuple basis.
Jun 6, 04:50 The committer announced that the bug fix has been applied to the codebase. They confirmed the issue and noted that a slightly adjusted version of the patch was pushed. The adjustments included removing a redundant check from the proposed solution and adding an `Assert()` statement to `TupleDescFinalize()` to help catch similar issues in the future.
archive ↗
42 [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table Patch Review 12 msgs Jun 8, 13:28
opened Jul 18, 15:53 ·last activity Jun 8, 13:28

This thread discusses a long-standing bug where DELETE/UPDATE operations on foreign tables referencing remote partitioned tables can corrupt data if multiple rows are affected, due to reliance on ctid for identification. The proposer resurrected the issue and re-submitted an old patch that simply disallows multi-row DELETE/UPDATE operations. Commenter 1 demonstrated that this patch was still unsafe and proposed a new remotely_inherited table option for postgres_fdw to explicitly prevent such operations. The proposer expressed concern about this option's reliance on user configuration. Commenter 1 also dismissed the WHERE CURRENT OF approach due to performance concerns. Subsequently, Commenter 2 presented a new, more invasive patch set focusing on passing remote OID attributes through the executor to the FDW for accurate UPDATE/DELETE queries, which Commenter 1 then pointed out would not be back-patchable. Commenter 1 re-proposed their remotely_inherited patch, emphasizing its back-patchability and providing an updated version with postgresImportForeignSchema() support, which Commenter 2 agreed to review.

3 recent replies
Jun 8, 12:45 Commenter 1, who has re-proposed a back-patchable solution involving a remotely_inherited option for postgres_fdw, acknowledges Commenter 2's intent to review the patch and awaits their feedback.
Jun 6, 20:33 The latest reply by commenter 1 acknowledges reviewer 1's re-proposed patch set and expresses intent to review it within a few days. This indicates that both proposed solutions are still under consideration and active discussion is ongoing regarding the best path forward, particularly concerning back-patching and the invasiveness of changes.
Jun 5, 11:59 A commenter provided an updated version of their proposed back-patchable solution. This involves adding a 'remotely_inherited' table option to postgres_fdw to prevent problematic UPDATE/DELETE operations on certain foreign tables. The new version incorporates support for postgresImportForeignSchema() and includes documentation updates, and is presented for further review and comments.
archive ↗
43 Improve errmsg for publication membership Discussing 3 msgs Jun 8, 13:28
opened Jun 3, 05:10 ·last activity Jun 8, 13:28

The proposer submitted a patch to reword two error messages related to publication membership: "relation \"%s\" is already member of publication \"%s\"" and "schema \"%s\" is already member of publication \"%s\". The proposed change updates "member of" to "a member of" to align with correct grammar and other similar error messages in PostgreSQL. Commenter 1 reviewed the patch, confirmed it applies cleanly, and noted that the wording matches existing messages, giving it an LGTM. Commenter 2 also approved the fix but suggested that, as a minor inconsistency not newly introduced, it should only be applied to the HEAD development branch and could wait until the next major release branch opens.

3 recent replies
Jun 8, 09:24 Commenter 2 confirms the fix is acceptable but suggests that, due to its minor nature, it should only be applied to the HEAD development branch and could wait for the next major release branch to open, rather than being backported to earlier versions.
Jun 3, 06:05 The latest reply from the reviewer confirms the patch applies cleanly, aligns with the grammatical standard for similar messages in the codebase, and passes all automated tests. The reviewer provides a "Looks Good To Me" (LGTM) endorsement.
Jun 3, 05:10 The proposer identified a grammatical error in two specific error messages concerning publication membership. They provided a patch to correct "is already member of" to "is already a member of" for both relation and schema messages, ensuring consistency with other PostgreSQL error messages.
archive ↗
44 [Patch] Fix check_pub_rdt bypass when origin is set in same ALTER SUBSCRIPTION Committed 4 msgs Jun 8, 13:28
opened May 26, 22:49 ·last activity Jun 8, 13:28

The proposer identified a bug where ALTER SUBSCRIPTION SET (retain_dead_tuples = true, origin = 'none') incorrectly bypassed the publisher version/recovery check. This occurred because the origin handling logic unconditionally overwrote the check_pub_rdt flag to false, even if retain_dead_tuples had set it to true within the same command. The proposed fix involves changing the assignment to use a bitwise OR assignment (|=) instead of a direct assignment (=), ensuring that the flag set by retain_dead_tuples cannot be inadvertently cleared. A test case was also provided to reproduce the problem. Commenter 1 and Commenter 2 reviewed and approved the fix, which has now been committed.

3 recent replies
Jun 8, 09:25 Commenter 1 confirms the successful verification of the fix by Commenter 2 and has proceeded to push the proposed changes, committing the patch that addresses the bypass issue in ALTER SUBSCRIPTION.
Jun 2, 02:13 Reviewer 2, in agreement with reviewer 1, confirmed that the identified issue requires a fix. The reviewer also stated that the proposed patch, which addresses the problem by modifying the flag assignment, looks good to them, indicating consensus on its correctness.
May 29, 22:18 A reviewer confirms the validity of the reported bug, where an `ALTER SUBSCRIPTION` command was bypassing publisher checks. The proposed patch, which involves changing an assignment operator to a bitwise OR to correctly manage internal flags, is deemed acceptable by the reviewer, who expresses an intent to commit the fix soon.
archive ↗
45 Why is the LSN reported for pg_logical_emit_message() different from other decoded operations? Proposed 1 msgs Jun 8, 13:28
opened Jun 8, 13:09 ·last activity Jun 8, 13:28

The proposer noticed an inconsistency in the LSN reported for pg_logical_emit_message() compared to other operations (INSERT, UPDATE, DELETE) during logical decoding. While pg_waldump shows the logical message record at a specific LSN (e.g., 0/017E97B8), pg_logical_slot_get_changes() reports an LSN that matches the following RUNNING_XACTS record (e.g., 0/017E97F8). For other operations like INSERT, UPDATE, and DELETE, the LSNs from both tools match the start LSN of the corresponding WAL records. The proposer has started investigating the internal queuing mechanisms (ReorderBufferQueueChange()) to understand this discrepancy.

Recent reply
Jun 8, 13:09 The proposer reports an observation that the LSN reported by pg_logical_slot_get_changes() for pg_logical_emit_message() differs from the actual LogicalMessage WAL record LSN as seen in pg_waldump. This contrasts with other operations (INSERT, UPDATE, DELETE) where the LSNs align between pg_logical_slot_get_changes() and pg_waldump's WAL record start LSN. The proposer is beginning to investigate the internal logical decoding queueing mechanism.
archive ↗
46 ECPG: inconsistent behavior with the document in “GET/SET DESCRIPTOR.” Committed 15 msgs Jun 8, 12:30
opened Apr 16, 05:48 ·last activity Jun 8, 12:30

The proposer identified an inconsistency in ECPG's GET/SET DESCRIPTOR functionality: while the precompiler accepts syntax with multiple COUNT assignments (e.g., :desc_count1 = count, :desc_count2 = count), it generates invalid C code, leading to compilation errors. The proposer's initial patch fixed this by making the precompiler reject such invalid syntax. Discussion explored whether to allow multiple COUNT clauses (by generating multiple ECPGget_desc_header calls) or to strictly disallow it. Following a review of SQL standards and Oracle's Pro*C (which disallows multiple COUNT), the consensus was to treat it as a syntax error to minimize special-purpose code and align with other systems. A reviewer proposed adding TAP tests, but it was decided against, as many other unsupported syntax cases are not tested. The fix was then confirmed and backported to all supported PostgreSQL versions.

3 recent replies
Jun 8, 08:32 The latest reply from reviewer 3 (message 15) confirms that the patches for fixing the ECPG GET/SET DESCRIPTOR inconsistency have been pushed to all supported PostgreSQL versions. This action resolves the issue where the precompiler accepted invalid syntax, leading to C compilation failures, by making the precompiler reject multiple COUNT assignments as a syntax error.
Jun 5, 09:26 The latest reply from the proposer provides patches for older branches, responding to a committer's request for backporting the fix. This indicates that the core patch has been accepted and is moving towards broader application across supported versions.
Jun 3, 08:13 The latest reply from the committer states that a proposed regression test is not necessary, as many other unsupported syntax cases are not tested. The committer then asks the original proposer if the fix should be backpatched to all supported PostgreSQL versions and requests patches for older branches if so, indicating the main patch is nearing commitment.
archive ↗
47 pg_upgrade fails when FK constraint with same name exists on partitioned table and its partition Proposed 1 msgs Jun 8, 12:30
opened Jun 8, 08:46 ·last activity Jun 8, 12:30

The proposer identified a pg_upgrade failure scenario when upgrading PostgreSQL from version 17 to 18. The issue occurs when a foreign key (FK) constraint with the same name exists on both a partitioned parent table and one of its partitions. Specifically, if ALTER TABLE ONLY ... ADD CONSTRAINT ... FOREIGN KEY ... NOT VALID is used on a partition, and then ALTER TABLE ... ADD CONSTRAINT ... FOREIGN KEY ... (without ONLY) is used on the parent, pg_dump outputs both FK definitions. During pg_restore, the FK on the parent is implicitly inherited by the partition. The subsequent explicit ALTER TABLE ONLY ... ADD CONSTRAINT ... FOREIGN KEY ... NOT VALID command for the partition then fails with "constraint 'fk_trn_acc' for relation 'trn_part1' already exists". The proposer asks if this is a known issue or a bug in pg_dump.

Recent reply
Jun 8, 08:46 The latest reply from the proposer (message 1) describes a pg_upgrade failure when a foreign key constraint with the same name exists on both a partitioned table and its partition. The proposer provides a detailed reproduction case, showing pg_upgrade failing during pg_restore because the FK defined on the parent table is inherited by the partition, causing a subsequent explicit ALTER TABLE ONLY command for the same-named FK on the partition to error out as the constraint already exists. The proposer asks if this is a known issue or a bug in pg_dump.
archive ↗
48 Fix unqualified catalog references in psql describe queries Proposed 1 msgs Jun 8, 12:30
opened Jun 8, 08:46 ·last activity Jun 8, 12:30

The proposer identified an issue with psql's \dRs+ command: when querying pg_foreign_server to display subscription server names, the query uses an unqualified reference (pg_foreign_server). This allows a malicious or careless user to create a temporary table named pg_foreign_server earlier in the search_path, which can then "pollute" or spoof the output of \dRs+ by displaying incorrect server names. This problem was introduced by a prior commit related to CREATE SUBSCRIPTION ... SERVER. The proposed patch fixes this by adding the pg_catalog schema qualification to the pg_foreign_server reference within the psql describe query, ensuring it always refers to the canonical catalog table and preventing spoofing.

Recent reply
Jun 8, 08:46 The latest reply from the proposer (message 1) introduces a patch to fix unqualified catalog references in psql describe queries. The proposer explains that \dRs+ currently queries pg_foreign_server without pg_catalog qualification, allowing users to create a temporary table with the same name that can spoof the displayed server names. The patch adds the pg_catalog schema qualification to the query to ensure correct and secure information retrieval, providing a detailed reproduction case.
archive ↗
49 PG19 FK fast path: OOB write and missed FK checks during batched Patch Review 3 msgs Jun 8, 08:29
opened Jun 6, 08:30 ·last activity Jun 8, 08:29

This thread details critical security-related bugs found in the new FK existence-check fast path introduced in PostgreSQL 19 beta. The proposer identified three defects, including an out-of-bounds write and integrity bypasses, which are reachable by unprivileged table owners. These issues occur because user-defined code (cast functions and equality operators) can be executed during a deferred batch flush, leading to re-entrancy problems. Detailed reproduction steps for these defects were provided, confirming their presence in master and REL_19_BETA1. A reviewer acknowledged the report and has started investigating, adding the issues to the PostgreSQL 19 Open Items list.

2 recent replies
Jun 8, 08:18 The latest reply from reviewer 1 confirms ongoing investigation into the reported critical bugs. The reviewer has added these issues to the PostgreSQL 19 Open Items list, indicating their high priority for resolution before the final release.
Jun 6, 09:13 The latest contribution from the proposer details the mechanism of the discovered defects within the new FK fast path in PG19 Beta 1. It specifically outlines how an unprivileged user can trigger an out-of-bounds write by exploiting re-entrancy during a batch flush, providing precise line numbers and a concrete reproduction scenario leading to a SIGSEGV. The message also briefly mentions other integrity bypass issues.
archive ↗
50 [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations Committed 7 msgs Jun 8, 08:29
opened May 14, 11:12 ·last activity Jun 8, 08:29

This thread addresses a bug where LIKE expressions with literal backslashes fail to produce correct results when used with non-deterministic collations. The proposer identified that the issue stemmed from incorrect backslash escaping in like_match.c introduced in an earlier commit. An initial patch was submitted, which was then refined based on feedback from reviewer 1 regarding code readability and multibyte encoding handling. Reviewer 2 performed a thorough review of the updated patch (v2), confirmed it fixed both false-negative and false-positive cases of the bug, and suggested improvements to the commit message and a minor typo. The proposer incorporated these suggestions into a v3 patch, which also included an additional regression test case. Reviewer 2 then confirmed the v3 patch passed all tests and changed its CommitFest status to "Ready for Committer."

3 recent replies
Jun 8, 07:59 The latest reply from reviewer 2 confirms that the v3 patch correctly addresses the bug, including the false-positive scenarios. The reviewer verified that all regression tests pass and, satisfied with the changes, updated the patch's CommitFest status to "Ready for Committer," indicating it is ready for final commitment.
Jun 6, 12:25 The proposer provided an update based on the latest review of v2. They confirmed that the commit message was updated to include the false-positive aspect of the bug and a new regression test for this scenario was added in v3. Additionally, a minor typo identified by the reviewer in the code's comment was corrected.
Jun 5, 11:26 The latest reply from reviewer 2 confirms that the v2 patch applies cleanly, works as expected, and passes all regression tests, including the new one. The reviewer suggests improving the commit message to include the bug's false-positive symptom (incorrect matches) and correcting a typo ("occurences" to "occurrences") in a new code comment.
archive ↗
No threads match — try clearing filters.