Re: Allow GUC settings in CREATE SUBSCRIPTION CONNECTION to take effect

2025-11-20 Thread Fujii Masao
On Thu, Nov 20, 2025 at 3:54 PM Chao Li wrote: > Before this patch, all user specified options are silently discarded, The GUC settings in CREATE SUBSCRIPTION were honored up through v14; the behavior changed in commit f3d4019da5d, so some might view this as a regression. > now all user specifi

Re: [PATCH] psql: tab completion for ALTER ROLE ... IN DATABASE ...

2025-11-20 Thread Neil Chen
On Fri, Nov 21, 2025 at 1:25 PM Ian Lawrence Barwick wrote: > Hi > > I found myself needing to work with ALTER ROLE ... IN DATABASE ... recently > and was annoyed by the lack of tab completion for this, so patch attached. > > > Regards > > Ian Barwick > > HI, I've reviewed the patch and did simpl

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

2025-11-20 Thread Corey Huinker
On Mon, Nov 10, 2025 at 11:36 PM Corey Huinker wrote: > As mentioned before, to make >> CAST(source_expr AS target_type DEFAULT expr ON CONVERSION ERROR); >> work, >> we cannot just simply replace casting FuncExpr nodes with CoerceViaIO, >> since >> type modifiers behave differently in these two

Re: Extended Statistics set/restore/clear functions.

2025-11-20 Thread jian he
hi. makeJsonLexContextCstringLen in v16-0001 and v16-0002 should use GetDatabaseEncoding()? wondering, should we check the value of "degree" is between 0 to 1? + if ((natts < 1) || (natts > (STATS_MAX_DIMENSIONS - 1))) + { + errsave(parse->escontext, + errcode(ERRCODE_INVALID_TEXT_REPRESENTATIO

RE: Parallel Apply

2025-11-20 Thread Zhijie Hou (Fujitsu)
On Thursday, November 20, 2025 10:50 PM Tomas Vondra wrote: > > On 11/20/25 14:10, wenhui qiu wrote: > > Hi > >> 1) The way the patch determines dependencies seems to be the "writeset" > >> approach from other replication systems (e.g. MySQL does that). Maybe > >> we should stick to the same nami

Re: Skipping schema changes in publication

2025-11-20 Thread Peter Smith
Hi Shlok. Here are some review comments for your patch v28-0003 (EXCEPT TABLE ...). The review of this patch is a WIP. In this post I only looked at the test code. == .../t/037_rep_changes_except_table.pl 1. + +# Copyright (c) 2021-2025, PostgreSQL Global Development Group + +# Logical repl

Re: Add MERGE and VALUES statements to tab completion for PREPARE

2025-11-20 Thread Fujii Masao
On Thu, Nov 20, 2025 at 3:05 PM Haruna Miwa wrote: > > > Should we suggest "MERGE INTO" instead of just "MERGE", > > since INTO always follows MERGE? > > > > Also, how about adding "TABLE" and "WITH" to the suggestions, > > similar to the tab-completion for "COPY ("? > > SELECT statement can be sp

Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis

2025-11-20 Thread Chao Li
> On Nov 21, 2025, at 05:08, Peter Smith wrote: > > I've reverted the ALTER 'publication_drop_object' part to be the same > as master (i.e. removed the v6 'table' replacement) after Fujii-San > showed [1] that the original synopsis style is present on some other > documentation pages. > > PSS

RE: Newly created replication slot may be invalidated by checkpoint

2025-11-20 Thread Zhijie Hou (Fujitsu)
On Thursday, November 20, 2025 6:44 PM Amit Kapila wrote: > > On Thu, Nov 20, 2025 at 4:07 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Thursday, November 20, 2025 4:26 PM Vitaly Davydov > wrote: > > > > > > > > Concerning reserve_wal_for_local_slot. It seems it is used in > > > synchronization

Re: How can end users know the cause of LR slot sync delays?

2025-11-20 Thread Amit Kapila
On Fri, Nov 21, 2025 at 11:00 AM shveta malik wrote: > > A few comments on 001: > > 1) > +slots, but may (if leftover from a promotedstandby) contain a > timestamp. > promotedstandby --> promoted standby > > 2) > +s.slotsync_skip_count, > +s.last_slotsync_skip_at, >

Re: Row pattern recognition

2025-11-20 Thread Tatsuo Ishii
Hi Chao, >> On Nov 18, 2025, at 19:19, Vik Fearing wrote: >> >> >> Because of position. Without making DEFINE a reserved keyword, how do you >> know that it isn't another variable in the PATTERN clause? >> > > Ah, thanks for the clarification. Now I got it. > > I’m continue to review 0002.

Re: quoteOneName() inconsistency with quote_all_identifiers — replacement API proposed

2025-11-20 Thread Chao Li
On Thu, Nov 20, 2025 at 8:28 PM Álvaro Herrera wrote: > Hi, > > > -appendStringInfo(&buffer, _("text search configuration > %s"), > > - quote_qualified_identifier(nspname, > > - > NameStr(cfgForm->cfgname))); > > +appendStringInfoQua

