Re: AioCtl Shared Memory size fix

2025-09-15 Thread Michael Paquier
On Mon, Sep 15, 2025 at 02:06:03PM +0200, Matthias van de Meent wrote: > Presumably this was `PgAioHandle io_handles[]` at some point, but now > that it's a pointer it's a proper part of the struct's own size, and > should be treated as such for memory accounting. I would bet on a FLEXIBLE_ARRAY_M

Re: relfilenode statistics

2025-09-15 Thread Michael Paquier
On Thu, Mar 13, 2025 at 02:00:52PM +0500, Kirill Reshke wrote: > Hmm. While it is true that catalog lookups cannot be performed during > crash recovery, is it really necessary to save and retrieve statistics > after a crash? Yes, losing stats on crash is a *very* annoying thing. Having no stats f

Re: Incorrect logic in XLogNeedsFlush()

2025-09-15 Thread Michael Paquier
On Mon, Sep 15, 2025 at 03:02:36PM -0400, Melanie Plageman wrote: > As such, we should clarify the comment above the assert in your patch > to make it clear that the point of the assert is not to check the > logic in XLogFlush() but to protect against drift between > XLogNeedsFlush() and XLogFlush(

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

2025-09-15 Thread shveta malik
On Mon, Sep 15, 2025 at 6:17 PM Ajin Cherian wrote: > > On Wed, Sep 10, 2025 at 2:45 PM shveta malik wrote: > > > > On Tue, Sep 9, 2025 at 5:37 PM Ajin Cherian wrote: > > > > > > Attached v11 patch addressing the above comments. > > > > > > > Please find a few comments: > > > > 1) > > > > + Retr

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

2025-09-15 Thread Michael Paquier
On Thu, Sep 11, 2025 at 10:28:50AM -0500, Sami Imseih wrote: > > Only question is if we should avoid the extra portal hashtable lookup as > > well, or leave that for a separate patch. > > I prefer a separate thread for this, as it's an optimization of the > existing behavior. - por

Re: [PATCH] Add tests for Bitmapset

2025-09-15 Thread Michael Paquier
On Mon, Sep 15, 2025 at 03:56:30PM -0400, Greg Burd wrote: > Reworked as indicated, thanks for pointing out the anti-pattern I'd > missed. Hmm. Should we try to get something closer in shape to what we do for the SLRU tests, with one SQL function mapping to each C function we are testing? This c

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

2025-09-15 Thread Ajin Cherian
On Wed, Sep 10, 2025 at 2:45 PM shveta malik wrote: > > On Tue, Sep 9, 2025 at 5:37 PM Ajin Cherian wrote: > > > > Attached v11 patch addressing the above comments. > > > > Please find a few comments: > > 1) > > + Retry is done after 2 > + * sec wait. Exits early if promotion is triggered or cert

Re: Conflict detection for update_deleted in logical replication

2025-09-15 Thread shveta malik
On Tue, Sep 16, 2025 at 10:08 AM Zhijie Hou (Fujitsu) wrote: > > On Tuesday, September 16, 2025 11:54 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Monday, September 15, 2025 8:11 PM Amit Kapila > > wrote: > > > > > > On Mon, Sep 15, 2025 at 1:07 PM Zhijie Hou (Fujitsu) > > > wrote: > > > > > >

Re: Improving the names generated for indexes on expressions

2025-09-15 Thread David G. Johnston
On Monday, September 15, 2025, Tom Lane wrote: > In the wake of the discussion around bug #18959 [1], here is > a modest proposal for improving the names we pick for expression > indexes. The commit message explains the details, but this > example should give the flavor: > > postgres=# create ta

Re: Add support for specifying tables in pg_createsubscriber.

2025-09-15 Thread Shubham Khanna
On Tue, Sep 16, 2025 at 7:20 AM Peter Smith wrote: > > Hi Shubham, > > Here are some v7 review comments. > > == > Commit message > > 1. > This change eliminates the need to know in advance which publications exist > on the publisher, making the tool more user-friendly. Users can specify > publ

RE: Conflict detection for update_deleted in logical replication

2025-09-15 Thread Zhijie Hou (Fujitsu)
On Tuesday, September 16, 2025 11:54 AM Zhijie Hou (Fujitsu) wrote: > > On Monday, September 15, 2025 8:11 PM Amit Kapila > wrote: > > > > On Mon, Sep 15, 2025 at 1:07 PM Zhijie Hou (Fujitsu) > > wrote: > > > > > > Thanks, the changes look good to me. I have merged them in V75 patch. > > > > >

RE: [Patch] add new parameter to pg_replication_origin_session_setup

