Re: GNU/Hurd portability patches

2025-10-09 Thread Thomas Munro
[Using this as a general GNU/Hurd problem thread] An interesting fruitcrow failure: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=fruitcrow&dt=2025-09-30%2007%3A28%3A50 TRAP: failed Assert("postgres_signal_arg < PG_NSIG"), File: "pqsignal.c", Line: 91, PID: 25731 postgres(ExceptionalCo

Re: speedup COPY TO for partitioned table.

2025-10-09 Thread Chao Li
> On Oct 9, 2025, at 22:50, jian he wrote: >> 3 >> ``` >> + if (RELKIND_HAS_PARTITIONS(relkind)) >> + children = foreach_delete_current(children, childreloid); >> + } >> ``` >> >> I wonder if there is any specially consideration of using >> RELKIND_HAS_PARTITIONS() here? Because according to t

Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE

2025-10-09 Thread Peter Smith
Hi Iwata-San, Some v5 comments. == doc/src/sgml/bgworker.sgml 1. + + BGWORKER_EXIT_AT_DATABASE_CHANGE + + + BGWORKER_EXIT_AT_DATABASE_CHANGE + Requests termination of the background worker when the database it is + connected to undergoes significant chan

Re: Making pg_rewind faster

2025-10-09 Thread John H
Hey Srinath On Thu, Oct 9, 2025 at 12:09 PM Srinath Reddy Sadipiralla wrote: > ... > 1) if the timeline switch happens in middle of segment ,copy data from the > last WAL segment and create WAL file with same segno but different > timelineID,in this case the starting WAL file for the new timeli

Re: Buffer locking is special (hints, checksums, AIO writes)

2025-10-09 Thread Andres Freund
On 2025-10-09 16:35:44 -0400, Andres Freund wrote: > I pushed a few commits from this patchset after Matthias' review > (thanks!). Unfortunately in 5e899859287 I missed that the valgrind annotations > would not be done anymore for the buffers returned by > StrategyGetBuffer(). Which turned skink re

Re: memory leak in dbase_redo()

2025-10-09 Thread Nathan Bossart
On Thu, Oct 09, 2025 at 06:36:58PM +0200, Álvaro Herrera wrote: > On 2025-Oct-09, Nathan Bossart wrote: >> It looks like this was introduced by commit 9e4f914, which was >> back-patched, but the code path in question first appears in v15. So, >> presumably something like the following needs to be

Re: another autovacuum scheduling thread

2025-10-09 Thread Peter Geoghegan
On Thu, Oct 9, 2025 at 12:15 PM Andres Freund wrote: > > Each worker would consult this table before processing. If the table is > > there, it would remove it from the shared table and skip processing it. > > Then the next worker would try processing the table again. > > > > I also wonder how har

Re: Expanding HOT updates for expression and partial indexes

2025-10-09 Thread Jeff Davis
On Tue, 2025-10-07 at 17:36 -0400, Greg Burd wrote: > After reviewing how updates work in the executor, I discovered that > during execution the new tuple slot is populated with the information > from ExecBuildUpdateProjection() and the old tuple, but that most > importantly for this use case that

Re: Executing pg_createsubscriber with a non-compatible control file

2025-10-09 Thread Masahiko Sawada
On Tue, Oct 7, 2025 at 5:23 PM Michael Paquier wrote: > > On Tue, Oct 07, 2025 at 11:51:45AM -0700, Masahiko Sawada wrote: > > Just to be clear, did you mean that pg_checksums and pg_rewind already > > do such checks? IIUC pg_checksums does CRC check for the control file, > > and if we execute v18

Re: Adding some error context for lock wait failures

2025-10-09 Thread Andres Freund
Hi, On 2025-10-09 12:50:53 -0400, Tom Lane wrote: > I wrote: > > Yeah. I see that errfinish does FreeErrorDataContents in the > > non-ERROR code path, but of course that does nothing for random > > leakages during error processing. I'm tempted to have it do > > MemoryContextReset(ErrorContext) i

Re: another autovacuum scheduling thread