Re: Extended Statistics set/restore/clear functions.

2025-11-20 Thread Yuefei Shi
On Fri, Nov 21, 2025 at 10:54 AM Corey Huinker wrote: > >> some of the switch->default, default don't have ``break``. >> > > The compiler doesn't require them, but I see that we do use them in a lot > of places, so I'll incorporate this. > > >> >> + for (int i = 0; i < nitems; i++) >> + { >> + MV

Re: How can end users know the cause of LR slot sync delays?

2025-11-20 Thread shveta malik
On Fri, Nov 21, 2025 at 9:58 AM Amit Kapila wrote: > > On Fri, Nov 21, 2025 at 8:52 AM shveta malik wrote: > > > > On Tue, Nov 18, 2025 at 4:07 PM Shlok Kyal wrote: > > > > > > On Fri, 14 Nov 2025 at 14:13, Hayato Kuroda (Fujitsu) > > > wrote: > > > > > > > > Dear Shlok, > > > > > > > > Thanks

Re: Row pattern recognition

2025-11-20 Thread Chao Li
> On Nov 20, 2025, at 15:33, Chao Li wrote: > > > I’d stop here, and continue 0005 tomorrow. > I reviewed 0005 today. I'm still not very familiar with the executor code, so going through 0005 has also been a valuable learning process for me. 12 - 0005 - nodeWindowAgg.c ``` + if (str

Re: How can end users know the cause of LR slot sync delays?

2025-11-20 Thread Amit Kapila
On Fri, Nov 21, 2025 at 8:52 AM shveta malik wrote: > > On Tue, Nov 18, 2025 at 4:07 PM Shlok Kyal wrote: > > > > On Fri, 14 Nov 2025 at 14:13, Hayato Kuroda (Fujitsu) > > wrote: > > > > > > Dear Shlok, > > > > > > Thanks for updating the patch. Few more comments. > > > > > > > > > > I’m not sur

Re: Clarification on when _PG_init() is invoked for extensions

2025-11-20 Thread Rahila Syed
Hi, > > CREATE extension does not automatically load or ensure that _PG_init() is >> run. >> It mainly runs the .sql script in your extension. >> > Thanks for the clarification. However, in my testing, _PG_init() did run > when I executed > CREATE EXTENSION. I suspect this might be happening beca

RE: Assertion failure in SnapBuildInitialSnapshot()

2025-11-20 Thread Zhijie Hou (Fujitsu)
On Thursday, November 13, 2025 12:56 PM Zhijie Hou (Fujitsu) wrote: > > While testing the patches across all branches, I noticed that an additional > lock > needs to be added in the launcher.c where > ReplicationSlotsComputeRequiredXmin(true) was recently added for conflict > detection slot. I

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-11-20 Thread Ajin Cherian
On Wed, Nov 19, 2025 at 5:10 PM Amit Kapila wrote: > > On Wed, Nov 12, 2025 at 1:54 PM Ajin Cherian wrote: > > > > Attaching patch v23 addressing these comments. > > > > Few comments: > = > 1. > In contrast, automatic synchronization >via sync_replication_slots provides contin

Re: Extended Statistics set/restore/clear functions.

