RE: pg_recvlogical cannot create slots with failover=true

2025-04-02 Thread Hayato Kuroda (Fujitsu)
Dear Michael, > Maybe we don't need a short option at all for this, at least initially? Indeed, updated. Best regards, Hayato Kuroda FUJITSU LIMITED v2-0001-Allow-pg_recvlogical-to-create-slots-with-failove.patch Description: v2-0001-Allow-pg_recvlogical-to-create-slots-with-failove.patch

Re: Test to dump and restore objects left behind by regression

2025-04-02 Thread Ashutosh Bapat
On Wed, Apr 2, 2025 at 3:36 PM Ashutosh Bapat wrote: > > > > No commitfest entry please. Better to add an open item on the wiki > > page. > > https://wiki.postgresql.org/wiki/Open_Items > > Posted it on the thread where I have reported the bug. Hopefully, we > will commit both the bug fix and tes

Re: statistics import and export: another difference in dump/restore

2025-04-02 Thread Ashutosh Bapat
On Wed, Apr 2, 2025 at 10:55 PM Jeff Davis wrote: > > On Wed, 2025-04-02 at 15:35 +0530, Ashutosh Bapat wrote: > > Once we fix this issue, we need to enable statistics dump and > > comparison in pg_upgrade/002_pg_upgrade using the attached patch. > > The diff appears to be an issue in 002_pg_upgra

Re: RFC: Logging plan of the running query

2025-04-02 Thread torikoshia
On 2025-04-03 01:22, Sami Imseih wrote: > FWIW, I have been thinking about auto_explain for another task, > remote plans for fdw [0], and perhaps there are now other good > reasons, some that you mention, that can be simplified if "auto_explain" > becomes a core feature. This could be a proposal

RE: Fix 035_standby_logical_decoding.pl race conditions

2025-04-02 Thread Hayato Kuroda (Fujitsu)
> Isn't patch 0001-Fix-invalid-referring-of-hash-ref-for-replication-sl > unrelated to this thread? Or am, I missing something? I did attach wrongly, PSA correct set. Sorry for inconvenience. Best regards, Hayato Kuroda FUJITSU LIMITED v5-0001-Stabilize-035_standby_logical_decoding.pl-by-usin

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-02 Thread Amit Kapila
On Thu, Apr 3, 2025 at 11:08 AM Masahiko Sawada wrote: > > On Wed, Apr 2, 2025 at 7:58 PM Amit Kapila wrote: > > > > On Thu, Apr 3, 2025 at 7:50 AM Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Thu, Apr 3, 2025 at 3:30 AM Masahiko Sawada wrote: > > > > > > > > > > > On Wed, Apr 2, 2025 at 6:33 

RE: Fix 035_standby_logical_decoding.pl race conditions

2025-04-02 Thread Hayato Kuroda (Fujitsu)
Dear Bertrand, Amit, > > I do prefer v5-PG17-2 as it is "closer" to HEAD. That said, I think that we > > should > > keep the slots active and only avoid doing the checks for them (they are > invalidated > > that's fine, they are not that's fine too). > > > > I don't mind doing that, but there is

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-02 Thread Masahiko Sawada
On Wed, Apr 2, 2025 at 7:58 PM Amit Kapila wrote: > > On Thu, Apr 3, 2025 at 7:50 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Thu, Apr 3, 2025 at 3:30 AM Masahiko Sawada wrote: > > > > > > > > On Wed, Apr 2, 2025 at 6:33 AM Zhijie Hou (Fujitsu) > > > wrote: > > > > > > Thank you for the explanat

Re: RFC: Logging plan of the running query

2025-04-02 Thread torikoshia
On 2025-04-01 03:51, Sadeq Dousti wrote: Hi, Sergey and I reviewed this patch and have a few comments, listed below. Thanks for your review! BTW the patch adds about 400 lines to explain.c and it may be better to split the file as well as 9173e8b6046, but I leave it as it is for now. 1. A

Re: NOT ENFORCED constraint feature

2025-04-02 Thread Amul Sul
On Wed, Apr 2, 2025 at 6:02 PM Peter Eisentraut wrote: > > On 28.03.25 14:27, Amul Sul wrote: > > On Fri, Mar 28, 2025 at 3:34 PM Ashutosh Bapat > > wrote: > >> > >> On Thu, Mar 27, 2025 at 6:25 PM Amul Sul wrote: > >> > >>> > >>> I am not sure how to make such tests stable enough since the trig

Extensible user mapping handler for FDW