2025-10-09 Thread Nathan Bossart
On Thu, Oct 09, 2025 at 04:13:23PM +1300, David Rowley wrote: > I think the best way to understand it is if you look at > relation_needs_vacanalyze() and see how it calculates boolean values > for boolean output params. So, instead of calculating just a boolean > value it instead calculates a float

Re: compiling pg_bsd_indent

2025-10-09 Thread Bruce Momjian
On Thu, Oct 9, 2025 at 11:49:31AM -0400, Andres Freund wrote: > Hi, > > On 2025-10-09 11:43:57 -0400, Robert Haas wrote: > > While $SUBJECT today -- using the sources from > > https://git.postgresql.org/git/pg_bsd_indent.git -- I ran into some > > problems. I got errors due to the replacement of

Re: compiling pg_bsd_indent

2025-10-09 Thread Andres Freund
On 2025-10-09 11:51:15 -0400, Robert Haas wrote: > On Thu, Oct 9, 2025 at 11:49 AM Andres Freund wrote: > > I thought we basically only used the in-tree pg_bsd_indent these days? > > Oh, I missed the fact that we'd moved it into the tree. But it looks > like you can't build it with meson? It can

Re: Fix for compiler warning triggered in WinGetFuncArgInPartition()

2025-10-09 Thread Tom Lane
Nathan Bossart writes: > Just curious, what compiler/version is this? I skimmed the buildfarm a bit > but didn't find any such warnings. My warning-scraping script found arowana | 2025-10-07 04:51:16 | nodeWindowAgg.c:3723:8: warning: 'forward' may be used uninitialized in this function

Re: [BUG] temporary file usage report with extended protocol and unnamed portals

2025-10-09 Thread Mircea Cadariu
Hi Michael, On 09/10/2025 09:11, Michael Paquier wrote: So, coming back to this thread. Could somebody realign the TAP tests for HEAD so as we have some test coverage to track which temp file is unlinked by which query when a portal is dropped? Did you mean just the tests, without the fix? If

Re: Should we update the random_page_cost default value?

2025-10-09 Thread Robert Haas
On Thu, Oct 9, 2025 at 10:47 AM Tomas Vondra wrote: > I agree with this. But isn't this a mostly orthogonal problem? I mean, > shouldn't we do both (or try to)? > > Also, if users complain about A and not about B, does that mean B is not > an issue? > > Isn't ignoring "B" a bit like that? Of cours

Re: memory leak in dbase_redo()

2025-10-09 Thread Nathan Bossart
On Thu, Oct 09, 2025 at 08:08:05AM -0400, Andres Freund wrote: > And I think it is right. XLOG_DBASE_CREATE_FILE_COPY is careful to > pfree(parent_path), but XLOG_DBASE_CREATE_WAL_LOG isn't. It looks like this was introduced by commit 9e4f914, which was back-patched, but the code path in question

Re: Fix for compiler warning triggered in WinGetFuncArgInPartition()

2025-10-09 Thread Greg Burd
On Oct 9 2025, at 10:45 am, Nathan Bossart wrote: > On Thu, Oct 09, 2025 at 09:41:15AM -0500, Nathan Bossart wrote: >> On Thu, Oct 09, 2025 at 10:21:23AM -0400, Greg Burd wrote: >>> ‘WinGetFuncArgInPartition’:../src/backend/executor/nodeWindowAgg.c:3809:33: >>> warning:‘notnull_relpos’ may be u

Re: Fix for compiler warning triggered in WinGetFuncArgInPartition()

2025-10-09 Thread Nathan Bossart
On Thu, Oct 09, 2025 at 10:21:23AM -0400, Greg Burd wrote: > ‘WinGetFuncArgInPartition’:../src/backend/executor/nodeWindowAgg.c:3809:33: > warning:‘notnull_relpos’ may be used uninitialized > [-Wmaybe-uninitialized] 3809 | } while (notnull_offset < > notnull_relpos); |

Re: Fix overflow of nbatch