2025-11-20 Thread Chao Li
After 16 rounds of revisions, v16 looks solid and robust. Only got a few small comments: > On Nov 21, 2025, at 07:08, Corey Huinker wrote: > > 1 - 0001 ``` + /* +* We need at least two attribute numbers for a ndistinct item, anything +* less is malformed. +*/ +

Re: How can end users know the cause of LR slot sync delays?

2025-11-20 Thread shveta malik
On Tue, Nov 18, 2025 at 4:07 PM Shlok Kyal wrote: > > On Fri, 14 Nov 2025 at 14:13, Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Shlok, > > > > Thanks for updating the patch. Few more comments. > > > > > > > > I’m not sure if this has already been discussed; I couldn’t find any > > > > > > menti

[PATCH] psql: tab completion for ALTER ROLE ... IN DATABASE ...

2025-11-20 Thread Ian Lawrence Barwick
Hi I found myself needing to work with ALTER ROLE ... IN DATABASE ... recently and was annoyed by the lack of tab completion for this, so patch attached. Regards Ian Barwick From de1cb4cb546b9cfac280c44aea2cf112a85bc7e9 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Fri, 21 Nov 2025 11:47:26

Re: Parallel Apply

2025-11-20 Thread wenhui qiu
Hi Tomas > discussing some of this stuff. I'm not saying we should copy all of > this, but it seems like a good source of inspiration what (not) to do. I'm not saying we should copy MySQL's implementation. MySQL’s parallel replication is based on group commit, and PostgreSQL can’t directly adopt th

Re: Proposal: Conflict log history table for Logical Replication

2025-11-20 Thread Peter Smith
Thanks for addressing all my previous review comment of v4. Here are some more comments for the latest patch v5-0001. == GENERAL 1. There are still a couple of place remainig where this new table was not consistent called a "Conflict Log Table" (e.g. search for "history") e.g. Subject: [PA

Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

2025-11-20 Thread Chao Li
> On Nov 21, 2025, at 01:19, Melanie Plageman wrote: > > On Wed, Nov 19, 2025 at 6:13 PM Melanie Plageman > wrote: >> >> Since it is passed into one of the helpers, I think I agree. Attached >> v21 has this change. > > I've committed the first three patches. Attached v22 is the remaining >

Re: Remaining dependency on setlocale()

2025-11-20 Thread Jeff Davis
On Wed, 2025-11-12 at 19:59 +0100, Peter Eisentraut wrote: > Many of these issues are pre-existing, but I just figured it has > reached > a point where we need to do something about it. I tried to simplify things in this patch series, assuming that we have some tolerance for small behavior change

Re: GNU/Hurd portability patches

2025-11-20 Thread Samuel Thibault
Hello, Thomas Munro, le jeu. 20 nov. 2025 17:20:57 +1300, a ecrit: > On Thu, Nov 20, 2025 at 11:45 AM Samuel Thibault > wrote: > > Thomas Munro, le mar. 18 nov. 2025 18:32:38 +1300, a ecrit: > > > Does that also imply that preadv() has to loop over the vectors > > > sending tons of messages and w

Re: 10% drop in code line count in PG 17

2025-11-20 Thread Bruce Momjian
On Thu, Nov 20, 2025 at 03:30:15PM -0500, Bruce Momjian wrote: > On Thu, Nov 20, 2025 at 10:38:49AM +0100, Daniel Gustafsson wrote: > > > On 19 Nov 2025, at 20:59, Bruce Momjian wrote: > > > > > While working on a talk, I studied the number of code line changes in > > > each major release, > > >

Re: Changing the state of data checksums in a running cluster

2025-11-20 Thread Andreas Karlsson
On 11/20/25 11:34 AM, Tomas Vondra wrote: On 11/19/25 22:03, Andreas Karlsson wrote: Hi, I have been following these discussions but not read the patch in detail. This patch makes me worried especially with the new issues recently uncovered. This was already a quite big patch and to fix these

Re: pg_utility ?

2025-11-20 Thread Andreas Karlsson
On 11/20/25 10:31 AM, Christoph Berg wrote: Re: Andreas Karlsson Perhaps pg_util? ("pg" is taken by that classic pager thingy.) I like the name pg_util. In the MySQL world it is called mysqladmin, which is a does of pg_ctl and tools like createdb. "pg_adm" would also be a candidate. (Or is t

Re: ON CONFLICT DO SELECT (take 3)

2025-11-20 Thread Andreas Karlsson
On 11/20/25 9:49 AM, Dean Rasheed wrote: OK, got it. So author credit for this patch should go to Marko, Andreas, and Viktor? In that order? And I should add the original thread to the commit message. Sounds good! Andreas

Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB ​barriers

2025-11-20 Thread Thomas Munro
On Fri, Nov 21, 2025 at 9:45 AM Greg Burd wrote: > Dave and I have been working together to get ARM64 with MSVC functional. > The attached patches accomplish that. Dave is the author of the first > which addresses some build issues and fixes the spin_delay() semantics, > I did the second which fi

Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB ​barriers

2025-11-20 Thread Andres Freund
Hi, On 2025-11-20 19:03:47 -0500, Andres Freund wrote: > > MSVC's _InterlockedCompareExchange() intrinsic on ARM64 performs the > > atomic operation but does NOT emit the necessary Data Memory Barrier > > (DMB) instructions [4][5]. > > I couldn't reproduce this result when playing around on godbo

Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB ​barriers

2025-11-20 Thread Andres Freund
Hi, On 2025-11-20 15:45:22 -0500, Greg Burd wrote: > Dave and I have been working together to get ARM64 with MSVC functional. > The attached patches accomplish that. Dave is the author of the first > which addresses some build issues and fixes the spin_delay() semantics, > I did the second which

[PATCH] Remove ctid from self-join examples in UPDATE and DELETE docs

2025-11-20 Thread Bernice Southey
Hi all, I've never submitted a patch before, sorry for any missteps. This patch replaces ctid with an id column in the UPDATE and DELETE self-join examples. There's an important difference I recently learned between using ctid and a primary key column for a self-join in an UPDATE. With a primary k

Re: [PATCH] Write Notifications Through WAL

2025-11-20 Thread Masahiko Sawada
Hi, On Mon, Nov 3, 2025 at 1:36 PM Rishu Bagga wrote: > > Hi, apologies for the delay, attached a new patch addressing the > concerns, as well as > enabling a standby to listen and receive notifications from the primary. > > On Fri, Oct 17, 2025 at 6:33 AM Arseniy Mukhin > wrote: > > > > Good ca

Re: Add support for COPY TO in tablesync for partitioned tables.

2025-11-20 Thread Masahiko Sawada
On Wed, Nov 19, 2025 at 2:56 PM Masahiko Sawada wrote: > > On Thu, Nov 13, 2025 at 7:17 PM Ajin Cherian wrote: > > > > On Thu, Nov 13, 2025 at 8:49 AM Masahiko Sawada > > wrote: > > > > > > On Mon, Nov 10, 2025 at 7:37 PM Ajin Cherian wrote: > > > > > > > > On Tue, Nov 11, 2025 at 2:19 PM Amit

Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent

2025-11-20 Thread Nathan Bossart
On Thu, Nov 20, 2025 at 01:18:56PM -0500, Robert Haas wrote: > What I'd be inclined to do after a failure is tear down the entire > segment. Even if there's no mechanism to retry, you're saving the > memory that the segment would have consumed. Unpinning/detaching the segment/DSA/dshash table and

Re: 10% drop in code line count in PG 17

2025-11-20 Thread David Rowley
On Fri, 21 Nov 2025 at 10:26, Bruce Momjian wrote: > > On Fri, Nov 21, 2025 at 10:16:56AM +1300, David Rowley wrote: > > I think you need to keep the "top of the Git tree" comment as git > > ls-files is context-based. > > Uh, the current file has this comment: Oh. I misread the patch. Mistakenly

Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB barriers

2025-11-20 Thread Nathan Bossart
I took a quick look at 0001. +#ifdef _MSC_VER +#include +#else #include unsigned int crc; I think you can remove this since we unconditionally do the runtime check for MSVC. In any case, the missing #endif seems likely to cause problems. --- a/src/port/pg_crc32c_armv8.c +++ b/src/port/pg_cr

Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

2025-11-20 Thread Melanie Plageman
On Thu, Nov 20, 2025 at 12:55 PM Dagfinn Ilmari Mannsåker wrote: > > I didn't pay much attention to this thread, so I didn't notice this > until it got committed, but I'd like to lodge an objection to this > formatting, especially the lack of spaces before the field names. This > would be much mor

Re: Eagerly evict bulkwrite strategy ring

2025-11-20 Thread Melanie Plageman
Chao Li found a mistake I made in not releasing the buffer content lock in one code path which he reported in another thread [1]. This patch set shares some patches with the patches in that thread, so attached is a corrected v9. - Melanie [1] https://www.postgresql.org/message-id/20E76846-4816-4

Re: vacuumdb: add --dry-run

2025-11-20 Thread Nathan Bossart
On Thu, Nov 20, 2025 at 05:09:54PM -0500, Corey Huinker wrote: > I have no objections to, but I am curious about the factors that went into > making dry_run an independent boolean rather than part of vacopts. My thinking was that it's closer to "echo" and "quiet" than anything in vacuumingOptions.

Re: another autovacuum scheduling thread

2025-11-20 Thread David Rowley
On Fri, 21 Nov 2025 at 10:16, Robert Haas wrote: > > On Thu, Nov 20, 2025 at 3:58 PM David Rowley wrote: > > before we need to make a decision. My vote is to use as much of that > > time as possible rather than using it to allow people to dream up > > hypothetical problems that might or might not

Re: Checkpointer write combining

2025-11-20 Thread Melanie Plageman
Thanks for continuing to review this! On Wed, Nov 19, 2025 at 9:32 PM Chao Li wrote: > > +static void > +CleanVictimBuffer(BufferDesc *bufdesc, > + bool from_ring, IOContext io_context) > +{ > + XLogRecPtr max_lsn = InvalidXLogRecPtr; > + LWLock

Re: vacuumdb: add --dry-run

2025-11-20 Thread Corey Huinker
On Thu, Nov 20, 2025 at 4:46 PM Nathan Bossart wrote: > On Wed, Nov 19, 2025 at 07:54:06PM -0500, Corey Huinker wrote: > > Here's a shopping list of incremental changes. I'm happy with whatever > > makes the most sense to you. > > Here is a v4 patch set. I've made a variety of small changes. I

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

2025-11-20 Thread Masahiko Sawada
On Thu, Nov 20, 2025 at 6:16 AM 河田達也 wrote: > > Hi Sawada-san, Chao-san, > > Thank you very much for your helpful feedback and testing. > > > We can use vacrel->dead_items_info->max_bytes instead of calculating it > > again. > I fixed it as you mentioned. > > > > I meant (1) actually. I don't thi

Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB barriers

2025-11-20 Thread Greg Burd
On Nov 20 2025, at 5:00 pm, Peter Eisentraut wrote: > On 20.11.25 21:45, Greg Burd wrote: >> Dave and I have been working together to get ARM64 with MSVC functional. >> The attached patches accomplish that. Dave is the author of the first >> which addresses some build issues and fixes the spi

Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB barriers

2025-11-20 Thread Peter Eisentraut
On 20.11.25 21:45, Greg Burd wrote: Dave and I have been working together to get ARM64 with MSVC functional. The attached patches accomplish that. Dave is the author of the first which addresses some build issues and fixes the spin_delay() semantics, I did the second which fixes some atomics in

Re: RFC 9266: Channel Bindings for TLS 1.3 support

2025-11-20 Thread Jacob Champion
On Thu, Nov 20, 2025 at 1:52 PM Heikki Linnakangas wrote: > PostgreSQL does support channel binding, with tls-server-end-point. I > believe that sufficient to prevent an attack like that. No, IIRC unique bindings (-unique and -exporter) prevent MITM even if the attacker has the server's private k

Re: Clarification on when _PG_init() is invoked for extensions

2025-11-20 Thread Tom Lane
Ayush Vatsa writes: > My use case is that I’m building an experimental extension that will be > installed only in a few > databases. I want the hooks initialized by this extension to apply only to > those specific > databases, while all other databases should continue with the default > PostgreSQL

Re: RFC 9266: Channel Bindings for TLS 1.3 support

2025-11-20 Thread Jacob Champion
On Thu, Nov 20, 2025 at 12:59 PM * Neustradamus * wrote: > In 2022, I have contacted PostgreSQL team about Channel Binding: > - https://www.postgresql.org/search/?m=1&q=tls-exporter&l=&d=-1&s=i There was some initial work there [1], but we'd still need to figure out channel binding negotiation, w

Re: RFC 9266: Channel Bindings for TLS 1.3 support

2025-11-20 Thread Heikki Linnakangas
On 20/11/2025 22:58, * Neustradamus * wrote: Dear PostgreSQL team, dear all, In 2022, I have contacted PostgreSQL team about Channel Binding: - https://www.postgresql.org/search/?m=1&q=tls-exporter&l=&d=-1&s=i We are in 2025, I relaunch the subject because several developers always say me: "it

Re: vacuumdb: add --dry-run

2025-11-20 Thread Nathan Bossart
On Wed, Nov 19, 2025 at 07:54:06PM -0500, Corey Huinker wrote: > Here's a shopping list of incremental changes. I'm happy with whatever > makes the most sense to you. Here is a v4 patch set. I've made a variety of small changes. I think there's some room to bike-shed on the messages we send to t

Re: Clarification on when _PG_init() is invoked for extensions

2025-11-20 Thread Hannu Krosing
You probably can do the LOAD in the GUC callback functions and then set that GUC only for specific databases using ALTER DATABASE SET =true; On Thu, Nov 20, 2025 at 6:53 PM Ayush Vatsa wrote: > Hi, > > CREATE extension does not automatically load or ensure that _PG_init() is >> run. >> It mainly

Re: 10% drop in code line count in PG 17

2025-11-20 Thread Bruce Momjian
On Fri, Nov 21, 2025 at 10:16:56AM +1300, David Rowley wrote: > On Fri, 21 Nov 2025 at 09:27, Bruce Momjian wrote: > > # This script is used to compute the total number of "C" lines in the > > release > > -# This should be run from the top of the Git tree after a 'make distclean' > > -find . -nam

Re: 10% drop in code line count in PG 17

2025-11-20 Thread David Rowley
On Fri, 21 Nov 2025 at 09:27, Bruce Momjian wrote: > # This script is used to compute the total number of "C" lines in the release > -# This should be run from the top of the Git tree after a 'make distclean' > -find . -name '*.[chyl]' | xargs cat| wc -l > +# This should be run from the top of the

Re: another autovacuum scheduling thread

2025-11-20 Thread Robert Haas
On Thu, Nov 20, 2025 at 3:58 PM David Rowley wrote: > before we need to make a decision. My vote is to use as much of that > time as possible rather than using it to allow people to dream up > hypothetical problems that might or might not exist. That seems a little harsh. I think the only hypothe

Re: 10% drop in code line count in PG 17

2025-11-20 Thread Daniel Gustafsson
> On 20 Nov 2025, at 21:30, Bruce Momjian wrote: > Yeah, that's part of a larger discussion. In an email I just sent I > suggested we are trying to count files that are part of a cluster > install, rather than testing files, but again, needs discussion. Right, but that was sort of my point, yo

Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis

2025-11-20 Thread Peter Smith
I've reverted the ALTER 'publication_drop_object' part to be the same as master (i.e. removed the v6 'table' replacement) after Fujii-San showed [1] that the original synopsis style is present on some other documentation pages. PSS new patch v7. == [1] https://www.postgresql.org/message-id/C

RFC 9266: Channel Bindings for TLS 1.3 support

2025-11-20 Thread * Neustradamus *
Dear PostgreSQL team, dear all, In 2022, I have contacted PostgreSQL team about Channel Binding: - https://www.postgresql.org/search/?m=1&q=tls-exporter&l=&d=-1&s=i We are in 2025, I relaunch the subject because several developers always say me: "it is not supported by PostgreSQL". Can you add

Re: another autovacuum scheduling thread

2025-11-20 Thread David Rowley
On Fri, 21 Nov 2025 at 07:36, Robert Haas wrote: > If you want to take more manual control, you can use > the reloption, a choice that you can layer on top of the default > strategy or any of the alternate strategies just proposed. Of course, > making this all too complicated is a recipe for failu

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

2025-11-20 Thread Andres Freund
Hi, On 2025-11-20 14:08:57 -0500, Greg Burd wrote: > After talking to you about these ideas at PGConf in NYC I've been > anxiously awaiting this patch set. Thanks for dedicating the energy and > time to get it to this stage. Thanks! > High level feedback after reading the patches/email/commit m

[PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB ​barriers

2025-11-20 Thread Greg Burd
Hi all, Dave and I have been working together to get ARM64 with MSVC functional. The attached patches accomplish that. Dave is the author of the first which addresses some build issues and fixes the spin_delay() semantics, I did the second which fixes some atomics in this combination. PostgreSQL

Re: Issue with logical replication slot during switchover

2025-11-20 Thread Masahiko Sawada
On Thu, Nov 20, 2025 at 6:26 AM Fabrice Chapuis wrote: > > > I think we need to clarify that suppose the standby has a slot with > > failover=true and synced=false and the primary has the slot with the > > same name, failover=true, and synced=true... > I'm not sure to understand the semantics rela

Re: 10% drop in code line count in PG 17

2025-11-20 Thread Bruce Momjian
On Thu, Nov 20, 2025 at 04:49:51PM +0300, Aleksander Alekseev wrote: > Hi, > > > > While working on a talk, I studied the number of code line changes in > > > each major release, and found PG 17 surprisingly reduced code line count > > > by 10%. To get the code line count, I used /pgtop/src/tools/

Re: 10% drop in code line count in PG 17

2025-11-20 Thread Bruce Momjian
On Thu, Nov 20, 2025 at 10:38:49AM +0100, Daniel Gustafsson wrote: > > On 19 Nov 2025, at 20:59, Bruce Momjian wrote: > > > While working on a talk, I studied the number of code line changes in > > each major release, > > This script will only pick up C, but will pick up C in src/test but not an

Re: 10% drop in code line count in PG 17

2025-11-20 Thread Bruce Momjian
On Thu, Nov 20, 2025 at 11:42:39AM +0100, Álvaro Herrera wrote: > On 2025-Nov-20, David Rowley wrote: > > > Maybe you'd be better with git ls-files if you only want just what's > > in the repo. Something like: > > > > for b in "REL8_0_0" "REL8_1_0" "REL8_2_0" "REL8_3_0" "REL8_4_0" > > "REL9_0_0"

Re: 10% drop in code line count in PG 17

2025-11-20 Thread Bruce Momjian
On Thu, Nov 20, 2025 at 12:23:25PM +1300, David Rowley wrote: > On Thu, 20 Nov 2025 at 10:58, Bruce Momjian wrote: > > I think you are right. Attached is the difference between the output > > for 16 & 17. Let me do some more research and run all the versions > > again and report back, thanks. >

Re: Optimize LISTEN/NOTIFY

2025-11-20 Thread Tom Lane
I took a brief look through the v28 patch, and I'm fairly distressed at how much new logic has been stuffed into what's effectively a critical section. It's totally not okay for AtCommit_Notify or anything it calls to throw an error; if it does, something like this will happen: diff --git a/src/b

Re: another autovacuum scheduling thread

2025-11-20 Thread Sami Imseih
> something that just lets you get back to the old behavior. > Technically, the latter is good enough to avoid any claim that we've > regressed things: yes, that is the intention with the GUC. I am worried about cases in which a user has no way to go back to the old behavior if the new prioritizat

Re: POC: Parallel processing of indexes in autovacuum

2025-11-20 Thread Sami Imseih
Hi, I started to review this patch set again, and it needed rebasing, so I went ahead and did that. I also have some comments: #1 In AutoVacuumReserveParallelWorkers() I think here we should assert: ``` Assert(nworkers <= AutoVacuumShmem->av_freeParallelWorkers); ``` prior to: ``` + A

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

