missing PG_IO_ALIGN_SIZE uses

2025-11-30 Thread Peter Eisentraut
Commit faeedbcefd4 changed the alignment of WAL buffers from XLOG_BLCKSZ to PG_IO_ALIGN_SIZE. While looking around for places to apply alignas, I think I found at least two places that were forgotten, namely in BootStrapXLOG() and in pg_test_fsync.c. Patches attached for those. I also suspe

Re: Move WAL/RMGR sequence code into its own file and header

2025-11-30 Thread Michael Paquier
On Fri, Nov 28, 2025 at 01:05:55PM +0900, Michael Paquier wrote: > On Thu, Nov 27, 2025 at 12:00:30PM +0300, Kirill Reshke wrote: >> Shouldnt `SEQ_LOG_VALS` be moved to sequnce_xlog.c ? > > I am not sure to follow this one. This controls the frequency of the > records inserted, which has nothing

Re: [Patch] Build the heap more efficient in tuplesort.c

2025-11-30 Thread cca5507
Hi, > For performance patches, you should include example workloads that > your patch speeds up. Include benchmark results with and without your > patch. Demonstrate you've not regressed any other workloads at the > expense of the ones you intend to speed up. > > It's not up to reviewers to do th

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-30 Thread Bertrand Drouvot
Hi, On Tue, Nov 18, 2025 at 04:54:32PM +0100, Peter Eisentraut wrote: > I mean, some people like writing if (!foo) and some like writing if > (foo == NULL), but we're not going to legislate one > over the other. Agree. Out of curiosity, I searched for pointers and literal zero comparisons or assi

Re: alignas (C11)

2025-11-30 Thread Peter Eisentraut
On 12.11.25 12:39, Peter Eisentraut wrote: Here, I'm proposing to make some use of the alignas specifier.  This takes the place of compiler extensions such as __attribute__((aligned(a))) and __declspec(align(a)), packaged up as pg_attribute_aligned(a), which are used in a variety of places.  Al

Re: Refactoring: Use soft error reporting for *_opt_overflow functions of date/timestamp

2025-11-30 Thread Michael Paquier
On Fri, Nov 28, 2025 at 09:46:43AM +0530, Amul Sul wrote: > I have attached patch 0002 that renames it. I also updated patch 0001 > to accommodate Amit's comment suggestions. Thanks, applied this one after more tweaks. Regarding 0002, just doing a renaming makes me a bit uncomfortable after a sec

Re: Row pattern recognition

2025-11-30 Thread Tatsuo Ishii
Hi Chao, Sorry, I missed this email. >> 9 - 0002 - parse_clause.c > > I am continuing to review 0003 > > 10 - 0003 > ``` > + Assert(list_length(patternVariables) == list_length(defineClause)); > ``` > > Is this assert true? From what I learned, pattern length doesn’t have to > equal to de

Re: Remove unused function parameters, part 2: replication

2025-11-30 Thread Bertrand Drouvot
Hi, On Fri, Nov 28, 2025 at 01:39:19PM -0500, Andres Freund wrote: > I am pretty unconvinced this kind of stuff is worth the noise they produce in > the more general case too. I agree that it's noisy and time consuming to review, that's the drawback of using automated tools when they find and pr

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-11-30 Thread Masahiko Sawada
On Thu, Nov 27, 2025 at 4:59 AM Amit Kapila wrote: > > On Thu, Nov 27, 2025 at 2:32 AM Masahiko Sawada wrote: > > > > I've squashed all fixup patches and attached the updated patch. > > > > 1. > wal_level_insufficient means that the > - primary doesn't have a sufficient > to > -

Re: UPDATE run check constraints for affected columns only

2025-11-30 Thread Tom Lane
jian he writes: > The attached patch implements the $subject. Does this cover the case where a BEFORE UPDATE trigger has modified columns that were not mentioned in UPDATE...SET? regards, tom lane

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-11-30 Thread Masahiko Sawada
On Thu, Nov 27, 2025 at 11:23 PM vignesh C wrote: > > > Few comments: > 1) There is no validation after creation of temporary logical > replication slot, can we see if "logical decoding is enabled upon > creating a new logical replication slot" is logged as a validation for > this: > +# Create a

UPDATE run check constraints for affected columns only

