Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-18 Thread Bertrand Drouvot
Hi, On Tue, Nov 18, 2025 at 06:57:33PM +0100, Álvaro Herrera wrote: > On 2025-Nov-18, Bertrand Drouvot wrote: > > The patch makes use of it because it exists. I agree that we could > > also remove it (for the reasons you mentioned above), I'll do that. > > RegProcedure actually predates all of ou

Re: Reorganize GUC structs

2025-11-18 Thread Peter Eisentraut
On 14.11.25 12:00, Álvaro Herrera wrote: On 2025-Nov-12, Peter Eisentraut wrote: Well, that's the one, but the code actually looks like this now: while ((i = bms_next_member(atts, i)) >= 0) { attcnt++; if (attcnt > 1) appendStringInfoString(&attsbuf, _(

Re: Add mode column to pg_stat_progress_vacuum

2025-11-18 Thread Maciek Sakrejda
On Tue, Nov 18, 2025, 21:10 Shinya Kato wrote: > On Wed, Nov 19, 2025 at 9:04 AM Masahiko Sawada > > > Fixed, but I have a comment. I noticed > minor wording inconsistencies, > > > e.g., 'started' vs. 'initiated' and 'due to' vs. 'because of'. Should > > > I unify these terms? > > > > +1 > > It

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-18 Thread Jim Jones
Hi Chao On 19/11/2025 04:13, Chao Li wrote: > 1. Do we need to perform some privilege check? I just did a test: > ``` > evantest=> \c > You are now connected to database "evantest" as user "evan". > evantest=> select pg_get_tablespace_ddl('pg_default'); >pg_get_tablespace_ddl > -

Re: Extended Statistics set/restore/clear functions.

2025-11-18 Thread jian he
On Tue, Nov 18, 2025 at 4:52 PM Corey Huinker wrote: > v15: > > - catches duplicate object keys cited above > - enforces attnum ordering (ascending positive numbers followed by descending > negative numbers, no zeros allowed), which means we get duplicate attnum > detection for free > - attnum v

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

2025-11-18 Thread Nazir Bilal Yavuz
Hi, On Wed, 19 Nov 2025 at 00:17, Melanie Plageman 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. And in

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2025-11-18 Thread David Geier
On 22.10.2025 15:32, Andres Freund wrote: > Hi, > > On 2025-09-01 12:36:24 +0200, David Geier wrote: >>> Open questions I have: >>> - Could we rely on checking whether the TSC timesource is invariant (via >>> CPUID), instead of relying on Linux choosing it as a clocksource? >> >> Why do you want t

Re: Row pattern recognition

2025-11-18 Thread Tatsuo Ishii
> 4 - 0001 - parsenodes.h > ``` > + /* Row Pattern AFTER MACH SKIP clause */ > ``` > > Typo: MACH -> MATCH Thanks for pointing it out. Will fix. Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2025-11-18 Thread David Geier
On 20.10.2025 21:59, Robert Haas wrote: > On Sun, Oct 19, 2025 at 2:16 PM Álvaro Herrera wrote: >> If I were >> a consultant trying to understand a customer's system, I would have to >> ask them to run it twice just in case 'fast' is supported, and I don't >> think that's very helpful. > > Big

Re: Row pattern recognition

2025-11-18 Thread Tatsuo Ishii
> 2 - 0001 - gram.y > ``` > opt_row_pattern_initial_or_seek: > INITIAL { $$ = true; } > | SEEK > { > ereport(ERROR, > > (err

Re: Proposal: Conflict log history table for Logical Replication

2025-11-18 Thread Peter Smith
Hi Dilip, FYI, patch v4-0003 (docs) needs rebasing due to ada78cd. == Kind Regards, Peter Smith. Fujitsu Australia

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

2025-11-18 Thread shveta malik
On Wed, Nov 12, 2025 at 1:54 PM Ajin Cherian wrote: > > > Attaching patch v23 addressing these comments. > Thanks for the patch. I observed that if the API is taking a nap in between slot sync cycles and a promotion is triggered during that time, the promotion has to wait for the entire nap peri

Re: Row pattern recognition

2025-11-18 Thread Tatsuo Ishii
> On 18/11/2025 06:03, Chao Li wrote: >> 1 - 0001 - kwlist.h >> ``` >> +PG_KEYWORD("define", DEFINE, RESERVED_KEYWORD, BARE_LABEL) >> ``` >> >> Why do we add “define” as a reserved keyword? From the SQL example >> you put in 0006: >> ``` >> >> SELECT company, tdate, price, >> first_value(price)

Re: Proposal: Conflict log history table for Logical Replication

2025-11-18 Thread Peter Smith
Here are some comments for the patch v4-0002. == GENERAL 1. The patch should include test cases: - to confirm an error happens when attempting to publish clt - to confirm \dt+ clt is not showing the ALL TABLES publication - to confirm that SQL function pg_relation_is_publishable givesthe exp

Re: Issue with logical replication slot during switchover

2025-11-18 Thread Amit Kapila
On Wed, Nov 19, 2025 at 6:26 AM Masahiko Sawada wrote: > > On Tue, Nov 18, 2025 at 1:30 AM Amit Kapila wrote: > > > > On Sat, Nov 15, 2025 at 4:02 AM Masahiko Sawada > > wrote: > > > > > > On Fri, Nov 14, 2025 at 2:39 AM Amit Kapila > > > wrote: > > > > > > > > > > > > The point is quite fund

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

2025-11-18 Thread Fujii Masao
On Wed, Nov 19, 2025 at 12:59 AM Fujii Masao wrote: > > Hi, > > In logical replication, any GUC settings specified in the CONNECTION clause of > CREATE SUBSCRIPTION are currently ignored. For example: > > CREATE SUBSCRIPTION mysub > CONNECTION 'options=''-c wal_sender_timeout=1

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

2025-11-18 Thread Amit Kapila
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 continuous slot updates, enabling seamless failover and supporting high

Re: Post-release followup: pg_add_size_overflow()

2025-11-18 Thread Michael Paquier
On Tue, Nov 18, 2025 at 12:09:17PM -0800, Jacob Champion wrote: > The fix for CVE-2025-12818 introduced a few identical copies of size_t > addition, and now that we've released, I'd like to pull those back > into shape. Yes, I've noticed these TODOs in the final patch. Thanks for the follow-up cl

Re: Add mode column to pg_stat_progress_vacuum

2025-11-18 Thread Shinya Kato
On Wed, Nov 19, 2025 at 9:04 AM Masahiko Sawada > > Fixed, but I have a comment. I noticed minor wording inconsistencies, > > e.g., 'started' vs. 'initiated' and 'due to' vs. 'because of'. Should > > I unify these terms? > > +1 It seems the inconsistency between 'started' and 'initiated' has not

Re: nbtree VACUUM's REDO routine doesn't clear page's VACUUM cycle ID

2025-11-18 Thread Andrey Borodin
> On 18 Nov 2025, at 23:54, Peter Geoghegan wrote: > > Are you arguing that the xl_btree_split record should include the cycleid? Yes. > I see that systems that are built on this architecture do something > along these lines: > https://github.com/neondatabase/postgres/commit/a9b92820c5d14dbf

Re: Row pattern recognition

2025-11-18 Thread Chao Li
> 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. 5 - 0002 - parse_cla

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

2025-11-18 Thread Xuneng Zhou
Hi Michael, On Sat, Nov 8, 2025 at 7:03 AM Michael Paquier wrote: > > On Fri, Nov 07, 2025 at 09:48:23PM +0800, Xuneng Zhou wrote: > > Now that the LSN-waiting infrastructure (3b4e53a) and WAL replay > > wake-up calls (447aae1) are in place, this patch has been updated to > > make use of them. >

Re: RFC: Logging plan of the running query

2025-11-18 Thread torikoshia
On 2025-11-19 05:19, Akshat Jaimini wrote: Thanks for your review! Hi, I have a question: In src/backend/executor/execMain.c: ``` + SetCurrentQueryDesc(oldQueryDesc); + + /* + * Ensure LogQueryPlanPending is initialized in case there was no time for +* logging the plan.

Re: Why is_admin_of_role() use ROLERECURSE_MEMBERS rather than ROLERECURSE_PRIVS?

2025-11-18 Thread cca5507
Hi, According to the comment in check_role_grantor(): /* * Otherwise, the grantor must either have ADMIN OPTION on the role or * inherit the privileges of a role which does. In the former case, * record the grantor as the current user; in the

Re: PRI?64 vs Visual Studio (2022)

2025-11-18 Thread Tom Lane
Thomas Munro writes: > Perhaps meson/configure should do a po -> mo -> gettext() check with a > canned test message? That'd also make sure your msgfmt and libintl > are compatible, something I worried about when I wrote about musl > recently. No, I don't think that's a good approach. That is te

Re: Optimize LISTEN/NOTIFY

2025-11-18 Thread Joel Jacobson
On Tue, Nov 18, 2025, at 09:15, Chao Li wrote: > Thanks for the continuous effort on this patch. Finally, I got some > time, after revisiting v28 throughoutly, I think it’s much better now. Thanks for reviewing. > Just got 2 more comments: > ... > DSA is created and pinned by the first backend

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-18 Thread Chao Li
Hi Manni, I just reviewed v13 again, and still got a couple of comments: > On Nov 18, 2025, at 22:15, Manni Wood wrote: > > > 1. Do we need to perform some privilege check? I just did a test: ``` evantest=> \c You are now connected to database "evantest" as user "evan". evantest=> select pg_

Re: transformJsonFuncExpr pathspec cache lookup failed

2025-11-18 Thread jian he
On Fri, Nov 7, 2025 at 2:26 PM Kirill Reshke wrote: > > Hi! > I tried your fix and this indeed fixes an issue. Two minor comments: > > First, > in the `src/backend/parser/parse_expr.c` fil there are multiple > examples of working with `coerce_to_target_type`, they all share > different coding prac

Re: PRI?64 vs Visual Studio (2022)

2025-11-18 Thread Thomas Munro
On Wed, Nov 19, 2025 at 3:28 PM Tom Lane wrote: > I agree that starting to rely on PRI?64 in translatable strings > is raising the bar a good deal, so maybe it's time to do something > about that. Perhaps meson/configure should do a po -> mo -> gettext() check with a canned test message? That'd

Re: [PATCH] Add pg_get_subscription_ddl() function

2025-11-18 Thread Peter Smith
Hi Vaibhav. Thanks for the updates. I don't have any new review comments for v8 -- just a couple of the same ones as before. On Wed, Nov 19, 2025 at 12:00 AM vDalvi wrote: > > Thanks Peter for the close look. > >> 1. >> >> + * The status or value of the options 'create_slot' and 'copy_data' not

Re: [PATCH] Fix orphaned backend processes on Windows using Job Objects

2025-11-18 Thread Bryan Green
On 11/6/2025 8:39 PM, Thomas Munro wrote: > On Fri, Nov 7, 2025 at 3:13 AM Bryan Green wrote: >> The reason to still do this patch and clean up the handle inheritance >> mess is that there are states (suspended state, infinite loop, spinlock >> hold, whatever) that a process can be in that keeps i

Re: Fix typos in ExecChooseHashTableSize()

2025-11-18 Thread Tender Wang
Richard Guo 于2025年11月19日周三 10:18写道: > On Tue, Nov 18, 2025 at 6:30 PM Tender Wang wrote: > > In the first comment, "wont't" should be "won't". > > In the second comment, "overlow" should be "overflow". > > The first one was fixed by Álvaro in another commit. I've just pushed > a fix for the s

Re: make -C src/test/isolation failure in index-killtuples due to btree_gist

2025-11-18 Thread Michael Paquier
On Tue, Nov 18, 2025 at 09:00:39AM -0500, Andres Freund wrote: > On 2025-11-18 08:40:46 +0900, Michael Paquier wrote: >> By the way, an extra argument in favor of an isolation test here: the >> proposed TAP tests only wants to make sure that replay is able to >> finish on a standby, we don't query

Re: PRI?64 vs Visual Studio (2022)

2025-11-18 Thread Tom Lane
Thomas Munro writes: > We don't even test -Dnls on the Windows CI task, so the fact that it > passes there doesn't mean much (if our tests would even pick up > expansion failure, not sure). We should probably do > something about that and/or its absence from the build farm. We're > effectively

Re: Use merge-based matching for MCVs in eqjoinsel

2025-11-18 Thread Tom Lane
I wrote: > Thinking a bit harder, we are comparing these costs: > [ theoretical arguments trimmed ] I spent some effort on actually measuring timings of the v6 patch, and concluded that this is all splitting hairs that we don't need to split. The actual crossover between hash-loses and hash-wins

Re: Fix typos in ExecChooseHashTableSize()

2025-11-18 Thread Richard Guo
On Tue, Nov 18, 2025 at 6:30 PM Tender Wang wrote: > In the first comment, "wont't" should be "won't". > In the second comment, "overlow" should be "overflow". The first one was fixed by Álvaro in another commit. I've just pushed a fix for the second one. - Richard

Re: PRI?64 vs Visual Studio (2022)

2025-11-18 Thread Thomas Munro
On Wed, Apr 2, 2025 at 2:04 AM Peter Eisentraut wrote: > On 31.03.25 08:28, Kyotaro Horiguchi wrote: > > I hadn’t paid much attention to this before, but I happened to check > > how this behaves on Windows, and it seems that with VS2022, PRId64 > > expands to "%lld". As a result, I suspect the get

Re: Checkpointer write combining

2025-11-18 Thread Chao Li
> On Nov 19, 2025, at 10:00, Chao Li wrote: > > > >> On Nov 19, 2025, at 02:49, Melanie Plageman >> wrote: >> >> I no longer remember why I made that patch WIP, so I've removed that >> designation. > > I just reviewed 0007. It removes the second parameter "bool > skip_recently_used” fr

Re: Checkpointer write combining

2025-11-18 Thread Chao Li
> On Nov 19, 2025, at 02:49, Melanie Plageman wrote: > > I no longer remember why I made that patch WIP, so I've removed that > designation. I just reviewed 0007. It removes the second parameter "bool skip_recently_used” from SyncOneBuffer. The function is static and is only called in one p

Re: Eagerly evict bulkwrite strategy ring

2025-11-18 Thread Chao Li
Hi Melanie, I remember I ever reviewed this patch. But when I revisit v7, I just got a confusion to clarify. > On Nov 19, 2025, at 03:13, Melanie Plageman wrote: > > On Mon, Nov 3, 2025 at 3:06 PM Melanie Plageman > wrote: >> >> I found an incorrect assert in CleanVictimBuffer() that was tri

Re: Proposal: Conflict log history table for Logical Replication

2025-11-18 Thread Peter Smith
Hi Dilip. I started to look at this thread. Here are some comments for patch v4-0001. = GENERAL 1. There's some inconsistency in how this new table is called at different times : a) "conflict table" b) "conflict log table" c) "conflict log history table" d) "conflict history" My preference

Re: Proposal for enabling auto-vectorization for checksum calculations

2025-11-18 Thread Andrew Kim
On Mon, Nov 17, 2025 at 8:48 PM John Naylor wrote: > > On Tue, Nov 18, 2025 at 10:32 AM Andrew Kim wrote: > > > I've double-checked everything after applying the v9 checksum patches > > and updating pg_filedump accordingly. > > Following your suggestion, I removed the checksum_impl.h include and

Re: Post-release followup: pg_add_size_overflow()

2025-11-18 Thread Chao Li
Hi, Jacob, I just reviewed the patch. Overall looks solid to me. Just a small comments: > On Nov 19, 2025, at 04:09, Jacob Champion > wrote: > > Hi all, > > The fix for CVE-2025-12818 introduced a few identical copies of size_t > addition, and now that we've released, I'd like to pull those b

Re: Add a berief general comment on BTScanInsertData's nextkey and backward

2025-11-18 Thread Peter Geoghegan
On Tue, Nov 18, 2025 at 2:28 AM Yugo Nagata wrote: > I've attached a patch that adds the following comment: > > + * nextkey determines how the scankey's boundary is interpreted, and backward > + * indicates a backward scan. See comments in _bt_first for a more detailed > + * explanation of these

Re: Issue with logical replication slot during switchover

2025-11-18 Thread Masahiko Sawada
On Tue, Nov 18, 2025 at 1:30 AM Amit Kapila wrote: > > On Sat, Nov 15, 2025 at 4:02 AM Masahiko Sawada wrote: > > > > On Fri, Nov 14, 2025 at 2:39 AM Amit Kapila wrote: > > > > > > > > > The point is quite fundamental, do you think we can sync to a > > > pre-existing slot with the same name and

Re: Add mode column to pg_stat_progress_vacuum

2025-11-18 Thread Masahiko Sawada
On Wed, Nov 12, 2025 at 8:50 PM Shinya Kato wrote: > > On Thu, Nov 13, 2025 at 11:11 AM Masahiko Sawada > wrote: > > + > > + > > + The trigger of the current vacuum operation. Possible values are: > > > > What caused the current VACUUM operation to be initiated. Possible value

Re: log_min_messages per backend type

2025-11-18 Thread Euler Taveira
On Thu, Nov 6, 2025, at 1:01 PM, Alvaro Herrera wrote: > > I would use type:level rather than "backendtype". > Also, the glossary says we have "auxiliary processes" and "backends", so > from the user perspective, these types are not all backends, but instead > process types. > Hasn't that ship alr

Re: [PATCH] Fixed creation of empty .log files during log rotation

2025-11-18 Thread Tom Lane
Laurenz Albe writes: > You say that the stderr stream is redirected to the CSV file, but that is not > true. > Anything that a PostgreSQL process writes to stderr will still end up in the > *.log file. > For example, any error message from the archive_command will end up there, > not in the > C

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

2025-11-18 Thread Masahiko Sawada
(please avoid top-posting[1] on this mailing list) On Tue, Nov 18, 2025 at 7:15 AM 河田達也 wrote: > > Hi Sawada-san, > > Thank you very much for your review and helpful comments on my previous patch. > I have revised the patch following your suggestions: > > ・Report total memory usage rather than pe

Re: GUC thread-safety approaches

2025-11-18 Thread David Rowley
On Tue, 18 Nov 2025 at 21:50, Peter Eisentraut wrote: > where get_config_val_*() would be a thin wrapper around hash_search() > (a bit like the existing GetConfigOption() and find_option(), but > without all the error checking). > > Would that be too expensive? Why couldn't in-core GUCs be fields

Re: [PATCH] Fixed creation of empty .log files during log rotation

2025-11-18 Thread Laurenz Albe
On Tue, 2024-10-29 at 11:08 +0300, Арсений Косицын wrote: >  log_destination = 'csvlog' >  logging_collector = on >  log_rotation_age = 1min >  log_directory = '/home/user/builds/postgresql/log' > >  2) After starting the server, two files are being created in the directory > with logs: > >  -rw

Re: Bug in amcheck?

2025-11-18 Thread Mihail Nikalayeu
Hello! > Originally I investigated the customer's problem with PG16. And have > reproduced it for pg16,. I checked that relevant amcheck code was not > changed since pg16, so I thought that the problem takes place for all > Postgres versions. But looks like it is not true. I think it is still bro

Re: GUC thread-safety approaches

2025-11-18 Thread Peter Eisentraut
On 18.11.25 15:15, Heikki Linnakangas wrote: PS. I found this blog post on how Thread Local Storage is implemented on different systems very enlightening: https://maskray.me/blog/2021-02-14- all-about-thread-local-storage. I think whatever scheme we come up with will be a home-grown implementat

Re: postgres_fdw: Use COPY to speed up batch inserts

2025-11-18 Thread Matheus Alcantara
On Mon Nov 17, 2025 at 11:03 PM -03, Masahiko Sawada wrote: > IIUC the performance regression occurs when users insert many rows > into a foreign table with batch_size = 1 and use_copy_for_insert = > true (tps: 133.451518 vs. 132.644801 vs. 88.998804). Since batch_size > defaults to 1, users might

Re: pg_createsubscriber --dry-run logging concerns

2025-11-18 Thread Peter Smith
On Wed, Nov 19, 2025 at 2:39 AM Álvaro Herrera wrote: > > On 2025-Nov-12, Peter Smith wrote: > > > It is tempting to implement a "--silent" mode, but if I did that, I > > would then feel obliged to document and test it. I don't want to go > > further down this rabbit hole for what was originally s

Re: DOCS: Missing tags for some SEQUENCE fields

2025-11-18 Thread Peter Smith
On Tue, Nov 18, 2025 at 5:01 PM Amit Kapila wrote: ... > > Okay, thanks for the context. I'll push your patch on Monday unless > > there are any comments. > > > > Pushed. > Thanks for pushing! == Kind Regards, Peter Smith. Fujitsu Australia

Re: Trigger more frequent autovacuums of heavy insert tables

2025-11-18 Thread Melanie Plageman
On Tue, Nov 18, 2025 at 3:20 PM Nathan Bossart wrote: > > On Tue, Nov 11, 2025 at 12:48:39PM -0600, Nathan Bossart wrote: > > I think maintenance.sgml needs an update (specifically, the part about the > > insert threshold [0]). > > Here is a first try. Thanks for catching this! @@ -934,12 +934,1

Re: Compile error on the aarch64 platform: Missing asm/hwcap.h

2025-11-18 Thread Tom Lane
=?UTF-8?B?6auY5aKe55Cm?= writes: > There's another one (the last one) in the previous email that needs fixing: > HWCAP_SVE for pg_popcount_aarch64.c Sorry, you didn't make clear enough that you were parenthetically reporting a totally independent bug ... regards, tom lane

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

2025-11-18 Thread Melanie Plageman
On Wed, Nov 12, 2025 at 5:47 AM Thomas Munro wrote: > > I suppose an alternative design would be that _next_buffer() returns > InvalidBuffer only once (= the block number callback returns > InvalidBlock once) and then automatically resumes (= it restores the > distance) and then you can call read_

Re: GUC thread-safety approaches

2025-11-18 Thread Nico Williams
On Tue, Nov 18, 2025 at 09:50:37AM +0100, Peter Eisentraut wrote: > I want to discuss possible approaches to making the GUC system > thread-safe. In particular, I want to talk about the global > variables. I have a thing that might work for you, and OpenSSL has a better variant of that. Basicall

Re: GUC thread-safety approaches

2025-11-18 Thread Tom Lane
Jelte Fennema-Nio writes: > I think that a session-local LOAD is something we're going to lose with > threading anyway. A shared library is only going to be loaded once for the > cluster, not once per backend. That's not necessarily true. Certainly it will either be physically present in the add

Re: Speed up COPY FROM text/CSV parsing using SIMD

2025-11-18 Thread KAZAR Ayoub
On Mon, Nov 17, 2025, 11:16 PM Nathan Bossart wrote: > (assuming there is a desire to > continue with it)? I'm hoping to start spending more time on it soon. > Somethings worth noting for future reference (so someone else wouldn't waste time thinking about it), previously I tried extra several m

Re: GUC thread-safety approaches

2025-11-18 Thread Jelte Fennema-Nio
On Tue, Nov 18, 2025, 11:26 Peter Eisentraut wrote: > The way I understand this, this would only work if > DefineCustomXXXVariable could only be called from a global context > (e.g., shared_preload_libraries). But AFAICT, you can define custom GUC > parameters per session (e.g., LOAD 'auto_expla

Re: Trigger more frequent autovacuums of heavy insert tables

2025-11-18 Thread Nathan Bossart
On Tue, Nov 11, 2025 at 12:48:39PM -0600, Nathan Bossart wrote: > I think maintenance.sgml needs an update (specifically, the part about the > insert threshold [0]). Here is a first try. -- nathan >From d5dfbee7894f8ff67bea73be9caa818461fce6b1 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date:

Re: RFC: Logging plan of the running query

2025-11-18 Thread Akshat Jaimini
Hi, I have a question: In src/backend/executor/execMain.c: ``` + SetCurrentQueryDesc(oldQueryDesc); + + /* +* Ensure LogQueryPlanPending is initialized in case there was no time for +* logging the plan. Othewise plan will be logged at the next query +* executi

Post-release followup: pg_add_size_overflow()

2025-11-18 Thread Jacob Champion
Hi all, The fix for CVE-2025-12818 introduced a few identical copies of size_t addition, and now that we've released, I'd like to pull those back into shape. 0001 replaces the bespoke code with a new size_t implementation of the operators in common/int.h. 0002 additionally makes use of these in s

Re: pg_recvlogical: Prevent flushed data from being re-sent after restarting replication

2025-11-18 Thread Mircea Cadariu
Hi Fujii, I see what you mean. For reviewing I started with writing a test that just reproduces the bug and documents the current behaviour. I expected that by applying your patch the test would fail, but then we would just update the test accordingly. Surprisingly the test continues to pas

Re: [PATCH] Allow complex data for GUC extra.

2025-11-18 Thread Robert Haas
On Tue, Nov 18, 2025 at 1:21 PM Tom Lane wrote: > I'm really still dubious that this entire project is worthwhile. > I think it is basically building support for GUCs whose values > are unreasonably complicated, and would be better off if they > got redesigned. Also, right now might be a bad time

Re: pg_utility ?

2025-11-18 Thread Komяpa
On Wed, Nov 5, 2025 at 4:29 PM Álvaro Herrera wrote: > I didn't immediately love this idea, but I'm not totally opposed to it > either, and perhaps it makes things better rather than adding yet > another very narrowly-focused tool. Also, pg_ctl already kinda has a > somewhat similar facet with i

Re: Performance issues with parallelism and LIMIT

2025-11-18 Thread Tomas Vondra
On 11/18/25 19:35, David Geier wrote: > > On 18.11.2025 18:31, Tomas Vondra wrote: >> On 11/18/25 17:51, Tom Lane wrote: >>> David Geier writes: On 18.11.2025 16:40, Tomas Vondra wrote: > It'd need code in the parallel-aware scans, i.e. seqscan, bitmap, index. > I don't think you'

Re: gen_guc_tables.pl: Validate required GUC fields before code generation

2025-11-18 Thread Mahmoud Ayman
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested I tested patch v2 on top of current master. - The patch applies cleanly. - F

Re: Use merge-based matching for MCVs in eqjoinsel

2025-11-18 Thread Tom Lane
David Geier writes: > On 17.11.2025 19:44, Tom Lane wrote: >> Or maybe better, since we are considering an O(m*n) algorithm >> versus an O(m+n) one, we could check whether >> sslot1.nvalues * sslot2.nvalues - (sslot1.nvalues + sslot2.nvalues) >> exceeds some threshold. But that doesn't offer any

Re: Eagerly evict bulkwrite strategy ring

2025-11-18 Thread Melanie Plageman
On Mon, Nov 3, 2025 at 3:06 PM Melanie Plageman wrote: > > I found an incorrect assert in CleanVictimBuffer() that was tripping > in CI. Attached v6 is updated with it removed. v7 rebased over recent changes in bufmgr.c - Melanie From 59432c8962cd1d7866493492149963485f6e63e1 Mon Sep 17 00:00:00

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

2025-11-18 Thread Tomas Vondra
On 11/10/25 02:26, Tomas Vondra wrote: > What could we do about the root cause? We discussed this with Daniel and > we've been stuck for quite a while. But then it occurred to us maybe we > can simply "pause" the checksum state change while there's backup in > progress. We already enable/disable FP

Re: nbtree VACUUM's REDO routine doesn't clear page's VACUUM cycle ID

2025-11-18 Thread Peter Geoghegan
On Tue, Nov 18, 2025 at 1:32 AM Andrey Borodin wrote: > I'm thinking more about it. We always reset btpo_cycleid even in redo of a > split. > This "btpo_cycleid = 0;" reset can break two scenarios that are not currently > supported by us, but might be supported in future. I don't follow. > Thi

Re: pg_utility ?

2025-11-18 Thread Sami Imseih
> pg_utility vacuum -t tab1 -t tab2 # what vacuumdb does > pg_utility analyze -t tab1 -t tab2 # what vacuumdb -Z does > pg_utility vacuum analyze -t tab1 -t tab2 # what vacuumdb -z does > pg_utility cluster -t tab1 -t tab2 # what clusterdb does > pg_uti

Re: Checkpointer write combining

2025-11-18 Thread Melanie Plageman
On Thu, Nov 13, 2025 at 3:30 AM Chao Li wrote: > > > On Nov 4, 2025, at 07:34, Melanie Plageman > > wrote: > > > > > > uint32 > > StrategyMaxWriteBatchSize(BufferAccessStrategy strategy) > > { > >uint32max_write_batch_size = Min(io_combine_limit, > > MAX_IO_COMBINE_LIMIT); > >int

Re: *_LAST in enums to define NUM* macross

2025-11-18 Thread Roman Khapov
Thanks for your feedback! > On 18 Nov 2025, at 21:49, Tom Lane wrote: > > Isn't this patch basically proposing to revert 10b7218? > How has the situation changed since then to make that > a good idea? No, it is not a revert, until we don’t have a separated ENUMFOO_NUM value with numeric value

Re: Performance issues with parallelism and LIMIT

2025-11-18 Thread David Geier
On 18.11.2025 18:31, Tomas Vondra wrote: > On 11/18/25 17:51, Tom Lane wrote: >> David Geier writes: >>> On 18.11.2025 16:40, Tomas Vondra wrote: It'd need code in the parallel-aware scans, i.e. seqscan, bitmap, index. I don't think you'd need code in other plans, because all parallel

Re: pg_utility ?

2025-11-18 Thread Dmitry Dolgov
> On Tue, Nov 04, 2025 at 06:52:19PM +0100, Álvaro Herrera wrote: > One of the things that came up during the pgconf.eu talk about REPACK, > proposed by Christoph Berg, is that adding another utility pg_repackdb > to run it from the command line adds more noise to an already noisy tool > neighbourh

Re: Checkpointer write combining

2025-11-18 Thread Melanie Plageman
On Wed, Nov 12, 2025 at 6:40 AM BharatDB wrote: > > Considering the CI failures in earlier patch versions around “max batch > size”, upon my observation I found the failures arise either from boundary > conditions when io_combine_limit (GUC) is set larger than the compile-time > MAX_IO_COMBINE_

Re: [PATCH] Allow complex data for GUC extra.

2025-11-18 Thread Tom Lane
Bryan Green writes: > On 11/18/2025 11:24 AM, Robert Haas wrote: >> A whole different way of doing this would be to make the GUC machinery >> responsible for spinning up and tearing down the contexts. Then, the >> check hook could just be called with CurrentMemoryContext already set >> to the new

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-18 Thread Álvaro Herrera
On 2025-Nov-18, Bertrand Drouvot wrote: > Hi, > > On Tue, Nov 18, 2025 at 04:54:32PM +0100, Peter Eisentraut wrote: > > RegProcedureIsValid() doesn't add any value over OidIsValid, and we > > don't have any RegXXXIsValid() for any of the other regxxx types. > > So if we were to do anything about

Re: Use merge-based matching for MCVs in eqjoinsel

2025-11-18 Thread David Geier
Hi Tom! On 17.11.2025 19:44, Tom Lane wrote: > I wrote: >> Actually, after sleeping on it it seems like the obvious thing is >> to test "sslot1.nvalues * sslot2.nvalues", since the work we are >> thinking about saving scales as that product. But I'm not sure >> what threshold value to use if we d

Re: [PATCH] Allow complex data for GUC extra.

2025-11-18 Thread Bryan Green
On 11/18/2025 11:24 AM, Robert Haas wrote: > On Mon, Nov 17, 2025 at 4:17 PM Bryan Green wrote: >> The solution uses a wrapper struct (GucContextExtra) containing both the >> MemoryContext and data pointers. Check hooks: >> 1. Create a context under CurrentMemoryContext (for error safety) >> 2

Re: Performance issues with parallelism and LIMIT

2025-11-18 Thread Tomas Vondra
On 11/18/25 17:51, Tom Lane wrote: > David Geier writes: >> On 18.11.2025 16:40, Tomas Vondra wrote: >>> It'd need code in the parallel-aware scans, i.e. seqscan, bitmap, index. >>> I don't think you'd need code in other plans, because all parallel plans >>> have one "driving" table. > >> A sort

Re: GUC thread-safety approaches

2025-11-18 Thread Peter Eisentraut
On 18.11.25 15:15, Heikki Linnakangas wrote: Instead of a hash table to hold the values, you could have a dynamically extendable "struct". DefineCustomXXXVariable can reserve an offset and store it in a global variable. So the code to read the current GUC value would look something like this:

Re: [PATCH] Allow complex data for GUC extra.

2025-11-18 Thread Robert Haas
On Mon, Nov 17, 2025 at 4:17 PM Bryan Green wrote: > The solution uses a wrapper struct (GucContextExtra) containing both the > MemoryContext and data pointers. Check hooks: > 1. Create a context under CurrentMemoryContext (for error safety) > 2. Allocate their data structures within it > 3.

Re: Updating IPC::Run in CI?

2025-11-18 Thread Noah Misch
On Tue, Nov 18, 2025 at 08:29:14AM -0800, Jacob Champion wrote: > On Mon, Nov 17, 2025 at 12:22 PM Noah Misch wrote: > > It's a CPAN-managed key. See if the key here gives what you need: > > http://pgpkeys.eu/pks/lookup?search=071B468507812067912B951258FDA3CBB759E5C4&fingerprint=on&op=index > >

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-18 Thread Bertrand Drouvot
Hi, On Tue, Nov 18, 2025 at 04:54:32PM +0100, Peter Eisentraut wrote: > RegProcedureIsValid() doesn't add any value over OidIsValid, and we don't > have any RegXXXIsValid() for any of the other regxxx types. So if we were > to do anything about this, I would just remove it. The patch makes use o

Re: IS JSON predicate support for domain base type as JSON/JSONB/BYTEA/TEXT

2025-11-18 Thread Tom Lane
jian he writes: > [ v1-0001-IS-JSON-predicate-work-with-domain-type.patch ] This looks like a large patch with a small patch struggling to get out of it. Why didn't you simply do - *exprtype = exprType(expr); + *exprtype = getBaseType(exprType(expr)); in transformJsonParseArg?

Re: Performance issues with parallelism and LIMIT

2025-11-18 Thread Tom Lane
David Geier writes: > On 18.11.2025 16:40, Tomas Vondra wrote: >> It'd need code in the parallel-aware scans, i.e. seqscan, bitmap, index. >> I don't think you'd need code in other plans, because all parallel plans >> have one "driving" table. > A sort node for example makes this no longer work.

Re: *_LAST in enums to define NUM* macross

2025-11-18 Thread Tom Lane
Roman Khapov writes: > Based on commit 10b7218, I extended this pattern by adding *_LAST elements > and updating NUM-like macros in other > modified enums within this patch (see attachment). Isn't this patch basically proposing to revert 10b7218? How has the situation changed since then to make

Re: postgresql.conf.sample tab width

2025-11-18 Thread Nathan Bossart
On Tue, Nov 18, 2025 at 10:25:38AM +0800, Chao Li wrote: > I just reviewed the patch. Looks to me the correct three-commit split: Committed, thanks for reviewing. -- nathan

Re: Updating IPC::Run in CI?

2025-11-18 Thread Jacob Champion
On Mon, Nov 17, 2025 at 12:22 PM Noah Misch wrote: > It's a CPAN-managed key. See if the key here gives what you need: > http://pgpkeys.eu/pks/lookup?search=071B468507812067912B951258FDA3CBB759E5C4&fingerprint=on&op=index It does, thanks, though I was surprised to see that I had to override Modu

Re: minor improvement in snapbuild: use existing interface and removefake code

2025-11-18 Thread ocean_li_996
Hi ChangAo, Thanks for your comments. At 2025-11-18 10:47:20, "cca5507" wrote: > Is there a test case can reproduce the assert fail in > SnapBuildGetOrBuildSnapshot()? > After exploring the logicalmsg_decode(),I think the Assert in SnapBuildGetOrBuildSnapshot() will not fail. But the asse

Re: Performance issues with parallelism and LIMIT

2025-11-18 Thread David Geier
On 18.11.2025 16:40, Tomas Vondra wrote: >>> >>> But why? The leader and workers already share state - the parallel scan >>> state (for the parallel-aware scan on the "driving" table). Why couldn't >>> the leader set a flag in the scan, and force it to end in workers? Which >>> AFAICS should lead t

Re: regarding statistics retaining with 18 Upgrade

2025-11-18 Thread Bruce Momjian
On Tue, Nov 18, 2025 at 12:41:28PM +0900, Fujii Masao wrote: > On Tue, Nov 18, 2025 at 8:56 AM Bruce Momjian wrote: > > > > On Sat, Nov 15, 2025 at 06:52:15PM -0500, Robert Treat wrote: > > > On Sat, Nov 15, 2025 at 9:32 AM Bruce Momjian wrote: > > > > On Sat, Nov 15, 2025 at 06:02:53PM +0800, Ra

Allow GUC settings in CREATE SUBSCRIPTION CONNECTION to take effect

2025-11-18 Thread Fujii Masao
Hi, In logical replication, any GUC settings specified in the CONNECTION clause of CREATE SUBSCRIPTION are currently ignored. For example: CREATE SUBSCRIPTION mysub CONNECTION 'options=''-c wal_sender_timeout=1000''' PUBLICATION ... The wal_sender_timeout value he

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-18 Thread Peter Eisentraut
On 18.11.25 10:06, Bertrand Drouvot wrote: Hi, On Fri, Nov 07, 2025 at 03:03:03PM +, Bertrand Drouvot wrote: I'm currently working on the RegProcedureIsValid() and OidIsValid() cases, will share once done. here they are, I'm not creating a new thread for those as this is the same kind of

  1   2   >