2025-11-20 Thread Greg Burd
On Nov 19 2025, at 9:47 pm, Andres Freund wrote: > Hi, > > On 2025-10-09 17:16:49 -0400, Andres Freund wrote: >> 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 t

Re: Making jsonb_agg() faster

2025-11-20 Thread Tom Lane
I wrote: > Chao Li writes: >> You left two “ugly hack” comments. Maybe add a short description for why >> they are hack and what can be improved in the future. > It's the same ugly hack as before, I just formatted the code more > legibly ... I didn't stop to look at whether there's a better way

Re: another autovacuum scheduling thread

2025-11-20 Thread Robert Haas
On Thu, Nov 20, 2025 at 11:34 AM Sami Imseih wrote: > I think it would be difficult to introduce this new prioritization > system without a > GUC to control the prioritization behavior. Since ordering by pg_class has > been > the only behavior ever since autovacuum was released, there should be a

Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent

2025-11-20 Thread Robert Haas
On Thu, Nov 20, 2025 at 11:12 AM Nathan Bossart wrote: > ISTM that besides pure coding errors, the most likely reasons for an ERROR > during DSM segment initialization are things like out-of-memory, too many > LWLock tranches registered, etc. In those cases, do we want every single > backend that

Re: Remove useless casts to (void *)