2025-11-30 Thread jian he
hi. while casually looking at https://wiki.postgresql.org/wiki/Todo then I found out this thread: https://postgr.es/m/1326055327.15293.13.camel%40vanquo.pezone.net Seems easier to do nowadays. The attached patch implements the $subject. regress tests seems not enough to test it. Following the ap

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-11-30 Thread Masahiko Sawada
On Thu, Nov 27, 2025 at 11:00 PM shveta malik wrote: > > On Thu, Nov 27, 2025 at 4:33 PM shveta malik wrote: > > > > A few more comments: > > > > > > 10) > > +# Promote standby3, increasing effective_wal_level to 'logical' as > > its wal_level > > +# is set to 'logical'. > > +$standby3->promote;

Re: Simplify code building the LR conflict messages

2025-11-30 Thread Amit Kapila
On Sat, Nov 29, 2025 at 11:51 PM Tom Lane wrote: > > After a little bit of thought, here's a sketch of a straw-man idea. > > 1. The longstanding output for unique constraint violations is like > > ERROR: duplicate key value violates unique constraint "foo_f1_f2_key" > DETAIL: Key (f1, f2)=(1, 2)

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-11-30 Thread Masahiko Sawada
On Thu, Nov 27, 2025 at 5:03 AM shveta malik wrote: > > > A few more comments: > > 8) > InvalidateObsoleteReplicationSlots(): > > + if (InvalidatePossiblyObsoleteSlot(possible_causes, s, oldestLSN, > +dboid, snapshotConflictHorizon, > +&released_lock)) > { > .. > } > + > + SpinLock

Re: Eliminating SPI / SQL from some RI triggers - take 3

2025-11-30 Thread Junwang Zhao
Hi, On Wed, Oct 22, 2025 at 9:56 PM Amit Langote wrote: > > . > On Tue, Oct 21, 2025 at 2:10 PM Pavel Stehule wrote: > > út 21. 10. 2025 v 6:07 odesílatel Amit Langote > > napsal: > >> > >> On Thu, Apr 3, 2025 at 7:19 PM Amit Langote > >> wrote: > >> > On Fri, Dec 20, 2024 at 1:23 PM Amit La

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-11-30 Thread Masahiko Sawada
On Thu, Nov 27, 2025 at 3:51 AM shveta malik wrote: > > On Thu, Nov 27, 2025 at 2:32 AM Masahiko Sawada wrote: > > > > > > I've squashed all fixup patches and attached the updated patch. > > > > Thanks for test results and the patch. Please find a few comments: > > 1) > If primary has effective_w

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-11-30 Thread Masahiko Sawada
On Thu, Nov 27, 2025 at 12:33 AM Peter Smith wrote: > > Hi Sawada-San. > > Some review comments for v30-0001. Thank you for the comments! > == > src/backend/replication/logical/logicalctl.c > > 5. > + * In the future, we could extend support to include automatic transitions > > Sawada-San re

Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions

2025-11-30 Thread Corey Huinker
> > >> I'm fine with it. I can see having 'f' and 's' both mean cast > functions, but 's' means safe, but the extra boolean works too and we'll be > fine with either method. > > > > > > I can work on this part if you don't have time. > > Do you mean change pg_cast.casterrorsafe from boolean to char

Re: [PATCH] Expose checkpoint timestamp and duration in pg_stat_checkpointer

2025-11-30 Thread Soumya S Murali
Hi all, > On Fri, Nov 28, 2025 at 10:23:54AM +0530, Soumya S Murali wrote: > > I have updated the code based on the feedback received to my earlier > > mails and prepared a patch for further review. > > I think the logging change and the pg_stat_checkpointer changes are > different enough that the

Re: Add GoAway protocol message for graceful but fast server shutdown/switchover

2025-11-30 Thread Ajit Awekar
Hi Jelte, Thank you for proposing the GoAway protocol message. I've developed a patch that serves as a strong, immediate use case for its inclusion. https://www.postgresql.org/message-id/flat/CAER375OvH3_ONmc-SgUFpA6gv_d6eNj2KdZktzo-f_uqNwwWNw%40mail.gmail.com Thanks & Best Regards, Ajit On

Re: Parallel Apply