2025-09-15 Thread Hayato Kuroda (Fujitsu)
Dear Doruk, Thanks for updating the patch and sorry for being late. The new patch looks good to me. Best regards, Hayato Kuroda FUJITSU LIMITED

Re: --with-llvm on 32-bit platforms?

2025-09-15 Thread Thomas Munro
On Tue, Sep 16, 2025 at 12:05 PM Tom Lane wrote: > Thomas Munro writes: > > Hmm. We use TypeSizeT in generated IR for Datum, which is obviously > > incorrect in this configuration. > > Oh! Yeah, that is surely broken now. But it'd only explain problems > once you reach JIT-ed code, which I'd n

Re: Fix missing EvalPlanQual recheck for TID scans

2025-09-15 Thread Chao Li
> On Sep 15, 2025, at 19:23, David Rowley wrote: > > The attached v3-0001 is the updated v2 patch, and v3-0002 is a POC of > what I described above. Seems there is something to it as the > performance is better. It is a very contrived test case, however. > > create table empty(a int); > creat

Reword messages using "as" instead of "because"

2025-09-15 Thread Kyotaro Horiguchi
Hello. I noticed that the recent commit 0d48d393d46 introduced the following three messages: 4793> errdetail("Retention is stopped as the apply process is not advancing its xmin within the configured max_retention_duration of %u ms.", 4822> ? errdetail("Retention is re-enabled as the apply proce

Re: Reword messages using "as" instead of "because"

2025-09-15 Thread Amit Kapila
On Tue, Sep 16, 2025 at 8:17 AM Kyotaro Horiguchi wrote: > > I noticed that the recent commit 0d48d393d46 introduced the following > three messages: > > 4793> errdetail("Retention is stopped as the apply process is not advancing > its xmin within the configured max_retention_duration of %u ms.",

RE: Conflict detection for update_deleted in logical replication

2025-09-15 Thread Zhijie Hou (Fujitsu)
On Monday, September 15, 2025 8:11 PM Amit Kapila wrote: > > On Mon, Sep 15, 2025 at 1:07 PM Zhijie Hou (Fujitsu) > wrote: > > > > Thanks, the changes look good to me. I have merged them in V75 patch. > > > > Pushed. I see a BF which is not related with this commit but a previous commit > for

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

2025-09-15 Thread Andres Freund
Hi, On 2025-08-22 15:44:48 -0400, Andres Freund wrote: > The hardest part about this change is that everything kind of depends on each > other. The changes are large enough that they clearly can't just be committed > at once, but doing them over time risks [temporary] performance regressions. > >

Re: Add support for specifying tables in pg_createsubscriber.

2025-09-15 Thread Peter Smith
Hi Shubham, Here are some v7 review comments. == Commit message 1. This change eliminates the need to know in advance which publications exist on the publisher, making the tool more user-friendly. Users can specify publication names and the tool will handle both existing and new publications

Re: question about pending updates in pgstat_report_inj

2025-09-15 Thread Andres Freund
Hi, On September 15, 2025 6:11:34 PM EDT, Sami Imseih wrote: >I have been reviewing how custom cumulative statistics should update their >counters, and noticed something unexpected in the injection_points example >[0]. > >In pgstat_report_inj(), the code updates shared_stats directly: > >``` >sh

Re: PgStat_HashKey padding issue when passed by reference

2025-09-15 Thread Michael Paquier
On Mon, Sep 15, 2025 at 04:47:27PM -0500, Sami Imseih wrote: > Just to confirm, you are saying we are unlikely to ever add a new field > to the key. Is that correct? I would rather avoid that, yes. -- Michael signature.asc Description: PGP signature

Re: question about pending updates in pgstat_report_inj

2025-09-15 Thread Michael Paquier
On Mon, Sep 15, 2025 at 05:33:45PM -0500, Sami Imseih wrote: > I think it's better to use ->pending here, since this is referenced > as an example and most real-world cases will likely want to use > ->pending for performance reasons. Yes, it should use the pending entry. b757abefc041 did not get

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

2025-09-15 Thread Masahiko Sawada
On Mon, Sep 8, 2025 at 11:22 PM Amit Kapila wrote: > > On Mon, Sep 8, 2025 at 11:22 PM Masahiko Sawada wrote: > > > > On Fri, Sep 5, 2025 at 9:12 PM Amit Kapila wrote: > > > > > > On Sat, Sep 6, 2025 at 3:58 AM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, Sep 2, 2025 at 5:12 AM Shlok K

Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.

2025-09-15 Thread Tom Lane
I wrote: > I do agree that improving the names generated for expression indexes > would be useful independently of this. I propose setting this patch > aside for the time being, and I will go look into that, and then > if that gets accepted we can come back here and discuss how much > of a problem

Re: Resetting recovery target parameters in pg_createsubscriber

2025-09-15 Thread Michael Paquier
On Mon, Sep 15, 2025 at 10:29:47AM +0300, Alexander Korotkov wrote: > I went though this patches. > 1) I've removed the array of parameters. I see it was proposed by > Michael upthread. But I think his proposal came from the fact we walk > trough the parameters twice. But we end up walking troug

Re: Orphan page in _bt_split

2025-09-15 Thread Michael Paquier
On Sun, Sep 14, 2025 at 04:40:54PM +0300, Konstantin Knizhnik wrote: > On 13/09/2025 10:10 PM, Peter Geoghegan wrote: >> I think that _bt_split could easily be switched over to using 2 local >> PGAlignedBlock variables, removing its use of PageGetTempPage. I don't >> think that it is necessary to c

question about pending updates in pgstat_report_inj

2025-09-15 Thread Sami Imseih
I have been reviewing how custom cumulative statistics should update their counters, and noticed something unexpected in the injection_points example [0]. In pgstat_report_inj(), the code updates shared_stats directly: ``` shstatent = (PgStatShared_InjectionPoint *) entry_ref->shared_stats; state

Re: --with-llvm on 32-bit platforms?

2025-09-15 Thread Tom Lane
Dmitry Mityugov writes: > Tom Lane писал(а) 2025-09-15 23:21: >> Interesting, but again, how about a stack trace? > performing post-bootstrap initialization ... TRAP: failed Assert("(X & > 0x) == 0"), File: "../../../../src/include/postgres.h", > Line: 324, PID: 427452 > /home

Include extension path on pg_available_extensions

2025-09-15 Thread Matheus Alcantara
Hi all, On [1] it was mentioned that it could be a good idea to include the extension location when listening the available extensions on pg_available_extensions to make it clear to the user the location of an extension that Postgres is seeing based on the extension_control_path GUC. The attached

Re: Identifying function-lookup failures due to argument name mismatches

2025-09-15 Thread Robert Haas
On Mon, Sep 15, 2025 at 5:12 PM Tom Lane wrote: > Robert Haas writes: > > On Mon, Sep 15, 2025 at 4:01 PM Tom Lane wrote: > >> The primary error message is not varying, only the DETAIL/HINT, so > >> I find this concern pretty far-fetched. Also, I believe that the > >> case that the message inte

Re: --with-llvm on 32-bit platforms?

2025-09-15 Thread Tom Lane
Thomas Munro writes: >> Dmitry Mityugov writes: >>> I get a failure in Postgres executable early on startup. >> Interesting, but again, how about a stack trace? > Hmm. We use TypeSizeT in generated IR for Datum, which is obviously > incorrect in this configuration. Oh! Yeah, that is surely b

Re: AIX support

2025-09-15 Thread Bruce Momjian
On Thu, Sep 11, 2025 at 10:50:45AM +0530, Vamshikrishna T wrote: > We’d appreciate your review and feedback on the patch. Once we receive your > input, our next steps will be: > > 1. Address any comments or suggestions you may have. > > 2. Finalize the patch based on feedback. > > 3. Proceed wit

Re: --with-llvm on 32-bit platforms?

2025-09-15 Thread Thomas Munro
On Tue, Sep 16, 2025 at 8:22 AM Tom Lane wrote: > Dmitry Mityugov writes: > > What's interesting is that when I add the following (quick and dirty) > > assertion to DatumGetPointer on 32-bit Linux platforms, > > > DatumGetPointer(Datum X) > > { > > Assert((X & 0x) == 0);

Re: question about pending updates in pgstat_report_inj

2025-09-15 Thread Andres Freund
Hi, On 2025-09-15 18:21:22 -0400, Andres Freund wrote: > On September 15, 2025 6:11:34 PM EDT, Sami Imseih wrote: > >I have been reviewing how custom cumulative statistics should update their > >counters, and noticed something unexpected in the injection_points example > >[0]. > > > >In pgstat_re

Re: Proposal: GUC to control starting/stopping logical subscription workers

2025-09-15 Thread Bharath Rupireddy
Hi, On Tue, Sep 9, 2025 at 1:16 PM SATYANARAYANA NARLAPURAM wrote: > >> If I understand correctly, the end effect is similar to disabling all >> subscriptions. Why not just add ALTER SUBSCRIPTION ... DISABLE for all >> subscriptions in the failover work flow? Migration of logical >> replication s

Re: PgStat_HashKey padding issue when passed by reference

2025-09-15 Thread Sami Imseih
> > I don't see how this improves the situation, but will just make it more > > difficult to add a new field that requires padding in the future. > > > > If we are documenting either way, I rather that we just document the need > > to pass a key by reference, which is the pattern used in other area

Re: plan shape work

2025-09-15 Thread Tom Lane
Robert Haas writes: > Well, I was just bringing it up because you seemed to think that the > Replaces: line was not necessarily where we would have put it in a > green field. I am not sure about where we would have put it, but I > think in a green field we wouldn't have it at all, and I actually >

Re: Identifying function-lookup failures due to argument name mismatches

2025-09-15 Thread Robert Haas
On Mon, Sep 15, 2025 at 4:01 PM Tom Lane wrote: > The primary error message is not varying, only the DETAIL/HINT, so > I find this concern pretty far-fetched. Also, I believe that the > case that the message intends to help with is very common and so > it will save a lot of people time, more than

Re: plan shape work

2025-09-15 Thread Robert Haas
On Mon, Sep 15, 2025 at 3:43 PM Tom Lane wrote: > > Yes, I wondered if it should actually look more like this: > > Degenerate Scan on blah > > Degenerate Join on blah, blah, blah > > Degenerate Aggregate > > MinMaxAggregate Result > > So getting rid of Replaces: altogether. > > Yeah, that would be

Re: Vacuum statistics

2025-09-15 Thread Ilia Evdokimov
Hi Alena, Thanks for the work you’ve done. On 01.09.2025 22:13, Alena Rybakina wrote: I've rebased the patches to the current HEAD. Right now there is a bug: when I run a simple SELECT * FROM pg_stat_vacuum_database; psql crashes. The root cause is an incorrect zeroing of a local variable

Re: Identifying function-lookup failures due to argument name mismatches

2025-09-15 Thread Tom Lane
Robert Haas writes: > Some review of 0001: > + return errdetail("A procedure of that name exists, but it is not in > the search_path."); > Are you sure you want to expose this case in this way? From a security > point of view it makes me a bit nervous. I'm not seeing the security concern? An at

Re: Implement waiting for wal lsn replay: reloaded

2025-09-15 Thread Álvaro Herrera
On 2025-Sep-15, Alexander Korotkov wrote: > > It's LGTM. The same pattern is observed in VACUUM, EXPLAIN, and CREATE > > PUBLICATION - all use minimal grammar rules that produce generic > > option lists, with the actual interpretation done in their respective > > implementation files. The moderate

Re: --with-llvm on 32-bit platforms?

2025-09-15 Thread Dmitry Mityugov
Tom Lane писал(а) 2025-09-15 22:16: Dmitry Mityugov writes: Peter Eisentraut wrote 2025-09-15 09:36: It seems plausible that this is related to commit 2a600a93c7b "Make type Datum be 8 bytes wide everywhere.". I don't have any more insights than that. Thanks for the hint. I did git bisect,

Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.

2025-09-15 Thread Tom Lane
Robert Haas writes: > On Mon, Sep 15, 2025 at 12:15 PM Tom Lane wrote: >> So, how do we move forward? I'm perfectly willing to look into >> the derive-a-name-from-the-expression idea, but I think that'd >> best be done in a separate patch. > I'm not sure. To me, the munging of everything togeth

Re: [PATCH] Add tests for Bitmapset

2025-09-15 Thread Greg Burd
On Sep 15 2025, at 3:03 pm, Greg Burd wrote: > On Sep 15 2025, at 2:54 pm, Robert Haas wrote: > >> On Mon, Sep 15, 2025 at 2:00 PM Greg Burd wrote: >>> For reference radixtree has: >>> >>> coverage: HEAD >>> lines..: 98.3 >>> functions..: 97.2 >>> branches...: 89.4 >> >

Re: index prefetching

2025-09-15 Thread Tomas Vondra
On 9/15/25 17:12, Peter Geoghegan wrote: > On Mon, Sep 15, 2025 at 9:00 AM Tomas Vondra wrote: >> Yeah, this heuristics seems very effective in eliminating the regression >> (at least judging by the test results I've seen so far). Two or three >> question bother me about it, though: > > I more or

Re: plan shape work

2025-09-15 Thread Tom Lane
Robert Haas writes: > On Sun, Sep 14, 2025 at 7:42 PM Tom Lane wrote: >> ... But I'd really argue that from a user's standpoint this >> information is part of the fundamental plan structure and so it >> deserves more prominence. I'd lean to putting it first in the >> T_Result case, before the "O

Re: AioCtl Shared Memory size fix

2025-09-15 Thread Matthias van de Meent
On Mon, 15 Sept 2025 at 13:33, Madhukar . wrote: > > Hi Folks, > > While reviewing AIO code, we found an issue with AioCtlShmemSize function. > The function was not accounting for io_handles which is used post shared > memory alloc in AioShmemInit. Good catch. Presumably this was `PgAioHandle

Re: [PATCH] Add tests for Bitmapset

2025-09-15 Thread Greg Burd
On Sep 15 2025, at 2:54 pm, Robert Haas wrote: > On Mon, Sep 15, 2025 at 2:00 PM Greg Burd wrote: >> For reference radixtree has: >> >> coverage: HEAD >> lines..: 98.3 >> functions..: 97.2 >> branches...: 89.4 > > + /* Test negative member in bms_make_singleton */ > + error

Re: Incorrect logic in XLogNeedsFlush()

2025-09-15 Thread Melanie Plageman
On Mon, Sep 15, 2025 at 10:58 AM Melanie Plageman wrote: > > On Sun, Sep 14, 2025 at 4:10 AM Dilip Kumar wrote: > > > > Updated as per suggestion > > I like the idea of adding an assert to keep the two in sync. However, two > things > > 1) Since XLogNeedsFlush() refreshes LogwrtResult, is it pos

Re: Implement waiting for wal lsn replay: reloaded

2025-09-15 Thread Alexander Korotkov
Hi, Xuneng! On Sun, Sep 14, 2025 at 4:51 PM Xuneng Zhou wrote: > > On Sun, Sep 14, 2025 at 3:31 AM Alexander Korotkov > wrote: > > On Wed, Aug 27, 2025 at 6:54 PM Xuneng Zhou wrote: > > > I did a rebase for the patch to v8 and incorporated a few changes: > > > > > > 1) Updated documentation, a

Re: [PATCH] Better Performance for PostgreSQL with large INSERTs

2025-09-15 Thread Philipp Marek
Hi Kirill, Changing this constant will result in an overwhelming increase of memory consumption for instances that work with a large number of connections ( max_connections ~ 1e4) for zero benefit. No, it's not that bad. 1) With this being allocated in the bss segment, the RAM will only be

Re: [PATCH] Add tests for Bitmapset

2025-09-15 Thread Robert Haas
On Mon, Sep 15, 2025 at 2:00 PM Greg Burd wrote: > For reference radixtree has: > > coverage: HEAD > lines..: 98.3 > functions..: 97.2 > branches...: 89.4 + /* Test negative member in bms_make_singleton */ + error_caught = false; + PG_TRY(); + { + bms_make_singleton(-1); + } + PG_C

Re: POC: Parallel processing of indexes in autovacuum

2025-09-15 Thread Alexander Korotkov
Hi! On Tue, Aug 19, 2025 at 12:04 AM Masahiko Sawada wrote: > > On Mon, Aug 18, 2025 at 1:31 AM Daniil Davydov <3daniss...@gmail.com> wrote: > > > > > > On Fri, Aug 15, 2025 at 3:41 AM Masahiko Sawada wrote: > > > > > > > > 2. when an autovacuum worker (not parallel vacuum worker) who uses > > >

Re: index prefetching

2025-09-15 Thread Peter Geoghegan
On Mon, Sep 15, 2025 at 9:00 AM Tomas Vondra wrote: > Yeah, this heuristics seems very effective in eliminating the regression > (at least judging by the test results I've seen so far). Two or three > question bother me about it, though: I more or less agree with all of your concerns about the IN

Re: Proposal: GUC to control starting/stopping logical subscription workers

2025-09-15 Thread SATYANARAYANA NARLAPURAM
Hi Euler, On Wed, Sep 10, 2025 at 5:11 PM Euler Taveira wrote: > On Wed, Aug 13, 2025, at 12:40 AM, SATYANARAYANA NARLAPURAM wrote: > > I couldn't find a previous discussion on a new GUC to globally enable > > or disable logical subscription workers at the instance level. So > > starting a new t

Re: RFC: extensible planner state

2025-09-15 Thread Robert Haas
On Fri, Sep 12, 2025 at 6:34 PM Melanie Plageman wrote: > You're missing a word above -- like "modules to store their own" > This path does not reflect where you put the file Thanks. > Storing a uint32 in a signed int that could be 32-bit stuck out to me. "git grep pg_nextpower2_32" finds examp

Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.

2025-09-15 Thread Robert Haas
On Mon, Sep 15, 2025 at 12:15 PM Tom Lane wrote: > Thanks for weighing in! Opinions are good, and I'm by no means set > on doing what is in my submitted patch. However, I'm failing to > extract a clearly-better alternative from your message. Oh, you wanted an *actionable* opinion? :-) > I thin

Re: Identifying function-lookup failures due to argument name mismatches

2025-09-15 Thread Robert Haas
Some review of 0001: + return errdetail("A procedure of that name exists, but it is not in the search_path."); Are you sure you want to expose this case in this way? From a security point of view it makes me a bit nervous. If we're going to keep it, it should have a test. Even from a non-security

Re: [PATCH] Add tests for Bitmapset

2025-09-15 Thread Greg Burd
On Sep 13 2025, at 10:23 am, Greg Burd wrote: > > Sawada-san, Michael, > > Thank you both for the push to measure.  Before the patch as it stands > now the > coverage for src/backend/nodes/bitmapset.c is 63.5% and after it is > 66.5%.  Not > an amazing difference, but something.  I guess I ex

Re: Fix missing EvalPlanQual recheck for TID scans

2025-09-15 Thread Sophie Alpert
On Mon, Sep 15, 2025 at 4:23 AM, David Rowley wrote: > For the v2 patch, I've hacked on that a bit and stripped out the > trss_boundsInitialized stuff and just make it so we recalculate the > TID List/Range on every recheck. I also added another isolation test > permutation to have s1 rollback an

Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue

2025-09-15 Thread Masahiko Sawada
On Sat, Sep 6, 2025 at 7:15 AM Matheus Alcantara wrote: > > On Fri Sep 5, 2025 at 9:56 AM -03, Arseniy Mukhin wrote: > >> Ok, I agree that that this may happen but I don't see this as a common > >> case to fix the issue based on this behaviour. I think that we check the > >> transaction status als

Changing on SGML Notes

2025-09-15 Thread Marcos Pegoraro
There are lots of places where some notes are added to documentation related to some changes on a specific version. ... default behavior has changed in PostgreSQL 9.0 ... Before PostgreSQL 10, it was necessary to ... ... Beginning with PostgreSQL 16 ... But the problem is that sometimes that note

Re: Incorrect logic in XLogNeedsFlush()

2025-09-15 Thread Melanie Plageman
On Sun, Sep 14, 2025 at 4:10 AM Dilip Kumar wrote: > > On Fri, Sep 12, 2025 at 10:02 PM Jeff Davis wrote: > > > Assuming I'm right so far, then I agree with changing the test in > > XLogNeedsFlush() to !XLogInsertAllowed(), as the patch does. > > > > The comment in the patch is describing what's

Clarification on DROP OWNED BY command in PG18

2025-09-15 Thread DIPESH DHAMELIYA
Hello everyone,   Starting from commit 98fc31d (PG18 only), there is a new behaviour for DROP OWNED BY command where it deletes entries from pg_auth_members (including entries with ADMIN option). This change can cause a user/role to lose the ability to DROP the role for which DROP OWNED BY was

Re: Make COPY format extendable: Extract COPY TO format implementations

2025-09-15 Thread Masahiko Sawada
On Thu, Sep 11, 2025 at 5:07 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Thu, 11 Sep 2025 13:41:26 -0700, > Masahiko Sawada wrote: > > > I think we can use a local variable of CopyFormatOptions and memcpy it > > to t

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

2025-09-15 Thread Masahiko Sawada
On Sun, Sep 14, 2025 at 7:55 PM Amit Kapila wrote: > > On Fri, Sep 12, 2025 at 11:18 PM Masahiko Sawada > wrote: > > > > On Thu, Sep 11, 2025 at 9:08 PM Amit Kapila wrote: > > > > > > > > For the shutdown sequence, can't we think of resetting effective_wal > > > after a restart? > > > > Does it

Re: plan shape work

2025-09-15 Thread Robert Haas
Thanks for the review. Comments to which I don't respond below are duly noted. On Sun, Sep 14, 2025 at 7:42 PM Tom Lane wrote: > * I think your placement of the show_result_replacement_info call > site suffers from add-at-the-end syndrome. It should certainly go > before the show_instrumentation

Re: --with-llvm on 32-bit platforms?

2025-09-15 Thread Dmitry Mityugov
Peter Eisentraut wrote 2025-09-15 09:36: On 05.09.25 13:32, Dmitry Mityugov wrote: Dmitry Mityugov писал(а) 2025-09-05 11:11: Dmitry Mityugov писал(а) 2025-09-05 00:32: It seems that when I add --with-llvm flag to ./configure on any 32- bit platform that I have (Debian 12, Debian 13, Arch Linu

Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.

2025-09-15 Thread Tom Lane
Robert Haas writes: > I'll take the risk of expressing an opinion: I think we should do > something about this problem, but I'm not all that convinced we should > do this particular thing. Thanks for weighing in! Opinions are good, and I'm by no means set on doing what is in my submitted patch.

[PATCH] Better Performance for PostgreSQL with large INSERTs

2025-09-15 Thread Philipp Marek
Sometimes, storing documents (eg. PDFs) in a database is much easier than using a separate storage (like S3, NFS, etc.). (Because of issues like backup integrity, availability, service dependencies, access rights, encryption of data, etc..) With this patch: ```diff diff --git i/src/backend/lib

Re: POC: make mxidoff 64 bits

2025-09-15 Thread Maxim Orlov
On Sat, 13 Sept 2025 at 16:34, Alexander Korotkov wrote: > > Therefore, we can change from each 8 of 32-bit multixact offsets > (takes 32-bytes) to one 64-bit offset + 7 of 24-bit offset increments > (takes 29-bytes). The actual multixact offsets can be calculated at > the fly, overhead shouldn'

Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.

2025-09-15 Thread Robert Haas
On Fri, Aug 29, 2025 at 11:56 AM Tom Lane wrote: > I'm surprised that this didn't break sooner, TBH, since it touches > so many test cases. I'd kind of like to either get it pushed or > write it off as a bad idea. Does anyone else care to comment? I'll take the risk of expressing an opinion: I

Newly created replication slot may be invalidated by checkpoint

2025-09-15 Thread suyu.cmj
Hi, all, I'd like to discuss an issue about getting the minimal restart_lsn for WAL segments removal during checkpoint. The discussion [1] fixed the issue with the unexpected removal of old WAL segments after checkpoint, followed by an immediate restart. The commit 2090edc6f32f652a2c introduced

Re: expand virtual generated columns in get_relation_constraints()

2025-09-15 Thread Peter Eisentraut
On 11.09.25 04:16, Richard Guo wrote: On Wed, Sep 3, 2025 at 11:05 PM Peter Eisentraut wrote: We (I) missed expanding virtual generated columns in get_relation_constraints() in plancat.c. That way, some opportunities for constraint exclusion will be missed if a constraint contains virtual gene

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-09-15 Thread Natalya Aksman
Awesome, thank you for the quick turnaround. Natalya Aksman On Sat, Sep 13, 2025 at 9:03 PM Peter Geoghegan wrote: > On Wed, Sep 10, 2025 at 3:41 PM Natalya Aksman > wrote: > > Fantastic, the patch is working, it fixes our issue! > > I pushed this patch just now. > > Thanks > -- > Peter Geoghe

Re: [PATCH] Better Performance for PostgreSQL with large INSERTs

2025-09-15 Thread Kirill Reshke
Hi! On Mon, 15 Sept 2025 at 18:16, Philipp Marek wrote: > > Sometimes, storing documents (eg. PDFs) in a database > is much easier than using a separate storage (like S3, NFS, etc.). > > (Because of issues like backup integrity, availability, > service dependencies, access rights, encryption of d

Re: Conflict detection for update_deleted in logical replication

2025-09-15 Thread Amit Kapila
On Mon, Sep 15, 2025 at 1:07 PM Zhijie Hou (Fujitsu) wrote: > > Thanks, the changes look good to me. I have merged them in V75 patch. > Pushed. I see a BF which is not related with this commit but a previous commit for the work in this thread. See LOGs [1]: regress_log_035_conflicts

Re: let ALTER TABLE DROP COLUMN drop whole-row referenced object

2025-09-15 Thread jian he
On Mon, Sep 15, 2025 at 11:48 AM Chao Li wrote: > > 3 - 0001 > ``` > + } > + } > + ReleaseSysCache(indexTuple); > + } > + CommandCounterIncrement(); > ``` > > Why CommandCounterIncrement() is needed? In current code, there is a > CommandCounterIncrement() after CatalogTupleUpdate(), which is nece

AioCtl Shared Memory size fix

2025-09-15 Thread Madhukar .
Hi Folks, While reviewing AIO code, we found an issue with AioCtlShmemSize function. The function was not accounting for io_handles which is used post shared memory alloc in AioShmemInit. Please find a patch to account for io_handles member of PgAioCtl. The patch uses sizeof(PgAioCtl) instead of

RE: Conflict detection for update_deleted in logical replication

2025-09-15 Thread Zhijie Hou (Fujitsu)
On Monday, September 15, 2025 12:52 PM Amit Kapila wrote: > > On Fri, Sep 12, 2025 at 3:39 PM Zhijie Hou (Fujitsu) > wrote: > > > > Here is the V74 patch which addressed all comments. > > > > + ereport(LOG, > + errmsg("logical replication worker for subscription \"%s\" will > resume retaining

Re: [PATCH] Generate random dates/times in a specified range

2025-09-15 Thread Damien Clochard
Le 09.09.2025 12:00, Dean Rasheed a écrit : On Mon, 8 Sept 2025 at 13:40, Dean Rasheed wrote: I think this is now committable, so if there are no objections, I'll push this shortly. Committed. Thanks a lot for your help on this ! -- Damien Clochard

Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt

2025-09-15 Thread Peter Eisentraut
On 12.09.25 15:49, Tom Lane wrote: Peter Eisentraut writes: I propose the attached patch to fix this. I think this restores the original meaning better. I'm okay with this wording change, but I would stay with ERRCODE_FEATURE_NOT_SUPPORTED rather than calling this a "syntax error". It's not

Re: Fix missing EvalPlanQual recheck for TID scans

2025-09-15 Thread Chao Li
> On Sep 15, 2025, at 16:12, Chao Li wrote: > > > > Then the solution of TidListEval() is correct, and the only issue is > repeatedly calling TidListEval() on every recheck. > I want to add that, the issue of repeatedly calling TidListEval() is not a problem of this patch. I am okay if y

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-09-15 Thread Chao Li
Overall LGTM. Just a few small comments: > On Sep 12, 2025, at 17:53, Tatsuo Ishii wrote: > > > Comments/suggestions are welcome. > -- > Tatsuo Ishii > SRA OSS K.K. > English: http://www.sraoss.co.jp/index_en/ > Japanese:http://www.sraoss.co.jp > 1 - 0001 ``` --- a/src/backend/parser/parse_f

Re: allow benign typedef redefinitions (C11)

2025-09-15 Thread Peter Eisentraut
On 10.09.25 14:08, Chao Li wrote: On Sep 10, 2025, at 14:28, Peter Eisentraut wrote: Thanks.  New patch set attached. redeclaration-of-typedef-yyscan_t.patch>against-repeat-typedefs.patch>handling-in-header-file.patch>declarations-to-use-typede.patch>type.patch> v5 looks good to me. Committ

Re: someone else to do the list of acknowledgments

2025-09-15 Thread Dmitry Yurichev
On 9/10/25 19:30, Daniel Gustafsson wrote: There are a few first-names-only that need to be verified, IME they resolve to a name already on the list. Andrew Dmitry Felix Regarding Dmitry. If we are talking about this commit c70b6db34ffeab48beef1fb4ce61bcad3772b8dd, then this is Dmitry Yuriche

Re: [PATCH] Refactor bytea_sortsupport(), take two

2025-09-15 Thread Aleksander Alekseev
Hi John, Thanks for the review. > Don't these types disallow NUL bytes regardless of locale / character set? You are right, they do. Here is the patch v3 with corrected comments. -- Best regards, Aleksander Alekseev From f722f62073c232b9b928afd2797317a91369fc63 Mon Sep 17 00:00:00 2001 From: A

Re: proposal: schema variables

2025-09-15 Thread Jim Jones
Hi On 9/13/25 11:28, Pavel Stehule wrote: > > minor change (after private talk with Jim Jones) > After another pass, there are a few additional tests that should be included in this patch: == Additional tests for GRANT x ON VARIABLE == == We wanna

Re: Fix missing EvalPlanQual recheck for TID scans

2025-09-15 Thread Chao Li
> On Sep 15, 2025, at 14:27, David Rowley wrote: > > > I think you've only read the first sentence in that paragraph. Please > read the entire paragraph. You'll see it goes on to explain "it will > attempt to apply its operation to the updated version of the row". > Ah… Sorry for missing th

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-09-15 Thread Alexander Korotkov
Hi Dmitry. On Mon, Sep 1, 2025 at 2:04 PM Dmitry Koval wrote: > Hi! > Thank you for the notes and patch! Some additional notes from me. 1) src/backend/parser/parse_utilcmd.c includes are not alphabetically ordered here +#include "partitioning/partdesc.h" +#include "partitioning/partbounds.h" 2

RE: Conflict detection for update_deleted in logical replication

2025-09-15 Thread Zhijie Hou (Fujitsu)
On Monday, September 15, 2025 12:55 PM shveta malik wrote: > > One concern: > > if (should_stop_conflict_info_retention(rdt_data)) > + { > + /* > + * Stop retention if not yet. Otherwise, reset to the initial phase to > + * retry all phases. This is required to recalculate the current wait >