2025-11-20 Thread Jacob Champion
On Thu, Nov 20, 2025 at 6:02 AM Aleksander Alekseev wrote: > Here `databuf` has a type (void*). Although the code is correct, it > replaces an explicit cast (which I read "yes, we know what we are > doing") with an implicit one. "Yes, we know what we are doing" is the argument against doing it, t

Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

2025-11-20 Thread Dagfinn Ilmari Mannsåker
Dagfinn Ilmari Mannsåker writes: > Melanie Plageman writes: > >> +PruneFreezeParams params = {.relation = >> relation,.buffer = buffer, >> +.reason = PRUNE_ON_ACCESS,.options = 0, >> +.vistest = vistest,.cutoffs = NULL

Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

2025-11-20 Thread Dagfinn Ilmari Mannsåker
Melanie Plageman writes: > + PruneFreezeParams params = {.relation = > relation,.buffer = buffer, > + .reason = PRUNE_ON_ACCESS,.options = 0, > + .vistest = vistest,.cutoffs = NULL > + }; I didn't pa

Re: Clarification on when _PG_init() is invoked for extensions

2025-11-20 Thread Ayush Vatsa
Hi, CREATE extension does not automatically load or ensure that _PG_init() is > run. > It mainly runs the .sql script in your extension. > Thanks for the clarification. However, in my testing, _PG_init() did run when I executed CREATE EXTENSION. I suspect this might be happening because the SQL sc

Re: Odd openbsd CI failure

2025-11-20 Thread Melanie Plageman
On Wed, Oct 8, 2025 at 9:22 AM Andres Freund wrote: > > Severel interesting bits: > a) why is setsid() failing > b) why did we write "unrecognized" as the backend type? I just saw this again (causing a different test to fail). https://cirrus-ci.com/task/6409088281608192 log from primary with sam