2025-11-30 Thread Dilip Kumar
On Mon, Nov 24, 2025 at 5:07 PM Amit Kapila wrote: > > While it might seem efficient for the producer (leader) to assist > > consumers (workers) when there's a limited number of consumers, I > > believe this isn't the best design. In such scenarios, it's generally > > better to allow the producer

Re: Proposal: Conflict log history table for Logical Replication

2025-11-30 Thread Dilip Kumar
On Fri, Nov 28, 2025 at 5:50 PM Amit Kapila wrote: > > On Tue, Nov 18, 2025 at 3:40 PM shveta malik wrote: > > > > On Thu, Nov 13, 2025 at 9:17 PM Dilip Kumar wrote: > > > > > > On Thu, Nov 13, 2025 at 2:39 PM shveta malik > > > wrote: > > > > > > > > 3) > > > > We also need to think how we ar

Re: Implement waiting for wal lsn replay: reloaded

2025-11-30 Thread Xuneng Zhou
Hi hackers, On Tue, Nov 25, 2025 at 7:51 PM Xuneng Zhou wrote: > > Hi! > > > > > > At the moment, the WAIT FOR LSN command supports only the replay mode. > > > > > If we intend to extend its functionality more broadly, one option is > > > > > to add a mode option or something similar. Are users e

Proposal: Support Logical replication of large objects

2025-11-30 Thread Dilip Kumar
Problem Statement === Large object replication is currently unsupported in logical replication, which presents a significant barrier to using logical replication when large objects are in use. This lack of support limits the usability of logical replication for applications that heavily

Re: meson and check-tests

2025-11-30 Thread Ashutosh Bapat
On Sun, Nov 30, 2025 at 11:39 PM Andrew Dunstan wrote: > > > On 2025-11-27 Th 5:19 AM, Nazir Bilal Yavuz wrote: > > Hi, > > > > On Sat, 22 Nov 2025 at 01:16, Andrew Dunstan wrote: > >> Committed > > Here is a small follow-up commit for documenting this feature. > > > > > This really belongs in th

RE: [buildfarm related] Machines gcc experimental failed test_lfind

2025-11-30 Thread Hayato Kuroda (Fujitsu)
Dear John, Tom and Nathan, Thanks for seeing the issue. I found the animals are now green, e.g. [1], so I hope it might be a compiler's bug. I learned that no need to spend time for experimental tools unless we have idea around here. [1]: https://buildfarm.postgresql.org/cgi-bin/show_history.pl?

Re: [Patch] Build the heap more efficient in tuplesort.c

2025-11-30 Thread David Rowley
On Sun, 30 Nov 2025 at 22:36, cca5507 wrote: > Now we build the heap by using tuplesort_heap_insert(), which has a sift-up > every call. > > To make it more efficient, I want to add tuplesort_heap_insert_unordered() > and tuplesort_heap_build() > just like binaryheap_add_unordered() and binaryhe

Re: Early December Commitfest app release

2025-11-30 Thread Jelte Fennema-Nio
On Sat, 15 Nov 2025 at 14:05, Magnus Hagander wrote: > If it was restricted to only show those that had actually submitted into it > would've probably been considered OK - but at the time it was not considered > to be worth the effort to split those up. I did this now: https://github.com/postgr

Re: Add support for specifying tables in pg_createsubscriber.

2025-11-30 Thread Peter Smith
Hi Shubham. Some minor review comments for v20-0001. == 1. +# Test publication reuse and creation behavior with --dry-run. +# This should reuse existing 'test_pub_existing' and create new 'test_pub_new', +# demonstrating mixed publication handling without actual changes. +($stdout, $stderr) =

Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part

2025-11-30 Thread David E. Wheeler
On Nov 28, 2025, at 05:29, jian he wrote: > some "switch" in the attached patch does not preserve the JsonPathItemType > order > consistency, like executeItemOptUnwrapTarget. Well-spotted, thank you! Fixed in v15, attached. Best, David v15-0001-Rename-jsonpath-method-arg-tokens.patch Descri

Re: meson and check-tests