2025-10-09 Thread Tomas Vondra
On 10/9/25 16:16, Melanie Plageman wrote: > On Wed, Oct 8, 2025 at 4:46 PM Tomas Vondra wrote: >> >> On 10/8/25 19:37, Melanie Plageman wrote: >> >>> Yes, this was wrong. I forgot an extra / sizeof(HashJoinTuple). I meant: >>> >>> hash_table_bytes / sizeof(HashJoinTuple) > MaxAllocSize / >>> sizeo

Fix for compiler warning triggered in WinGetFuncArgInPartition()

2025-10-09 Thread Greg Burd
Hello, This is a minor change that avoids a "maybe uninitialized" warning that I've been seeing since: 25a30bbd423 Add IGNORE NULLS/RESPECT NULLS option to Window functions. src/backend/postgres_lib.a.p/executor_nodeWindowAgg.c.o../src/backend/executor/nodeWindowAgg.c: In function ‘WinGetFuncArgI

Re: [PATCH] Remove unused #include's in src/backend/commands/*

2025-10-09 Thread Andres Freund
Hi, On 2025-10-09 16:08:38 +0300, Aleksander Alekseev wrote: > > > OK, I tried include-what-you-use with a little post-processing script > > > and the scope of work seems reasonable. I will submit the updated > > > patch shortly. > > > > Here is the updated patch v3. > > Apparently touching colla

[PATCH TEST] Fix logical replication setup in subscription test `t/009_matviews.pl`

2025-10-09 Thread Грем Снорт
Hello! I've found a simple problem in one of subscription tests (`src/test/subscription/t/009_matviews.pl`). When running this test, it completes successfully (All tests successful. Result: PASS) but there is an error in subscriber's logs: ``` logical replication apply worker[1865731] ERROR: logic

Re: Add mode column to pg_stat_progress_vacuum

2025-10-09 Thread Shinya Kato
On Wed, Oct 8, 2025 at 4:40 AM Sami Imseih wrote: > > > > I wonder if we could be even more granular > > > for the "normal autovacuum" case and point to the reason the table was > > > chosen. For example, was it the insert threshold, the update/delete > > > threshold, etc.? > > > > Sounds like r

Why has_useful_pathkeys() needs to check group_pathkeys

2025-10-09 Thread Richard Guo
While reviewing the recent changes in truncate_useless_pathkeys(), I noticed the nearby function has_useful_pathkeys(), and I'm a bit confused. It makes sense to check whether the given relation is involved in joins or whether root->query_pathkeys is nonempty, but I don't understand the need to sp

Re: Enhance Makefiles to rebuild objects on map file changes

2025-10-09 Thread Chao Li
> On Oct 9, 2025, at 16:45, John Naylor wrote: > > On Thu, Oct 9, 2025 at 10:46 AM Chao Li wrote: >> I just tried meson build, it seems to only rebuild the corresponding libs >> without rebuilding Postgres binaries: > >> Is that expected? I think we need Postgres executables to be rebuilt th

Re: get rid of RM_HEAP2_ID

2025-10-09 Thread John Naylor
On Thu, Oct 9, 2025 at 1:43 PM Michael Paquier wrote: > > 0001: Split xl_info into xl_info for rmgr-specific info and xl_geninfo > > for generic flags. I used the XLogInsertExtended() idea from one of > > Matthias's patches in [3], but wrote the rest a different way to keep > > churn small. > > Re

Re: speedup COPY TO for partitioned table.

2025-10-09 Thread Chao Li
Hi Jian, Thanks for the patch. After reviewing it, I got a few small comments: > On Oct 9, 2025, at 15:10, jian he wrote: > > > Please check the attached v16. > 1 ``` + List *partitions; /* oid list of partition oid for copy to */ ``` The comment doesn’t look very goo

Re: speedup COPY TO for partitioned table.

2025-10-09 Thread jian he
On Thu, Oct 9, 2025 at 9:14 AM Masahiko Sawada wrote: > > > please check the attached v15. > > > Thank you for working on this! I've reviewed the v15 patch, and here > are review comments: > > --- > + children = find_all_inheritors(RelationGetRelid(rel), > +