Re: Remove useless casts to (void *)

2025-11-20 Thread Bertrand Drouvot
Hi, On Thu, Nov 20, 2025 at 04:43:58PM +0100, Álvaro Herrera wrote: > On 2025-Nov-20, Aleksander Alekseev wrote: > > > IMO what actually is important is for the code to be consistent. > > IMO what is most important is that the code is correct. Second most > important is that the code is perform

Re: Add os_page_num to pg_buffercache

2025-11-20 Thread Bertrand Drouvot
Hi, On Wed, Nov 19, 2025 at 10:49:49PM +0900, Michael Paquier wrote: > On Wed, Nov 19, 2025 at 09:28:09AM +, Bertrand Drouvot wrote: > > Option 1: > > > > We could simply create the pg_buffercache_os_pages view on top of the > > pg_buffercache_numa one. The cons I can think of is that, when n

Re: Fix GetOperatorFromCompareType

2025-11-20 Thread Paul A Jungwirth
On Sun, Nov 16, 2025 at 11:18 PM Neil Chen wrote: > After your patch changes, the line '*opid = InvalidOid;' seems removable. > > Also, if the second validation check of opclass after 'get_opclass_method' > feels a bit odd, moving 'get_opclass_opfamily_and_input_type' to the very top > would wor

Re: another autovacuum scheduling thread