2025-11-30 Thread Andrew Dunstan
On 2025-11-27 Th 5:19 AM, Nazir Bilal Yavuz wrote: Hi, On Sat, 22 Nov 2025 at 01:16, Andrew Dunstan wrote: Committed Here is a small follow-up commit for documenting this feature. This really belongs in the "meson" section. We need to add a new para there similar to the "make" section

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-11-30 Thread Mihail Nikalayeu
Hello! On Sun, Nov 30, 2025 at 6:00 PM Alexander Lakhin wrote: > s1: NOTICE: notice triggered for injection point > pre-invalidate-catalog-snapshot-end > +s1: NOTICE: notice triggered for injection point > pre-invalidate-catalog-snapshot-end > step s1_start_upsert: <... completed> > ste

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-11-30 Thread Alexander Lakhin
Hello Alvaro, 27.11.2025 14:32, Álvaro Herrera wrote: Thanks for reviewing. I have pushed it now. Looking at the next one. I've noticed two failures from skink you could find interesting: [1], [2]. The difference from [2]: ok 3 - syscache-update-pruned  94198 ms not o

Re: Feature Proposal: schema renaming in pg_dump/pg_restore

2025-11-30 Thread Tom Lane
Brad Arndt writes: > *My Proposal:* > Build in the ability to rename schemas as part of pg_dump (and to a lesser > extent pg_restore - more on that below) by adding a --rename-schema flag. This has been proposed before, and the discussions always foundered on the fact that pg_dump has no understa

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-11-30 Thread Mihail Nikalayeu
Hello, Álvaro! On Sun, Nov 30, 2025 at 1:11 PM Mihail Nikalayeu wrote: > On Sat, Nov 29, 2025 at 6:48 PM Álvaro Herrera wrote: > > Looking at 0004, I think IsIndexCompatibleAsArbiter() should map the > > attribute numbers, in case the partition has a different column layout > > than the parent (

Feature Proposal: schema renaming in pg_dump/pg_restore

2025-11-30 Thread Brad Arndt
First time going through the contribution process with postgres, but from what I read in the documentation, the best place to start with a new feature proposal is an email to this mailing list for feedback. So here goes... *Use Case:* We use pg_dump/pg_restore both as a mechanism to "archive"/"re

Re: IPC/MultixactCreation on the Standby server

2025-11-30 Thread Andrey Borodin
> On 29 Nov 2025, at 00:51, Heikki Linnakangas wrote: > > I think the second comment became outdated in commit bc7d37a525c0, which > introduced the safety check in (what became later) SimpleLruTruncate(). After > that, it's been important that latest_page_number is set correctly, although >

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-11-30 Thread Mihail Nikalayeu
Hello! On Sat, Nov 29, 2025 at 6:48 PM Álvaro Herrera wrote: > Looking at 0004, I think IsIndexCompatibleAsArbiter() should map the > attribute numbers, in case the partition has a different column layout > than the parent (e.g. in case there are dropped columns or just > different column orders)

Re: [PATCH] Add memory usage reporting to VACUUM VERBOSE

2025-11-30 Thread 河田達也
Hi Chao-san, Thank you very much for your testing and review! > 1. Major concern: In this patch, you only increase vacrel->total_dead_items_bytes in dead_items_reset(), however, dead_items_reset() is not always called, that way I often see usage is 0. We should also increate the counter in heap_

[Patch] Build the heap more efficient in tuplesort.c

2025-11-30 Thread cca5507
Hi hackers, Now we build the heap by using tuplesort_heap_insert(), which has a sift-up every call. To make it more efficient, I want to add tuplesort_heap_insert_unordered() and tuplesort_heap_build() just like binaryheap_add_unordered() and binaryheap_build(). Thoughts? -- Regards, ChangAo

PG version is not seen in pg_upgrade test log

2025-11-30 Thread Potapov Alexander
Hello! I ran pg_upgrade tests (make check -C src/bin/pg_upgrade) and found that test log does not contain PG version: (file: src/bin/pg_upgrade/tmp_check/log/regress_log_002_pg_upgrade) Name: old_node Data directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgr

Improve the test src/test/postmaster/t/003_start_stop.pl

2025-11-30 Thread Potapov Alexander
Hello, This is about the TAP test src/test/postmaster/t/003_start_stop.pl. The test contains a loop that performs 21 iterations in order to occupy all possible connections. We could calculate the number of available connections more accurately. It relates to the size of backend pool that is defi