2025-04-02 Thread Peifeng Qiu
Hi hackers, I'm working on a patch that makes FDW user mapping extensible. Main motivation for this is to avoid plain text password or other sensitive secret being stored in catalog table, and let an external source to handle this. In our use case, the foreign tables are created by an admin user a

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-04-02 Thread Amit Kapila
On Wed, Apr 2, 2025 at 8:30 PM Bertrand Drouvot wrote: > > On Wed, Apr 02, 2025 at 12:13:52PM +, Hayato Kuroda (Fujitsu) wrote: > > Dear Amit, Bertrand, > > > > > The other idea to simplify the changes for backbranches: > > > sub reactive_slots_change_hfs_and_wait_for_xmins > > > { > > > ... >

Re: Test to dump and restore objects left behind by regression

2025-04-02 Thread Ashutosh Bapat
On Thu, Apr 3, 2025 at 9:29 AM vignesh C wrote: > > I believe this commitfest entry at [1] can be closed now, as the > buildfarm has been running stably for the past few days. > [1] - https://commitfest.postgresql.org/patch/4956/ I intended to close this but closed another entry by mistake. If po

Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning

2025-04-02 Thread Amit Langote
On Wed, Apr 2, 2025 at 9:52 PM Ashutosh Bapat wrote: > On Wed, Apr 2, 2025 at 1:00 PM Amit Langote wrote: > > I'm feeling good about this version, but let me know if you have any > > further thoughts / comments. > > Thanks for incorporating the changes and fixing initial hash table size. > > + #d

Some codes refer slot()->{'slot_name'} but it is not defined

2025-04-02 Thread Hayato Kuroda (Fujitsu)
Dear hackers, Cluster.pm defines a function slot()which requires a slot_name as a key and returns attributes of the given slot, as a hash-ref. ISTM, the hash does not contain 'slot_name'. However, I found that some codes access it by using a key 'slot_name'. ISTM it always becomes 'undef' thus a

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-02 Thread Amit Kapila
On Thu, Apr 3, 2025 at 7:50 AM Zhijie Hou (Fujitsu) wrote: > > On Thu, Apr 3, 2025 at 3:30 AM Masahiko Sawada wrote: > > > > > On Wed, Apr 2, 2025 at 6:33 AM Zhijie Hou (Fujitsu) > > wrote: > > > > Thank you for the explanation! I agree that the issue happens in these > > cases. > > > > As anoth

Re: Using read stream in autoprewarm

2025-04-02 Thread Melanie Plageman
On Wed, Apr 2, 2025 at 3:34 PM Melanie Plageman wrote: > attached v10 Attached v11 has an assortment of cosmetic updates. - Melanie From 3b1657a0ba51299fa0384a0032759f3661a2baca Mon Sep 17 00:00:00 2001 From: Melanie Plageman Date: Mon, 31 Mar 2025 22:02:25 -0400 Subject: [PATCH v11 2/3] Refact

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-02 Thread Sami Imseih
> That seems like a very good location for this advice. But the current > set of bullet points are all directed towards "... a general procedure > for determining which indexes to create". I propose that a new paragrph, > not a bullet point, be added towards the end of that section which > addresse

Re: Statistics Import and Export

2025-04-02 Thread Nathan Bossart
On Wed, Apr 02, 2025 at 10:34:58PM -0400, Corey Huinker wrote: >> >> > Also, why do we need the clause "WHERE s.tablename = ANY($2)"? Isn't >> > that already implied by "JOIN unnest($1, $2) ... s.tablename = >> > u.tablename"? >> >> Good question. Corey, do you recall why this was needed? >> > >

RE: Fix slot synchronization with two_phase decoding enabled

2025-04-02 Thread Zhijie Hou (Fujitsu)
On Thu, Apr 3, 2025 at 3:30 AM Masahiko Sawada wrote: > > On Wed, Apr 2, 2025 at 6:33 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Wed, Apr 2, 2025 at 3:45 PM Masahiko Sawada wrote: > > > > Hi, > > > > > > > > On Mon, Mar 31, 2025 at 4:3 AM Zhijie Hou (Fujitsu) > > > wrote: > > > > After further

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-02 Thread Sami Imseih
> > + indexes. If performance degrades after making an index invisible, it can > > be easily > > + be made visible using VISIBLE. Before making an index > > invisible, it's recommended > > + to check > > pg_stat_user_indexes.idx_scan > > + to identify potentially unused indexes. > > I feel ALTER

Re: Some read stream improvements

2025-04-02 Thread Thomas Munro
On Thu, Apr 3, 2025 at 11:17 AM Andres Freund wrote: > I don't actually see any reason for buffer_limit to be a 16bit quantity? It's > just to clamp things down, right? Ugh. It might be worth just flipping this whole thing over to ints, let me look into that...

Re: Using read stream in autoprewarm

2025-04-02 Thread Melanie Plageman
On Wed, Apr 2, 2025 at 6:26 AM Nazir Bilal Yavuz wrote: > > On Wed, 2 Apr 2025 at 01:36, Melanie Plageman > wrote: > > > > I know you mentioned off-list that you don't like the handling of > > global objects in my version, but I prefer doing it this way (even > > though we have to check for in t

Re: Statistics Import and Export

2025-04-02 Thread Jeff Davis
On Tue, 2025-04-01 at 22:21 -0500, Nathan Bossart wrote: > It certainly feels risky.  I was able to avoid executing the queries > twice > in all cases by saving the definition length in the TOC entry and > skipping > that many bytes the second time round. Another idea that was under-discussed is w

Re: Question -- why is there no errhint_internal function?

2025-04-02 Thread Peter Smith
(I added Andres to this thread) Hi Andres, I saw that a new errhint_internal() function was recently committed [1]. I had also posted above asking about this same missing function a month ago [2]. But, your patch only added the new function -- it does not make any use of it for existing code tha

Re: bug when apply fast default mechanism for adding new column over domain with default value

2025-04-02 Thread Tom Lane
Tender Wang writes: > So let's add CommandCounterIncrement() after calling StoreAttrMissingVal(). Pushed with minor editorialization. I thought for a bit about whether the CCI call should be inside StoreAttrMissingVal; but its cohorts in heap.c don't do their own CCI calls, so this way seems the

Re: Some read stream improvements

2025-04-02 Thread Andres Freund
Hi, On 2025-03-14 22:03:15 +1300, Thomas Munro wrote: > I have pushed the new pin limit patches, after some more testing and > copy editing. I dropped an unnecessary hunk (in read_stream_reset(), a > change I'd like to make but it didn't belong in this commit) and > dropped the word "Soft" from Ge

Re: Incorrect result of bitmap heap scan.

2025-04-02 Thread Tom Lane
Andres Freund writes: > Does anybody have an opinion about how non-invasive to be in the > back-branches? The minimal version is something like this diff: Minimal is good -- less chance of breaking anything. > - Should we commit the test showing that the naive implementation of > index-only-bi

Re: Restrict copying of invalidated replication slots

2025-04-02 Thread Masahiko Sawada
On Tue, Mar 18, 2025 at 2:28 AM Shlok Kyal wrote: > > On Mon, 17 Mar 2025 at 22:57, Masahiko Sawada wrote: > > > > On Sun, Mar 9, 2025 at 11:16 PM Shlok Kyal wrote: > > > > > > On Fri, 28 Feb 2025 at 08:56, Amit Kapila wrote: > > > > > > > > On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada > >

Re: Using read stream in autoprewarm

2025-04-02 Thread Nazir Bilal Yavuz
Hi, On Wed, 2 Apr 2025 at 01:36, Melanie Plageman wrote: > > On Tue, Apr 1, 2025 at 8:50 AM Nazir Bilal Yavuz wrote: > > > > I am attaching v8, which is an updated version of the v7. I tried to > > get rid of these local variables and refactored code to make logic > > more straightforward instea

Re: Enhancing Memory Context Statistics Reporting

2025-04-02 Thread Daniel Gustafsson
> On 26 Mar 2025, at 11:34, Rahila Syed wrote: > + ereport(LOG, > + errmsg("hash table corrupted, can't construct path value")); > I know you switched from elog(LOG.. to ereport(LOG.. but I still think a LOG > entry stating corruption isn't helpful, it's not actionable for t

Re: Using read stream in autoprewarm

2025-04-02 Thread Nazir Bilal Yavuz
Hi, On Wed, 2 Apr 2025 at 18:54, Melanie Plageman wrote: > > On Wed, Apr 2, 2025 at 6:26 AM Nazir Bilal Yavuz wrote: > > > > On Wed, 2 Apr 2025 at 01:36, Melanie Plageman > > wrote: > > > > > > I know you mentioned off-list that you don't like the handling of > > > global objects in my version

Re: LWLock deadlock in brinRevmapDesummarizeRange

2025-04-02 Thread Arseniy Mukhin
Hello Tomas and Alvaro, Came across this old thread while searching for information about brin, and decided to try to fix it. On 22.02.2023 17:41, Alvaro Herrera wrote: > On 2023-Feb-22, Tomas Vondra wrote: > >>> ... and in there, I wrote that we would first write the brin tuple in >>> the regul

Re: Proposal - Allow extensions to set a Plan Identifier

2025-04-02 Thread Sami Imseih
> I reviewed the patch and I only have one comment. I still think > we need an Assert inside RecordConstantLocation to make sure clocations > is allocated if the caller intends to record constant locations. > > RecordConstLocation(JumbleState *jstate, int location, bool squashed) > { > + Assert(jst

Re: [PATCH] Add sortsupport for range types and btree_gist

2025-04-02 Thread Heikki Linnakangas
On 02/04/2025 20:18, Heikki Linnakangas wrote: So I added it for the btree opfamily too, and moved the function to rangetypes.c since it's not just for gist anymore. I Ccmmitted that part, and will start looking more closely at the remaining btree_gist parts now. Here's an updated version of

Re: Incorrect result of bitmap heap scan.

2025-04-02 Thread Andres Freund
Hi, On 2025-04-02 14:17:01 -0400, Tom Lane wrote: > Andres Freund writes: > > Does anybody have an opinion about how non-invasive to be in the > > back-branches? The minimal version is something like this diff: > > Minimal is good -- less chance of breaking anything. > > > - Should we commit th

Re: Incorrect result of bitmap heap scan.

2025-04-02 Thread Matthias van de Meent
On Wed, 2 Apr 2025 at 19:48, Andres Freund wrote: > > Hi, > > On 2025-04-02 18:58:11 +0200, Matthias van de Meent wrote: > > And here it is, v6 of the patchset, rebased up to master @ 764d501d. > > Thanks! > > Does anybody have an opinion about how non-invasive to be in the > back-branches? The mi

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-02 Thread Masahiko Sawada
On Wed, Apr 2, 2025 at 6:33 AM Zhijie Hou (Fujitsu) wrote: > > On Wed, Apr 2, 2025 at 3:45 PM Masahiko Sawada wrote: > > Hi, > > > > > On Mon, Mar 31, 2025 at 4:3 AM Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Thu, Mar 27, 2025 at 2:29 PM Amit Kapila wrote: > > > > > > > > > > > On Tue, Mar 25

Re: Replace IN VALUES with ANY in WHERE clauses during optimization

2025-04-02 Thread Alexander Korotkov
Hi, Alena! On Wed, Apr 2, 2025 at 5:33 PM Alena Rybakina wrote: > I prepared a patch according to my suggestions, it just checks that the > transformation is not carried out if there is a var element, there are > changes only in one test, but I think it is correct. > > diff -U3 > /home/alena/pos

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-02 Thread Alvaro Herrera
On 2025-Apr-02, jian he wrote: > we need special code for handing parent is invalid, child is valid > (table inheritance or partitioning). H. I'm going to focus on this case, which is the simplest one we care about (no multi-level hierarchy, only not null constraint): create table singlepp

Re: BTScanOpaqueData size slows down tests

2025-04-02 Thread Tomas Vondra
On 4/2/25 17:45, Peter Geoghegan wrote: > On Wed, Apr 2, 2025 at 11:36 AM Tom Lane wrote: >> Ouch! I had no idea it had gotten that big. Yeah, we ought to >> do something about that. > > Tomas Vondra talked about this recently, in the context of his work on > prefetching. > I might have menti

Re: BTScanOpaqueData size slows down tests

2025-04-02 Thread Peter Geoghegan
On Wed, Apr 2, 2025 at 11:36 AM Tom Lane wrote: > Ouch! I had no idea it had gotten that big. Yeah, we ought to > do something about that. Tomas Vondra talked about this recently, in the context of his work on prefetching. > > And/or perhaps we could could allocate BTScanOpaqueData.markPos as

Re: SQLFunctionCache and generic plans

2025-04-02 Thread Tom Lane
I wrote: > Anyway, I feel pretty good about this patch now and am quite content > to stop here for PG 18. Since feature freeze is fast approaching, I did a tiny bit more cosmetic work on this patchset and then pushed it. (There's still plenty of time for adjustments if you have further comments.)

Re: statistics import and export: another difference in dump/restore

2025-04-02 Thread Jeff Davis
On Wed, 2025-04-02 at 15:35 +0530, Ashutosh Bapat wrote: > Once we fix this issue, we need to enable statistics dump and > comparison in pg_upgrade/002_pg_upgrade using the attached patch. The diff appears to be an issue in 002_pg_upgrade.pl introduced in 172259afb5. There are two dumps taken from

Re: Add pg_buffercache_evict_all() and pg_buffercache_mark_dirty[_all]() functions

2025-04-02 Thread Andres Freund
Hi, On 2025-03-31 19:49:25 +0300, Nazir Bilal Yavuz wrote: > > After this discussion, I think it would be helpful if one of the more > > experienced > > hackers could take a look at the overall picture (perhaps we should set > > the > > status "Ready for Committer"? To be honest, I'm not sure what

Re: Incorrect result of bitmap heap scan.

2025-04-02 Thread Matthias van de Meent
On Wed, 2 Apr 2025 at 18:20, Matthias van de Meent wrote: > > On Wed, 2 Apr 2025 at 17:37, Andres Freund wrote: > > > > Hi, > > > > Matthias, any chance you can provide a rebased version for master? > > Sure, I'll try to have it in your inbox later today CEST. And here it is, v6 of the patchset,

Re: BTScanOpaqueData size slows down tests

2025-04-02 Thread Álvaro Herrera
On 2025-Apr-02, Peter Geoghegan wrote: > On Wed, Apr 2, 2025 at 12:31 PM Álvaro Herrera > wrote: > > The mentioned commit (09cb5c0e7d6f) shows that we do partial memcpys, e.g. > > > > + memcpy(&so->markPos, &so->currPos, > > + offsetof(BTScanPosData, items[1]) + > > +

Re: Parallel CREATE INDEX for GIN indexes

2025-04-02 Thread Tomas Vondra
On 4/2/25 18:43, Andres Freund wrote: > Hi, > > On 2025-03-04 20:50:43 +0100, Tomas Vondra wrote: >> I pushed the two smaller parts today. >> >> Here's the remaining two parts, to keep cfbot happy. I don't expect to >> get these into PG18, though. > > If that's the case, could we either close the

Re: Parallel CREATE INDEX for GIN indexes

2025-04-02 Thread Andres Freund
Hi, On 2025-03-04 20:50:43 +0100, Tomas Vondra wrote: > I pushed the two smaller parts today. > > Here's the remaining two parts, to keep cfbot happy. I don't expect to > get these into PG18, though. If that's the case, could we either close the CF entry, or move it to the next fest? Greetings,

Re: Statistics Import and Export

2025-04-02 Thread Andres Freund
Hi, https://commitfest.postgresql.org/patch/4538/ is still in "needs review", even though the feature really has been committed. Is that intention, e.g. to track pending changes that we're planning to make? Greetings, Andres

Re: Draft for basic NUMA observability

2025-04-02 Thread Tomas Vondra
On 4/2/25 16:46, Jakub Wartak wrote: > On Tue, Apr 1, 2025 at 10:17 PM Tomas Vondra wrote: >> >> Hi, >> >> I've spent a bit of time reviewing this. In general I haven't found >> anything I'd call a bug, but here's a couple comments for v18 ... Most >> of this is in separate "review" commits, wi

Re: BTScanOpaqueData size slows down tests

2025-04-02 Thread Peter Geoghegan
On Wed, Apr 2, 2025 at 12:31 PM Álvaro Herrera wrote: > The mentioned commit (09cb5c0e7d6f) shows that we do partial memcpys, e.g. > > + memcpy(&so->markPos, &so->currPos, > + offsetof(BTScanPosData, items[1]) + > + so->currPos.lastItem * sizeof(BTScanPosItem)); > >

Re: BTScanOpaqueData size slows down tests

2025-04-02 Thread Álvaro Herrera
On 2025-Apr-02, Tom Lane wrote: > Andres Freund writes: > > I'm a bit confused by the "MUST BE LAST" comment: > > BTScanPosItem items[MaxTIDsPerBTreePage]; /* MUST BE LAST */ > > Yeah, me too. It looks like it might've been intended to allow > the items[] array to be only partially al

Re: BTScanOpaqueData size slows down tests

2025-04-02 Thread Tom Lane
Peter Geoghegan writes: > It isn't at all rare for the scan to have to return about 1350 TIDs > from a page, though. Any low cardinality index will tend to have > almost that many TIDs to return on any page that only stores > duplicates. And scan will necessarily have to return all of the TIDs > f

Re: BTScanOpaqueData size slows down tests

2025-04-02 Thread Andres Freund
Hi, On 2025-04-02 12:01:57 -0400, Peter Geoghegan wrote: > On Wed, Apr 2, 2025 at 11:57 AM Andres Freund wrote: > > I'd assume it's extremely rare for there to be this many items on a page. > > I'd > > guess that something like storing having BTScanPosData->items point to an > > in-line 4-16 BTS

Re: index prefetching

2025-04-02 Thread Andres Freund
Hi, Since the patch has needed a rebase since mid February and is in Waiting on Author since mid March, I think it'd be appropriate to mark this as Returned with Feedback for now? Or at least moved to the next CF? Greetings, Andres Freund

Re: bug when apply fast default mechanism for adding new column over domain with default value

2025-04-02 Thread Tender Wang
Tom Lane 于2025年4月2日周三 23:15写道: > Tender Wang writes: > > So let's add CommandCounterIncrement() after calling > StoreAttrMissingVal(). > > Pushed with minor editorialization. I thought for a bit about whether > the CCI call should be inside StoreAttrMissingVal; but its cohorts in > heap.c don't

RE: Fix slot synchronization with two_phase decoding enabled

2025-04-02 Thread Zhijie Hou (Fujitsu)
On Wed, Apr 2, 2025 at 3:45 PM Masahiko Sawada wrote: Hi, > > On Mon, Mar 31, 2025 at 4:3 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Thu, Mar 27, 2025 at 2:29 PM Amit Kapila wrote: > > > > > > > > On Tue, Mar 25, 2025 at 12:1 PM Amit Kapila > > > > > > wrote: > > > > > > > > On Tue, Mar 25, 2

Re: SQL function which allows to distinguish a server being in point in time recovery mode and an ordinary replica

2025-04-02 Thread Fujii Masao
On 2025/03/26 5:26, m.litsa...@postgrespro.ru wrote: Hi! I felt you might have missed attaching the test patches added at [1]. Well, the tests were written for the initial proposal which (after Michael's review and advices) has been fixed and updated. The original tests became not relevan

BTScanOpaqueData size slows down tests

2025-04-02 Thread Andres Freund
Hi, I was a bit annoyed at test times just now. Ran a profile on the entire regression tests in a cassert -Og build. Unsurprisingly most of the time is spent in AllocSetCheck(). I was mildly surprised to see how expensive the new compact attribute checks are. What I was more surprised to realize

Re: [PATCH] PGSERVICEFILE as part of a normal connection string

2025-04-02 Thread Ryo Kanbayashi
On Tue, Apr 1, 2025 at 6:26 AM Andrew Jackson wrote: > > Hi, > > I am working on a feature adjacent to the connection service functionality > and noticed some issues with the tests introduced in this thread. Basically > they incorrectly invoke the append perl function by passing multiple strings

Re: BTScanOpaqueData size slows down tests

2025-04-02 Thread Tom Lane
Andres Freund writes: > Looking at the size of BTScanOpaqueData I am less surprised: > /* size: 27352, cachelines: 428, members: 17 */ > allocating, zeroing and freeing 28kB of memory for every syscache miss, yea, > that's gonna hurt. Ouch! I had no idea it had gotten that big. Yeah, we

Re: Draft for basic NUMA observability

2025-04-02 Thread Bertrand Drouvot
Hi Jakub, On Wed, Apr 02, 2025 at 04:45:53PM +0200, Jakub Wartak wrote: > On Tue, Apr 1, 2025 at 5:13 PM Bertrand Drouvot > wrote: > > > > === 4 > > > > + for (i = 0; i < NBuffers; i++) > > + { > > + int blk2page = (int) i * >

Re: Draft for basic NUMA observability

2025-04-02 Thread Jakub Wartak
On Tue, Apr 1, 2025 at 5:13 PM Bertrand Drouvot wrote: > > Hi Jakub, > > On Tue, Apr 01, 2025 at 12:56:06PM +0200, Jakub Wartak wrote: > > On Mon, Mar 31, 2025 at 4:59 PM Bertrand Drouvot > > wrote: > > > > > Hi, > > > > Hi Bertrand, happy to see you back, thanks for review and here's v18 > > att

Re: Replace IN VALUES with ANY in WHERE clauses during optimization

2025-04-02 Thread Alena Rybakina
On 01.04.2025 17:23, Alena Rybakina wrote: Hi, Alexander! On 01.04.2025 15:07, Alexander Korotkov wrote: Hi, Alena! On Tue, Apr 1, 2025 at 2:11 AM Alena Rybakina wrote: 4.1) explain analyze SELECT ten FROM onek t WHERE unique1 IN ( VALUES (0), ((2 IN ( SELECT unique2 FROM one

Re: Making sslrootcert=system work on Windows psql

2025-04-02 Thread George MacKerron
> On 2 Apr 2025, at 14:39, George MacKerron wrote: > But happily, I don’t think we need to choose. Can’t we just use the Windows > system store if neither of the relevant environment variables is set? Thinking about this a little more, I guess the remaining concern is about people on Windows c

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-02 Thread jian he
> > > > i think your patch messed up with pg_constraint.conislocal. > > for example: > > > > CREATE TABLE parted (id bigint default 1,id_abc bigint) PARTITION BY LIST > > (id); > > alter TABLE parted add CONSTRAINT dummy_cons

Re: Make query cancellation keys longer

2025-04-02 Thread Heikki Linnakangas
On 01/04/2025 17:08, Heikki Linnakangas wrote: I think this is pretty much ready for commit. I will go over it one more time, and plan to push tomorrow. And committed, with minor a bunch more little cleanups. Thank you to everyone involved, in particular Jelte, Robert and Jacob! I read throug

Re: pg_restore documentation and --create/--single-transaction limitation

2025-04-02 Thread Ashutosh Bapat
On Mon, Mar 24, 2025 at 5:11 PM Ashutosh Bapat wrote: > > Hi All, > The pg_restore documentation usually mentions the pair of switches > which can not be used together. However, it does not mention that > --create and --single-transaction can not be used together. Here's a > patch fixing the same.

Re: Making sslrootcert=system work on Windows psql

2025-04-02 Thread George MacKerron
Daniel, Jacob: thanks. My feeling is that it would be a bit odd to prioritise the preservation of a secondary behaviour (users can customise what cert store is used via environment variables) over fixing the feature’s basic reason for existing (certificates will be validated against the system C

Re: TEMP_CONFIG vs test_aio

2025-04-02 Thread Andrew Dunstan
On 2025-04-01 Tu 5:34 PM, Andres Freund wrote: Hi, On 2025-04-01 17:08:49 -0400, Andrew Dunstan wrote: On 2025-04-01 Tu 4:17 PM, Andres Freund wrote: For one using PG_TEST_INITDB_EXTRA_OPTS would probably require changing the buildfarm code, because the buildfarm code filters out environment

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-04-02 Thread Andrew Dunstan
On 2025-04-02 We 7:45 AM, Mahendra Singh Thalor wrote: On Fri, 28 Mar 2025 at 20:13, Nathan Bossart wrote: > > On Fri, Mar 28, 2025 at 05:08:26PM +0530, Mahendra Singh Thalor wrote: > > Here, I am attaching updated patches for review. > > > > v04_001* has the changes for CREATE DATABASE/ROLE/U

Re: NOT ENFORCED constraint feature

2025-04-02 Thread Peter Eisentraut
On 28.03.25 14:27, Amul Sul wrote: On Fri, Mar 28, 2025 at 3:34 PM Ashutosh Bapat wrote: On Thu, Mar 27, 2025 at 6:25 PM Amul Sul wrote: I am not sure how to make such tests stable enough since the trigger name involves OIDs. In count check, I tried adjusting the join condition to ensure t

Re: Making sslrootcert=system work on Windows psql

2025-04-02 Thread Daniel Gustafsson
> On 1 Apr 2025, at 23:46, Jacob Champion > wrote: > On Tue, Apr 1, 2025 at 2:05 PM George MacKerron > wrote: >> I’ve recently been trying to get it more widely supported, with some success >> (details at end of this message). > > (Thank you!) +many >> I’m not a Windows or OpenSSL expert,

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-04-02 Thread Mahendra Singh Thalor
On Fri, 28 Mar 2025 at 20:13, Nathan Bossart wrote: > > On Fri, Mar 28, 2025 at 05:08:26PM +0530, Mahendra Singh Thalor wrote: > > Here, I am attaching updated patches for review. > > > > v04_001* has the changes for CREATE DATABASE/ROLE/USER and > > v04_002* has the changes into pg_upgrade to giv

fallocate() causes btrfs to never compress postgresql files

2025-04-02 Thread Dimitrios Apostolou
Hi, this is just a heads-up about files being generated by PostgreSQL 17 not being compressed by Btrfs, even when mounted with the force-compress mount option. I have this occuring aggressively when restoring a database via pg_restore. I think this is caused mdzeroextend() calling FileFallocate()

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-02 Thread Rushabh Lathia
Hi Alvaro, As discussed, I have added a few more tests related to pg_dump and pg_upgrade. Specifically: - Added INHERIT and PARTITION test cases to constraints.sql, keeping the objects unchanged so they can be used in the pg_upgrade test - Included additional tests in 002_pg_dump.pl for

Small optimization set tuple block/tableOid once

2025-04-02 Thread Ranier Vilela
Hi. Inspired by [1] There is an opportunity for optimization according to the commit: 2904324 " Due to splitting the block id into two 16 bit integers, BlockIdSet() is more expensive than one might think. Doing it once per returned tuple shows up a

Re: Test to dump and restore objects left behind by regression

2025-04-02 Thread Ashutosh Bapat
Hi Alvaro, On Wed, Apr 2, 2025 at 2:49 PM Alvaro Herrera wrote: > > On 2025-Apr-02, Ashutosh Bapat wrote: > > > I have closed the CF entry > > https://commitfest.postgresql.org/patch/4564/ committed. I will > > create another CF entry to park --no-statistics reversal change. That > > way, we wi

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-04-02 Thread Amit Kapila
On Wed, Apr 2, 2025 at 2:06 PM Bertrand Drouvot wrote: > > > As far PG17-v4-0001: > > > === 4 > > It looks like that check_slots_conflict_reason() is not called with > checks_active_slot > as argument. > > === 5 > > I think that we could remove the need for the drop_active_slot parameter in > dro

RE: Fix 035_standby_logical_decoding.pl race conditions

2025-04-02 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Bertrand, > You have not added any injection point for the above case. Isn't it > possible that if running_xact record is logged concurrently to the > pruning record, it should move the active slot on standby, and the > same failure should occur in this case as well? I considered that

Re: statistics import and export: another difference in dump/restore

2025-04-02 Thread Ashutosh Bapat
Hi, On Tue, Apr 1, 2025 at 12:54 PM Ashutosh Bapat wrote: > [1] > https://www.postgresql.org/message-id/caexhw5vvftcejh+uyznxmgsxofj_1xwi5aqhqfemqjgfmky...@mail.gmail.com > [2] https://cirrus-ci.com/task/5164175841820672 I have added this to PG 18 open items. It might be too early to call this

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-02 Thread Alvaro Herrera
On 2025-Mar-31, Robert Haas wrote: > It seems like a bad idea to make conislocal and coninhcount have > anything to do with whether the constraint is valid. We need those to > mean what they have traditionally meant just to make the correct > things happen when the constraint is dropped, either di

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-02 Thread Alvaro Herrera
Hello, thanks for the review. On 2025-Apr-02, jian he wrote: > the following are reviews of changes in pg_dump > on v6-0001-NOT-NULL-NOT-VALID.patch > > minor style tweak: > + "CASE WHEN NOT co.convalidated THEN co.oid" > + " ELSE NULL END AS notnull_invalidoid,\n" > > align with surrounding co

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-04-02 Thread Bertrand Drouvot
Hi Kuroda-san, On Wed, Apr 02, 2025 at 07:16:25AM +, Hayato Kuroda (Fujitsu) wrote: > Dear Amit, Bertrand, > > > You have not added any injection point for the above case. Isn't it > > possible that if running_xact record is logged concurrently to the > > pruning record, it should move the ac

Re: Change log level for notifying hot standby is waiting non-overflowed snapshot

2025-04-02 Thread torikoshia
On 2025-04-02 15:21, Fujii Masao wrote: On 2025/04/01 20:54, torikoshia wrote: Thank you for updating the patch! LGTM. I've pushed the patch. Thanks! Thanks a lot! I feel like changing the status to 'Ready for Committer', but since Nagata-san may have additional comments, I'm leaving it a

Re: Test to dump and restore objects left behind by regression

2025-04-02 Thread Ashutosh Bapat
On Tue, Apr 1, 2025 at 10:31 PM Alvaro Herrera wrote: > > On 2025-Apr-01, Ashutosh Bapat wrote: > > > Just today morning, I found something which looks like another bug in > > statistics dump/restore [1]. As Daniel has expressed upthread [2], we > > should go ahead and commit the test even if the

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-02 Thread Masahiko Sawada
On Mon, Mar 31, 2025 at 4:34 AM Zhijie Hou (Fujitsu) wrote: > > On Thu, Mar 27, 2025 at 2:29 PM Amit Kapila wrote: > > > > > On Tue, Mar 25, 2025 at 12:1 PM Amit Kapila > > wrote: > > > > > > On Tue, Mar 25, 2025 at 11:05 AM Zhijie Hou (Fujitsu) > > > wrote: > > > > > > > > Hi, > > > > > > > > W

Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning

2025-04-02 Thread Amit Langote
On Wed, Apr 2, 2025 at 1:58 AM Ashutosh Bapat wrote: > On Tue, Apr 1, 2025 at 1:32 PM Amit Langote wrote: > > > > I think David’s suggestion to use 64 as the fixed initial size is > > simpler and more predictable. Since list_length * 2 will always be >= > > 64 anyway, unless we expect clause coun

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-02 Thread Rushabh Lathia
> > > i think your patch messed up with pg_constraint.conislocal. > > for example: > > > > CREATE TABLE parted (id bigint default 1,id_abc bigint) PARTITION BY > LIST (id); > > alter TABLE parted add CONSTRAINT dummy_constr no

Re: Improve CRC32C performance on SSE4.2

2025-04-02 Thread John Naylor
On Tue, Apr 1, 2025 at 11:25 PM Nathan Bossart wrote: > > On Tue, Apr 01, 2025 at 05:33:02PM +0700, John Naylor wrote: > > On Thu, Mar 27, 2025 at 2:55 AM Devulapalli, Raghuveer > > wrote: > >> (2) Might be apt to rename pg_crc32c_sse42*.c to pg_crc32c_x86*.c since > >> they contain both sse42

Re: Statistics Import and Export

2025-04-02 Thread Jeff Davis
On Tue, 2025-04-01 at 22:21 -0500, Nathan Bossart wrote: > It certainly feels risky.  I was able to avoid executing the queries > twice > in all cases by saving the definition length in the TOC entry and > skipping > that many bytes the second time round. That feels like a better approach. >   Th