2025-11-20 Thread Sami Imseih
> On Thu, Nov 20, 2025 at 09:30:42AM -0500, Robert Haas wrote: > > Point being: I think we need to avoid the mindset that we can't be > > stupider than we are now. I don't think there's any way we would > > commit something that is GENERALLY stupider than we are now, but it's > > not about averages

Re: POC: make mxidoff 64 bits

2025-11-20 Thread Maxim Orlov
On Wed, 19 Nov 2025 at 19:20, Heikki Linnakangas wrote: > > I think those recipes need to be adjusted for 64-bit offsets. Yes, we need to do it. Sorry if this is too obvious, but with 32-bit offsets, we get: SLRU_PAGES_PER_SEGMENT * BLKSZ / sizeof(MXOff) = 32 * 8192 / 4 = 65,536 mxoff per s

Re: another autovacuum scheduling thread

2025-11-20 Thread Nathan Bossart
On Thu, Nov 20, 2025 at 09:30:42AM -0500, Robert Haas wrote: > Point being: I think we need to avoid the mindset that we can't be > stupider than we are now. I don't think there's any way we would > commit something that is GENERALLY stupider than we are now, but it's > not about averages. It's abo

Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent

2025-11-20 Thread Nathan Bossart
On Thu, Nov 20, 2025 at 10:44:31AM -0500, Robert Haas wrote: > Now, perhaps the chances of an initialization failure in practice are > quite low. Maybe a typical initialization function won't do anything > that could fail. But it just seems weird to me to design something > that thinks errors are l

Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent

