Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

2025-10-03 Thread Xuneng Zhou
Hi, On Fri, Oct 3, 2025 at 9:50 PM Xuneng Zhou wrote: > > Hi Michael, > > Thanks for your review. > > On Fri, Oct 3, 2025 at 2:24 PM Michael Paquier wrote: > > > > On Thu, Oct 02, 2025 at 11:06:14PM +0800, Xuneng Zhou wrote: > > > v5-0002 separates the waitlsn_cmp() comparator function into two

Re: Implement waiting for wal lsn replay: reloaded

2025-10-03 Thread Xuneng Zhou
Hi, On Sun, Sep 28, 2025 at 5:02 PM Xuneng Zhou wrote: > > Hi, > > On Fri, Sep 26, 2025 at 7:22 PM Xuneng Zhou wrote: > > > > Hi Álvaro, > > > > Thanks for your review. > > > > On Tue, Sep 16, 2025 at 4:24 AM Álvaro Herrera wrote: > > > > > > On 2025-Sep-15, Alexander Korotkov wrote: > > > > >

Re: use SIMD in GetPrivateRefCountEntry()

2025-10-03 Thread Nathan Bossart
Sorry for the noise. I fixed x86-64 builds in v2. -- nathan >From 50debef2733eeaae85031a005a48b1d645da072d Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Thu, 2 Oct 2025 21:22:17 -0500 Subject: [PATCH v2 1/2] prepare bufmgr for simd --- src/backend/storage/buffer/bufmgr.c | 35 ++

use SIMD in GetPrivateRefCountEntry()

2025-10-03 Thread Nathan Bossart
(new thread) On Wed, Sep 03, 2025 at 02:47:25PM -0400, Andres Freund wrote: >> I see a variety for increased CPU usage: >> >> 1) The private ref count infrastructure in bufmgr.c gets a bit slower once >>more buffers are pinned > > The problem mainly seems to be that the branches in the loop

Re: Fixing a few minor misusages of bms_union()

2025-10-03 Thread David Rowley
On Sat, 4 Oct 2025 at 03:04, Tom Lane wrote: > This change in substitute_phv_relids_walker is *not* safe according > to the routine's head comment: Oh right. I'll leave that one. > The change in generate_union_paths is obviously safe, though, since > that "relids" is entirely locally built. > >

Re: Fixing a few minor misusages of bms_union()

2025-10-03 Thread David Rowley
On Sat, 4 Oct 2025 at 02:29, Greg Burd wrote: > > On Oct 3 2025, at 5:36 am, David Rowley wrote: > > However, we know that having multiple pointers pointing to the same > > set is "Trouble" as there can be a repalloc() when the set is modified > > and needs more Bitmapwords. That would cause issu

Re: [PATCH] Hex-coding optimizations using SVE on ARM.

2025-10-03 Thread Nathan Bossart
On Fri, Oct 03, 2025 at 02:36:47PM +0700, John Naylor wrote: > LGTM, but I went back and checked if vector8_zero() actually does > anything different than vector8_boadcast(0), and in fact it doesn't on > compilers we support for either x86 or Arm. I pulled the former out > from older work, but it s

Re: Add support for specifying tables in pg_createsubscriber.