2025-11-20 Thread Robert Haas
On Wed, Nov 12, 2025 at 3:31 PM Nathan Bossart wrote: > Teach DSM registry to ERROR if attaching to an uninitialized entry. > > If DSM entry initialization fails, backends could try to use an > uninitialized DSM segment, DSA, or dshash table (since the entry is > still added to the registry). To

Re: Remove useless casts to (void *)

2025-11-20 Thread Álvaro Herrera
On 2025-Nov-20, Aleksander Alekseev wrote: > IMO what actually is important is for the code to be consistent. IMO what is most important is that the code is correct. Second most important is that the code is performant. The consistency is perhaps a third priority, if that -- there may be other

Re: Trying out read streams in pgvector (an extension)

2025-11-20 Thread Melanie Plageman
On Wed, Nov 19, 2025 at 2:28 AM Nazir Bilal Yavuz wrote: > > > To make sure 1) distance isn't reset to a resume_distance from > > read_stream_begin_relation() and 2) unexpected buffers aren't returned > > from the read stream, we could error out in read_stream_resume() if > > pinned_buffers > 0. A

Re: ON CONFLICT DO SELECT (take 3)

2025-11-20 Thread jian he
> > > https://www.postgresql.org/docs/current/ddl-priv.html#DDL-PRIV-UPDATE > says: > ``` > SELECT ... FOR UPDATE and SELECT ... FOR SHARE also require this privilege on > at > least one column, in addition to the SELECT privilege. > ``` > I attached extensive permission tests for ON CONFLICT DO S

Re: Remove useless casts to (void *)

2025-11-20 Thread Aleksander Alekseev
Hi, > > Personally I don't think this is a good change. > > Only this one (because maybe databuf is used twice) or the whole idea of > 7f798aca1d5 > and this patch? The whole idea to be honest. This being said, this is just my personal opinion as of today. The majority of the community may disag

Re: SQL Property Graph Queries (SQL/PGQ)

2025-11-20 Thread Ashutosh Bapat
Hi Junwang, On Sun, Aug 31, 2025 at 4:35 PM Junwang Zhao wrote: > > > I have some review comments, and hope some of them are helpful. > > 1. > > doc/src/sgml/ddl.sgml > > + > +CREATE PROPERTY GRAPH myshop > +VERTEX TABLES ( > +products LABEL product, > +customers LABEL custome

Re: Metadata and record block access stats for indexes

2025-11-20 Thread Aleksander Alekseev
Hi Mircea, > Rebased and dusted off this patch. Thanks for the patch. Here are my two cents. IMO it would be helpful if you could come up with a few more practical use cases. This change is going to affect pretty much everyone. If only a few users will benefit from it once in several years, the

Re: Parallel Apply

2025-11-20 Thread Tomas Vondra
On 11/20/25 14:10, wenhui qiu wrote: > Hi  >> 1) The way the patch determines dependencies seems to be the "writeset" >> approach from other replication systems (e.g. MySQL does that). Maybe we >> should stick to the same naming? > >> OK, I did not research the design in MySQL in detail but will t

Re: Remove useless casts to (void *)

2025-11-20 Thread Bertrand Drouvot
Hi Aleksander, On Thu, Nov 20, 2025 at 05:01:49PM +0300, Aleksander Alekseev wrote: > Hi Bertrand, > > > The attached also remove casts that have been added since 7f798aca1d5, the > > ones > > in pg_publication.c, lock.c and tuplesortvariants.c. > > > > The patch has been generated with the help

Re: another autovacuum scheduling thread

2025-11-20 Thread Robert Haas
On Wed, Nov 12, 2025 at 3:10 PM Nathan Bossart wrote: > I do think re-prioritization is worth considering, but IMHO we should leave > it out of phase 1. I think it's pretty easy to reason about one round of > prioritization being okay. The order is completely arbitrary today, so how > could orde

Re: Issue with logical replication slot during switchover

2025-11-20 Thread Fabrice Chapuis
> I think we need to clarify that suppose the standby has a slot with > failover=true and synced=false and the primary has the slot with the > same name, failover=true, and synced=true... I'm not sure to understand the semantics related to the `synced` flag but why `synced` flag can be true on a pr

Re: Asynchronous MergeAppend

2025-11-20 Thread Alexander Pyhalov
Matheus Alcantara писал(а) 2025-11-20 00:51: On Tue Nov 18, 2025 at 4:14 AM -03, Alexander Pyhalov wrote: Updated the first patch. Thanks for the new version. Some new comments. v7-0002-MergeAppend-should-support-Async-Foreign-Scan-subpla.patch: 1. Should be "nasyncplans" instead of "nplans"

  1   2   >