2025-10-03 Thread Shubham Khanna
On Wed, Oct 1, 2025 at 6:00 AM Peter Smith wrote: > > Hi Shubham, > > Here are some v13 review comments. > > == > src/bin/pg_basebackup/pg_createsubscriber.c > > 1. > - /* > - * In dry-run mode, we don't create publications, but we still try to drop > - * those to provide necessary information

Re: pg_createsubscriber --dry-run logging concerns

2025-10-03 Thread Neeraj Shah
Hello Peter, Your suggestion makes sense to me, if it's fine with you then I can submit a patch for this change :). [ So, below is now my favoured solution: 1. Add an up-front info log to say when running in dry-run (add for all tools that have --dry-run mode) 2. Modify ~15 places in pg_creates

Re: Add memory_limit_hits to pg_stat_replication_slots

2025-10-03 Thread Masahiko Sawada
On Fri, Oct 3, 2025 at 6:15 AM Bertrand Drouvot wrote: > > Hi, > > On Fri, Oct 03, 2025 at 05:19:42PM +0530, Ashutosh Bapat wrote: > > + bool memory_limit_reached = (rb->size >= logical_decoding_work_mem * > > (Size) 1024); > > + > > + if (memory_limit_reached) > > + rb->memExceededCount += 1; > >

Re: split func.sgml to separated individual sgml files

2025-10-03 Thread Andrew Dunstan
On 2025-10-03 Fr 10:41 AM, Tom Lane wrote: Peter Eisentraut writes: If you look at this more closely, creating postgres-full.xml and running the syntax check perform the same operations, except that the latter throws away the output. So it seems redundant to build a whole new code path for thi

Re: Report bytes and transactions actually sent downtream

2025-10-03 Thread Bertrand Drouvot
Hi, On Fri, Oct 03, 2025 at 12:22:05PM +0530, Ashutosh Bapat wrote: > Here's patchset addressing two issues: Thanks for the patch update! > I > have added a note in documentation for plugin authors, warning them > that this isn't expected. What note are you referring to? (I'm failing to see it)

Re: Add memory_limit_hits to pg_stat_replication_slots

2025-10-03 Thread Bertrand Drouvot
Hi, On Fri, Oct 03, 2025 at 05:19:42PM +0530, Ashutosh Bapat wrote: > + bool memory_limit_reached = (rb->size >= logical_decoding_work_mem * > (Size) 1024); > + > + if (memory_limit_reached) > + rb->memExceededCount += 1; Thanks for looking at it! > If the memory limit is hit but no transaction

Re: Fixing a few minor misusages of bms_union()

2025-10-03 Thread Greg Burd
On Oct 3 2025, at 5:36 am, David Rowley wrote: > While working in prepunion.c, I noticed that generate_union_paths() > has some code being called in a loop that's doing: > >relids = bms_union(relids, rel->relids); > > Since bms_union() creates a new set rather than reusing one of its > in

Re: sql/json query function JsonBehavior default expression's collation may differ from returning type's collation

2025-10-03 Thread jian he
On Tue, Aug 12, 2025 at 7:09 PM Amit Langote wrote: > > Hi Jian, > > Thanks for the patch and also for the offlist heads-up. > > I agree with rejecting cases where the DEFAULT clause’s collation does not > match the RETURNING collation. The result collation for json_value should > come from the

Re: Problem in 'ORDER BY' of a column using a created collation?

2025-10-03 Thread Robert Haas
On Fri, Oct 3, 2025 at 2:14 AM Nishant Sharma wrote: > Thanks Daniel for the confirmation! +1. > Looks like nothing more needed as the issue is already > reported with OCI. It might not be a bad idea to add a comment to that issue and say "hey, I also encountered this problem" and maybe add a l

Re: [PATCH] Add tests for Bitmapset

2025-10-03 Thread Greg Burd
On Oct 3 2025, at 4:25 am, Daniel Gustafsson wrote: >> On 3 Oct 2025, at 01:36, David Rowley wrote: >> >> On Fri, 3 Oct 2025 at 01:33, Daniel Gustafsson wrote: >>> Another nitpick would be to remove the test for NULL in >>> test_bms_make_singleton >>> since that is a STRICT function, making

Re: Support getrandom() for pg_strong_random() source

2025-10-03 Thread Joe Conway
On 10/3/25 04:04, Daniel Gustafsson wrote: On 3 Oct 2025, at 01:16, Masahiko Sawada wrote: Adding Joe to the thread since he usually have insights into all things FIPS. Thanks, I do have opinions at least ;-) ..in systems that must be FIPS compliant, is it okay to generate UUIDs using rand

Re: MergeAppend could consider sorting cheapest child path

2025-10-03 Thread Alexander Korotkov
Hi, Alena! On Fri, Oct 3, 2025 at 1:42 AM Alena Rybakina wrote: > On 07.09.2025 14:26, Alexander Korotkov wrote: > > On Fri, Sep 5, 2025 at 11:45 AM Andrei Lepikhov wrote: > >> On 1/9/2025 22:26, Alexander Korotkov wrote: > >>> On Thu, Jul 31, 2025 at 5:20 PM Andrei Lepikhov wrote: > See t

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

2025-10-03 Thread Aya Iwata (Fujitsu)
Hi, Background == If the background workers connect to databases, some database-related commands like ALTER DATABASE RENAME and ALTER DATABASE SET TABLESPACE cannot be done. Users must do DROP EXTENSION related with workers, or terminate them by themselves if they want to drop or alter th

Re: Add memory_limit_hits to pg_stat_replication_slots

2025-10-03 Thread Ashutosh Bapat
On Fri, Oct 3, 2025 at 5:10 AM Masahiko Sawada wrote: > > On Thu, Sep 25, 2025 at 10:26 PM Bertrand Drouvot > wrote: > > > > Hi, > > > > On Thu, Sep 25, 2025 at 12:14:04PM -0700, Masahiko Sawada wrote: > > > On Thu, Sep 25, 2025 at 3:17 AM Bertrand Drouvot > > > wrote: > > > > > > > > That proba

Re: split func.sgml to separated individual sgml files

2025-10-03 Thread Nazir Bilal Yavuz
Hi, On Thu, 2 Oct 2025 at 23:16, Tom Lane wrote: > > Peter Eisentraut writes: > > I suspect what you're really after here is the functionality of the > > check-tabs and check-nbsp targets. So the new Perl script really just > > has to cover those two and doesn't have to bother with xmllint. An

Re: split func.sgml to separated individual sgml files

2025-10-03 Thread Nazir Bilal Yavuz
Hi, On Thu, 2 Oct 2025 at 21:43, Andrew Dunstan wrote: > > On 2025-10-02 Th 8:52 AM, Nazir Bilal Yavuz wrote: > > I think there is one more problem that we need to think about. This > test runs when the xmllint is enabled but it also requires docbook > (docbook-xml on some OSes) to be installed,

RE: Newly created replication slot may be invalidated by checkpoint

2025-10-03 Thread Hayato Kuroda (Fujitsu)
Dear Vitaly, > > Would you have enough time to work on and fix the issue? > > One idea is to compute the required LSN by the system at the slot > > checkpoint. > This > > partially follows what PG18/HEAD does but seems hacky and difficult to > > accept. > > I'm working on the issue. Give me, pl

Fwd: Problem while updating a foreign table pointing to a partitioned table on foreign server

2025-10-03 Thread Etsuro Fujita
I sent this about two and a half hours ago, but it appears that gmail delivery failed to this list, so I resent it: On Wed, Oct 1, 2025 at 11:13 PM Daniil Davydov <[email protected]> wrote: > On Fri, Nov 16, 2018 at 6:35 PM Tom Lane wrote: > > Etsuro Fujita writes: > > > [ fix-foreign-modify-

Re: Doc compilation fails with a recent xmllint

2025-10-03 Thread Daniel Gustafsson
> On 29 Sep 2025, at 12:55, RECHTÉ Marc wrote: > > Hi. With a recent xmllint (using libxml version 21500-GITv2.15.0), doc > compilation fails with: > > /usr/bin/xmllint --nonet --path . --path . --output postgres-full.xml --noent > --valid postgres.sgml > ref/pg_combinebackup.sgml:317: valid

Re: Add stats_reset to pg_stat_all_tables|indexes and related views

2025-10-03 Thread Bertrand Drouvot
Hi, On Fri, Oct 03, 2025 at 04:50:07PM +0900, Michael Paquier wrote: > On Fri, Oct 03, 2025 at 05:33:00AM +, Bertrand Drouvot wrote: > > On Fri, Oct 03, 2025 at 10:24:39AM +0900, Michael Paquier wrote: > >> Makes sense to me. This matters in terms of coverage for HEAD, > >> being outside of t

Re: [PATCH] Add tests for Bitmapset

2025-10-03 Thread David Rowley
On Fri, 3 Oct 2025 at 21:26, Daniel Gustafsson wrote: > +1 for removing the NULL checks and > simplifying the code. Thank you both for looking. Pushed. David

Fixing a few minor misusages of bms_union()

2025-10-03 Thread David Rowley
While working in prepunion.c, I noticed that generate_union_paths() has some code being called in a loop that's doing: relids = bms_union(relids, rel->relids); Since bms_union() creates a new set rather than reusing one of its input parameter sets, it makes this appear to be an inefficient wa

Re: Clear logical slot's 'synced' flag on promotion of standby

2025-10-03 Thread Ajin Cherian
On Mon, Sep 29, 2025 at 4:11 PM shveta malik wrote: > > On Fri, Sep 26, 2025 at 3:26 PM Ajin Cherian wrote: > > > > > > Attaching v4 which addresses all the above comments. > > > > Few trivial comments: > > 1) > # Confirm the synced slot 'lsub1_slot' is retained on the new primary > is( $standb

Re: Fix incorrect function reference BufFileOpenShared in comment.

2025-10-03 Thread Mingli Zhang
Thanks. Richard Guo 于2025年10月3日 周五15:41写道: > On Wed, Oct 1, 2025 at 6:29 PM Richard Guo wrote: > > On Wed, Oct 1, 2025 at 5:15 PM Zhang Mingli > wrote: > > > The comment incorrectly cited the defunct function BufFileOpenShared() > > > which is replaced in commit dcac5e7ac157964f71f15d81c7429130

Re: Allow virtual columns in index expressions or predicate

2025-10-03 Thread Chengpeng Yan
On Sep 30, 2025, at 17:13, Richard Guo wrote: I'm looking for a solution to support virtual generated columns in index expressions or predicate. The comment in DefineIndex() seems to suggest that virtual generated columns there can be expanded in RelationGetIndexExpressions() and RelationGetInd

Re: [PATCH] Add tests for Bitmapset

2025-10-03 Thread Daniel Gustafsson
> On 3 Oct 2025, at 01:36, David Rowley wrote: > > On Fri, 3 Oct 2025 at 01:33, Daniel Gustafsson wrote: >> Another nitpick would be to remove the test for NULL in >> test_bms_make_singleton >> since that is a STRICT function, making the test for NULL superfluous code: > > I see test_random_op

Re: Add stats_reset to pg_stat_all_tables|indexes and related views

2025-10-03 Thread Michael Paquier
On Fri, Oct 03, 2025 at 05:33:00AM +, Bertrand Drouvot wrote: > On Fri, Oct 03, 2025 at 10:24:39AM +0900, Michael Paquier wrote: >> Makes sense to me. This matters in terms of coverage for HEAD, >> being outside of the scope of this proposal. > > Added one test on pg_stat_all_indexes in v2 at

Re: disallow big-endian on aarch64

2025-10-03 Thread Peter Eisentraut
On 02.10.25 23:31, Nathan Bossart wrote: On Thu, Oct 02, 2025 at 05:08:42PM -0400, Tom Lane wrote: Nathan Bossart writes: The benefit is that we can safely assume little-endian in AAarch64-specific code, and on the off-chance that someone tries to build Postgres in an AArch64/big-endian environ

Re: Support getrandom() for pg_strong_random() source

2025-10-03 Thread Daniel Gustafsson
> On 3 Oct 2025, at 01:16, Masahiko Sawada wrote: Adding Joe to the thread since he usually have insights into all things FIPS. > ..in systems that must be FIPS compliant, is it okay to generate UUIDs > using random numbers from non-FIPS compliant sources? If yes, we can use > pg_random/pg_fast

Re: Issue with logical replication slot during switchover

2025-10-03 Thread Fabrice Chapuis
Hi Shveta, Here is the v4 of the patch with pg_replication_slots view modified to display the field allow_overwrite. Doc was also updated. Regards, Fabrice On Tue, Sep 30, 2025 at 11:45 AM shveta malik wrote: > On Tue, Sep 30, 2025 at 3:11 PM shveta malik > wrote: > > > > On Tue, Sep 30, 2025

Re: Fix incorrect function reference BufFileOpenShared in comment.

2025-10-03 Thread Richard Guo
On Wed, Oct 1, 2025 at 6:29 PM Richard Guo wrote: > On Wed, Oct 1, 2025 at 5:15 PM Zhang Mingli wrote: > > The comment incorrectly cited the defunct function BufFileOpenShared() > > which is replaced in commit dcac5e7ac157964f71f15d81c7429130c69c3f9b. > > > > Update the reference to the current f

Re: a couple of small patches for simd.h

2025-10-03 Thread John Naylor
On Fri, Oct 3, 2025 at 12:36 AM Nathan Bossart wrote: > Barring objections, I plan to commit this soon. Probably tomorrow. LGTM. -- John Naylor Amazon Web Services

Re: [PATCH] Hex-coding optimizations using SVE on ARM.

2025-10-03 Thread John Naylor
On Fri, Oct 3, 2025 at 12:33 AM Nathan Bossart wrote: > [v13] LGTM, but I went back and checked if vector8_zero() actually does anything different than vector8_boadcast(0), and in fact it doesn't on compilers we support for either x86 or Arm. I pulled the former out from older work, but it seems

Re: anonymous unions (C11)

2025-10-03 Thread Peter Eisentraut
On 23.09.25 16:17, Nathan Bossart wrote: On Tue, Sep 23, 2025 at 11:38:22AM +0200, Peter Eisentraut wrote: That said, I did go overboard here and converted all the struct/union combinations I could find, but I'm not necessarily proposing to apply all of them. I'm proposing patches 0001 through

Re: MergeAppend could consider sorting cheapest child path

2025-10-03 Thread Richard Guo
On Thu, Oct 2, 2025 at 11:49 PM Alexander Korotkov wrote: > On Mon, Sep 8, 2025 at 11:39 AM Richard Guo wrote: > > Will have a review by the end of this commitfest. > Did you manage to take a look at this patch? Sorry, I haven't had a chance to review it yet, but it's on my to-do list. I'll ge