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

2025-10-18 Thread Mircea Cadariu
On 16/10/2025 03:36, Michael Paquier wrote: prion has just failed because it uses log_error_verbosity = verbose: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2025-10-16%2001%3A23%3A06 Thanks for progressing this! In v15 attached, I adjusted the regex to work with all settin

Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring

2025-10-18 Thread Tomas Vondra
Thanks for working on this. I'm wondering if this is expected / could help with monitoring for "space exhaustion" issues, which we currently can't do easily, as it's not exposed anywhere. This is in multixact.c at line ~1177, where we do this: if (MultiXactState->oldestOffsetKnown &&

Re: Question about InvalidatePossiblyObsoleteSlot()

2025-10-18 Thread suyu.cmj
Hi, Thank you for the reference to commit 818fefd8fd4 and the related discussion thread. I understand the intent of introducing initial_restart_lsn was to preserve a consistent invalidation cause throughout the invalidation loop. However, I still have a few concerns about this design change: 1. I

Re: docs: Validation error with xmllint 2.15.0

2025-10-18 Thread Daniel Gustafsson
> On 22 Sep 2025, at 03:50, Erik Wienhold wrote: > Downgrading to libxml2 2.14.6 fixes the validation. There's also an > unreleased fix [1] for this regression. But I figure that it's best to > just remove the insignificant whitespace with the attached patch. Agreed, not least because that mak

Re: Fix overflow of nbatch

2025-10-18 Thread Tom Lane
Tomas Vondra writes: > The question what to do about this. If we got this a week ago, I'd just > probably just revert a1b4f289, and then try again for PG19. After all, > the issue it meant to address is somewhat rare. > But with 18 already stamped ... 18.0 is what it is. If this is the most seri

Re: Implement waiting for wal lsn replay: reloaded

2025-10-18 Thread Xuneng Zhou
Hi Álvaro, Thanks for your review. On Tue, Sep 16, 2025 at 4:24 AM Álvaro Herrera wrote: > > On 2025-Sep-15, Alexander Korotkov wrote: > > > > It's LGTM. The same pattern is observed in VACUUM, EXPLAIN, and CREATE > > > PUBLICATION - all use minimal grammar rules that produce generic > > > optio

Re: Proposal: Conflict log history table for Logical Replication

2025-10-18 Thread Dilip Kumar
On Wed, Sep 24, 2025 at 4:00 PM Amit Kapila wrote: > > On Tue, Sep 23, 2025 at 11:29 PM Masahiko Sawada > wrote: > > > > On Sat, Sep 20, 2025 at 4:59 AM Amit Kapila wrote: > > > > > > > > AFAIR, one open point for internally created tables is whether we > > > should skip changes to conflict_his

Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

2025-10-18 Thread Jim Jones
On 10/16/25 16:20, Philip Alger wrote: > pg_get_viewdef() sees it differently (opposite approach) > > That's true, and it's pretty strict. However, pg_get_trigger_ddl seems > more intuitive since it can return the statement whether the trigger is > quoted or unquoted without the user thinki

Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement

2025-10-18 Thread jian he
On Thu, Oct 16, 2025 at 5:17 PM Tim Waizenegger wrote: > > Hi all, > > Following the recent "Retail DDL" discussion [1], we're submitting another > implementation: pg_get_domain_ddl(). > > This function reconstructs CREATE DOMAIN statements for existing domains, > following what seems to be the ag

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

2025-10-18 Thread Tatsuo Ishii
I overlooked the elog() call and "own implementation of get_func_name()". Will fix. >>> >>> Attached is a trivial patch to fix that. I am going to push it if >>> there's no objection. >>> >>> Best regards, >>> -- >>> Tatsuo Ishii >>> SRA OSS K.K. >>> English: http://www.sraoss.co.jp/ind

Re: VACUUM (PARALLEL) option processing not using DefElem the way it was intended

2025-10-18 Thread Masahiko Sawada
On Thu, Oct 9, 2025 at 5:02 AM Álvaro Herrera wrote: > > On 2025-Oct-09, David Rowley wrote: > > > Ok, I've adjusted that in the attached. > > LGTM, thanks. LGTM too. Thank you! Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com

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

2025-10-18 Thread Michael Paquier
On Thu, Oct 16, 2025 at 10:18:39AM +0900, Michael Paquier wrote: > Another thing I have added is a check for STATEMENT in the two tests > where we do not expected a statement to be logged. I have also done a > couple more runs in the CI and locally, without noticing any failures, > so applied the

Re: Implementing IF NOT EXISTS clause for all CREATE TYPE variants

2025-10-18 Thread Tom Lane
Bram Hagens writes: > I would like to propose adding IF NOT EXISTS support to all CREATE TYPE > variants > for consistency with other CREATE commands (CREATE TABLE, CREATE INDEX, > etc.). There has been a *ton* of discussion about this over the years. If you didn't find anything in the archives

Re: comment for TwoPhaseGetOldestXidInCommit

2025-10-18 Thread Amit Kapila
On Tue, Oct 7, 2025 at 9:56 PM Robert Haas wrote: > > I noticed today that TwoPhaseGetOldestXidInCommit has a header comment > where the same function is called TwoPhaseGetXidByLockingProc: > ... > > This inconsistency should be corrected. > Right, I'll take care of it. Thanks for the report. --

Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

2025-10-18 Thread Philip Alger
Hi Jim, > I can see how it can be more practical to not care about double quotes > when using pg_get_trigger_ddl(), but IMHO consistency and predictability > are more important in this particular case. If we do this, users would > need to know where to keep or remove the double quotes when using

Re: Adding some error context for lock wait failures

2025-10-18 Thread Andres Freund
Hi, On 2025-10-09 13:33:44 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2025-10-09 12:50:53 -0400, Tom Lane wrote: > >> Concretely, like the attached. This passes check-world, but > >> I can't test it under valgrind because I'm hitting the same > >> CREATE DATABASE failure skink is repo

Re: make tsearch use the database default locale

2025-10-18 Thread Jeff Davis
On Tue, 2025-10-07 at 15:49 -0700, Jeff Davis wrote: > This patch series allows tsearch to use the database default locale > for > parsing. If the database collation is libc, there's no change. I committed a couple of the refactoring patches and rebased. v3 attached. v3-0003 which eliminates the

Re: Fix an unnecessary cast calling elog in ExecHashJoinImpl

2025-10-18 Thread Chao Li
> On Oct 17, 2025, at 12:20, Tender Wang wrote: > > > > Xuneng Zhou 于2025年10月17日周五 10:31写道: > Hi Tender, > > On Thu, Oct 16, 2025 at 8:24 PM Tender Wang wrote: > > > > > > > > Richard Guo 于2025年10月16日周四 17:53写道: > >> > >> On Thu, Oct 16, 2025 at 4:07 PM Xuneng Zhou wrote: > >> > On Mon,

Re: pg_createsubscriber --dry-run logging concerns

2025-10-18 Thread Álvaro Herrera
On 2025-Oct-03, Peter Smith wrote: > Summary > > The idea to change the pg_log_info macro globally seems risky. There > are 400+ usages of this in the PG code, way beyond the scope of these > few tools that have a dry-run. Ok. > So, that makes pg_createsubscriber the odd man out. Instead of > i

Re: Add stats_reset to pg_stat_all_tables|indexes and related views

2025-10-18 Thread Michael Paquier
On Mon, Oct 06, 2025 at 08:57:32AM +, Bertrand Drouvot wrote: > A few remakrs: This looks globally sensible, from here. A few remarks. > - It does not use an existing macro (as such macro does not exist) to > generate the > function that reports this new field. So we've more flexibility for

Re: Sending unflushed WAL in physical replication

2025-10-18 Thread Aleksander Alekseev
Hi, > This is a great question. I'm currently working on implementing a solution > for this. > One possible solution is to write the records to a spill file when the flush > pointer > indicates that none have been flushed on the primary. Once they have been > flushed > on the primary, the recor

Re: Should we update the random_page_cost default value?

2025-10-18 Thread Laurenz Albe
On Mon, 2025-10-06 at 01:53 -0400, Tom Lane wrote: > Laurenz Albe writes: > > On Mon, 2025-10-06 at 01:29 -0400, Tom Lane wrote: > > > But if what > > > we're trying to model is net resource demands, with an eye to > > > minimizing the total system load not execution time of any one query, > > > m

Re: Optimize LISTEN/NOTIFY

2025-10-18 Thread Joel Jacobson
On Tue, Sep 30, 2025, at 20:56, Joel Jacobson wrote: > Attachments: > * optimize_listen_notify-v5.patch Changes since v5: *) Added missing #include "nodes/pg_list.h" to fix List type error in headerscheck *) Add NOTIFY_DEFERRED_WAKEUP_MAIN to wait_event_names.txt and rename WAIT_EVENT_NOTIFY_DEF

Issue with DETACH PARTITION CONCURRENTLY on a hash partition table

2025-10-18 Thread 李海洋(陌痕)
Hi all, DETACH PARTITION CONCURRENTLY will add a check constraint to detached partition. However, I found an issue when using it on a hash partitioned table. The repro steps are as follows: ``` CREATE DATABASE db1; CREATE DATABASE db2; \c db1 CREATE TABLE users (id int, name text) PARTITION BY HA

Re: Fixing a few minor misusages of bms_union()

2025-10-18 Thread Tom Lane
David Rowley writes: > Posting here to see if anyone knows a reason for not doing this that > I've overlooked. This change in substitute_phv_relids_walker is *not* safe according to the routine's head comment: * NOTE: although this has the form of a walker, we cheat and modify the * nodes in-p

Re: psql: Count all table footer lines in pager setup

2025-10-18 Thread Tom Lane
Erik Wienhold writes: > On 2025-10-07 00:45 +0200, Tom Lane wrote: >> Oh wait! That line *is* produced within print.c, so there is no >> reason we shouldn't account for it. I spent a little extra effort >> on unaligned mode too, since the TAP test is checking that case. > LGTM. Pushed, after a

Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

2025-10-18 Thread Philip Alger
Hi Jim, Appreciate the feedback! > The function fails to look up triggers with quoted names > Not exactly. If you put "FOO" in the function pg_get_trigger_ddl('tbl', '"FOO"') it will error because you don't need the double quotes. They are already preserved. You just need the name, and pg_get_t

Re: add function argument name to substring and substr

2025-10-18 Thread jian he
On Mon, Jul 21, 2025 at 2:31 PM jian he wrote: > > actually, > section (9.7.3.) > https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP > already have example, like: > substring('foobar' from 'o(.)b') > > new patch attached, split substr, substring to make review m

Re: split func.sgml to separated individual sgml files

2025-10-18 Thread Nazir Bilal Yavuz
Hi, On Wed, 1 Oct 2025 at 15:09, Nazir Bilal Yavuz wrote: > On Tue, 30 Sept 2025 at 22:48, Andrew Dunstan wrote: > > > > Hi Bilal, > > > > This got preempted slightly by Tom's commit 170a8a3f460, but I think > > it's worth doing. I tried to simplify it some. See attached. There > > doesn't seem

Re: Eager aggregation, take 3

2025-10-18 Thread Richard Guo
On Thu, Oct 9, 2025 at 10:49 AM Richard Guo wrote: > On Wed, Oct 8, 2025 at 8:14 PM David Rowley wrote: > > +-- Enable eager aggregation, which by default is disabled. > > +SET enable_eager_aggregate TO on; > > > The above comment and command mismatch to my understanding from > > looking at postg

Re: Vacuum statistics

2025-10-18 Thread Bharath Rupireddy
Hi, On Mon, May 12, 2025 at 5:30 AM Amit Kapila wrote: > > On Fri, May 9, 2025 at 5:34 PM Alena Rybakina > wrote: > > > > I did a rebase and finished the part with storing statistics separately > > from the relation statistics - now it is possible to disable the collection > > of statistics f

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

2025-10-18 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Mon, 15 Sep 2025 10:00:18 -0700, Masahiko Sawada wrote: >> > I think we can use a local variable of CopyFormatOptions and memcpy it >> > to the opts of the returned cstate. >> >> It'll work too. Can we proc

Re: Support getrandom() for pg_strong_random() source

2025-10-18 Thread Jacob Champion
On Mon, Oct 6, 2025 at 4:11 PM Michael Paquier wrote: > Yeah.. I'm not sure that it is our job to draw a strict line, either. > We are labelled as database specialists. When it comes to > cryptography, I cannot say for all the others but I'm very confident > in the fact that I'm bad at it. Me t

Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

2025-10-18 Thread jian he
On Tue, Oct 14, 2025 at 12:03 PM Philip Alger wrote: > > > > On Mon, Oct 13, 2025 at 9:28 PM jian he wrote: >> >> >> I just did a quick test. >> >> src1=# SELECT pg_get_trigger_ddl(2, 'foo_trigger'); >> ERROR: trigger "foo_trigger" for table "(null)" does not exist >> src1=# SELECT pg_get_trigge

Re: Invalid pointer access in logical decoding after error

2025-10-18 Thread Masahiko Sawada
On Thu, Oct 9, 2025 at 8:23 AM Euler Taveira wrote: > > On Thu, Oct 9, 2025, at 10:40 AM, vignesh C wrote: > > On Thu, 9 Oct 2025 at 00:16, Masahiko Sawada wrote: > >> > >> One thing we might want to consider is for v14 and v13. They don't > >> have this bug since the entry_ctx was introduced in

Re: Bypassing cursors in postgres_fdw to enable parallel plans

2025-10-18 Thread Robert Haas
On Wed, Mar 12, 2025 at 7:57 AM Andy Fan wrote: > Do you know why we can't use parallel plan when cursor is used? Is It > related to this code in ExecutePlan? Yes. When a cursor is used, the whole query isn't executed all at once, but rather the executor will be started and stopped for each fetch

Re: Report bytes and transactions actually sent downtream

2025-10-18 Thread Bertrand Drouvot
Hi, On Wed, Sep 24, 2025 at 12:51:29PM +0530, Ashutosh Bapat wrote: > On Wed, Sep 24, 2025 at 12:32 PM Bertrand Drouvot > wrote: > > > > - create a table and use pg_logical_slot_get_changes with > > > > ('skip-empty-xacts', '1') > > > > then I don't see plugin_sent_bytes increasing (which makes

Re: Thoughts on a "global" client configuration?

2025-10-18 Thread Jacob Champion
On Mon, Oct 13, 2025 at 1:15 PM Robert Haas wrote: > The distinction in my mind is that sslmode, gssencmode, and > sslnegotiation define what we're doing on the wire, whereas parameters > like sslcert just define where local resources are to be found. > Granted, that influences what we're doing on

Re: Fix overflow of nbatch

2025-10-18 Thread Konstantin Knizhnik
On 23/09/2025 6:11 PM, Tomas Vondra wrote: Hi, I kept looking at this, and unfortunately the it seems a bit worse :-( Fixing the overflow is easy enough - adding the cast does the trick. But then there's the second issue I mentioned - the loop does not adjust the hash_table_bytes. It updates

Re: src/include/utils/float.h comment one link stable

2025-10-18 Thread Tom Lane
David Rowley writes: > On Tue, 7 Oct 2025 at 04:24, Tom Lane wrote: >> I wonder if we couldn't also remove the NAN hacks in the same file. >> NAN's been required since C99 as well, and it's equally hard to >> believe that we still need to support compilers that don't conform. >> >> (Strictly spe

Re: pg_createsubscriber - more logging to say if there are no pubs to drop

2025-10-18 Thread Masahiko Sawada
On Tue, Oct 14, 2025 at 10:41 AM Masahiko Sawada wrote: > > On Wed, Oct 8, 2025 at 6:34 PM Peter Smith wrote: > > > > Hi hackers, > > > > While reviewing pg_createsubscriber in another thread, I found some of > > the current logging to be confusing. Specifically, there is one part > > that drops

Re: [PROPOSAL] comments in repl_scanner

2025-10-18 Thread Peter Eisentraut
On 14.10.25 13:13, Matěj Klonfar wrote: certain instrumentation tools do prefix each statement with an informational comment, typically to provide some tracing information to logs (datadog for example). While this works for SQL statements, it's not possible with logical replication statements b

Re: [PATCH] GROUP BY ALL

2025-10-18 Thread David Christensen
> On Sep 29, 2025, at 3:58 PM, Tom Lane wrote: > > David Christensen writes: >>> Here is v7 with a stab at docs; fairly minimal at this point, but >>> touching the two areas that are likely to need adjusting. > > I did some more word-smithing on the docs and pushed it. > >>> When >>> adjust

Re: Invalid pointer access in logical decoding after error

2025-10-18 Thread Masahiko Sawada
On Wed, Oct 8, 2025 at 11:39 AM vignesh C wrote: > > On Tue, 7 Oct 2025 at 23:40, Masahiko Sawada wrote: > > > > On Mon, Oct 6, 2025 at 6:55 PM Euler Taveira wrote: > > > > > > On Mon, Oct 6, 2025, at 5:00 PM, Masahiko Sawada wrote: > > > > I agree with your analysis. It seems there is no conven

Re: Support getrandom() for pg_strong_random() source

2025-10-18 Thread Jacob Champion
On Tue, Oct 7, 2025 at 1:26 AM Daniel Gustafsson wrote: > Using a UUID as salt would perhaps be one scenario which would turn the RNG > used for UUIDs into security functionality according to the FIPS definitions? I don't know. One might idly hope that using a UUID for a salt would itself be a FI

Re: [PATCH] Remove unused #include's in src/backend/commands/*

2025-10-18 Thread Aleksander Alekseev
Hi, > OK, I tried include-what-you-use with a little post-processing script > and the scope of work seems reasonable. I will submit the updated > patch shortly. Here is the updated patch v3. -- Best regards, Aleksander Alekseev From 182d5d85e64f0611c48cf0270dfc3027805e4306 Mon Sep 17 00:00:00 2

Re: Changing shared_buffers without restart

2025-10-18 Thread Dmitry Dolgov
As I've mentioned in our off list communication, I'm working on the new design and was planning to post some intermediate results in a couple of weeks. Thus I'm surprised that instead of aligning on plans you've decided to post you own version earlier. It most certainly doesn't make things easier f

Re: Fix overflow of nbatch

2025-10-18 Thread Tomas Vondra
On 10/8/25 21:16, Melanie Plageman wrote: > On Wed, Oct 8, 2025 at 1:37 PM Melanie Plageman > wrote: >> >> I have updated my patch to fix the mistakes above. I also noticed then >> that I wasn't doubling space_allowed in the loop but instead setting >> it to hash_table_bytes at the end. This do

Re: create table like including storage parameter

2025-10-18 Thread David G. Johnston
On Sunday, September 28, 2025, jian he wrote: > > Since we already support INCLUDING STORAGE, I’m not sure that > INCLUDING STORAGE PARAMETER is the right syntax to go with. > I’d just call it “including parameters”; sure, all of the existing ones are storage related, but if there were non-storag

Re: IO in wrong state on riscv64

2025-10-18 Thread Alexander Lakhin
Hello Thomas, 12.10.2025 06:35, Thomas Munro wrote: On Sun, Oct 12, 2025 at 2:00 AM Alexander Lakhin wrote: 2025-10-11 11:34:46.793 GMT [1169773:1] PANIC: !!!pgaio_io_wait| ioh->state changed from 0 to 1 at iteration 0 # no other iteration number observed Can you please disassemble pgaio_io

Re: get rid of RM_HEAP2_ID

2025-10-18 Thread John Naylor
On Fri, Oct 10, 2025 at 9:47 AM Michael Paquier wrote: > > On Thu, Oct 09, 2025 at 03:15:11PM +0700, John Naylor wrote: > > Leaving that up to the rmgr makes sense. One consideration I didn't > > mention was for xlogstats.c -- "record_stats[rmid][recid]" would get > > 16x larger if recid could tak

Re: Improve docs for n_distinct_inherited

2025-10-18 Thread David Rowley
On Tue, 14 Oct 2025 at 00:55, David G. Johnston wrote: > WFM. Since we allow 0 as an input I’m not convinced we should remove that > sentence, though I concur that using reset is preferred. I've pushed the v5 version. Thanks to both of you for looking. David

Re: speedup COPY TO for partitioned table.

2025-10-18 Thread Chao Li
> On Oct 10, 2025, at 10:54, jian he wrote: > >> 5 >> ``` >> +static void >> +CopyRelTo(CopyToState cstate, Relation rel, Relation root_rel, >> + uint64 *processed) >> ``` >> >> Instead of using a pointer to pass out processed count, I think it’s better >> to return the process count. I unde

Re: GiST nitpicks I want to discuss (and maybe eventually fix)

2025-10-18 Thread Andrey Borodin
Hi Kirill! > On 6 Oct 2025, at 22:57, Kirill Reshke wrote: > > 0001: > Remove GistTuplesDeleted support from GiST > > This bit flag value is unused since > 68446b2c87a2aee5d8c2eb2aade7bb6d4195b7e1. > F_TUPLES_DELETED flag is not removed, since it is still used for > pageinspect. This is because

Re: [PATCH] Remove unused #include's in src/backend/commands/*

2025-10-18 Thread Aleksander Alekseev
Hi Álvaro, > I wonder how many of these changes pass the compilation only because the > header you're removing is indirectly being included via another header. > In this particular case, it's because slot.h includes walreceiver.h > which includes walsender.h, so this removal has no effect. Hm

Re: Optimize LISTEN/NOTIFY

2025-10-18 Thread Joel Jacobson
On Mon, Oct 6, 2025, at 22:22, Joel Jacobson wrote: > On Mon, Oct 6, 2025, at 22:11, Joel Jacobson wrote: >> The patch is now using dshash. I've been looking at code in launcher.c >> when implementing it. The function init_channel_hash() ended up being >> very similar to launcher.c's logicalrep_lau

Re: Optimize LISTEN/NOTIFY

2025-10-18 Thread Joel Jacobson
On Wed, Oct 15, 2025, at 05:19, Chao Li wrote: > * B enters PreCommit_Notify(), it gets the NotifyQueueLock first, it > records headBeforeWrite = 1 and writes to 3, and records headAfterWrite > = 3. > * Now QueueHead is 3. > * C enters PreCommit_Notify(), it records headBeforeWrite = 3 and >

Re: pg_createsubscriber --dry-run logging concerns

2025-10-18 Thread Peter Smith
On Wed, Oct 8, 2025 at 9:04 PM Álvaro Herrera wrote: > > On 2025-Oct-08, Peter Smith wrote: > > > I am not wedded to doing this double-messaging... if people feel just > > the one-time logging at the beginning is enough, then that is OK by > > me. > > Some other tools (not Postgres ones) do that a

Re: get rid of RM_HEAP2_ID

2025-10-18 Thread Nathan Bossart
On Mon, Oct 06, 2025 at 04:04:00PM +0700, John Naylor wrote: > 0004: get rid of RM_HEAP2_ID. This was simple once the prerequisites > were in place. All of the HEAP2_* macros keep the same name and only > differ in value. Heap rmgr is completely full so it might be good to > increase to 5 bits for

Re: add function argument name to substring and substr

2025-10-18 Thread Andrew Dunstan
On 2025-10-13 Mo 10:22 AM, jian he wrote: On Mon, Jul 21, 2025 at 2:31 PM jian he wrote: actually, section (9.7.3.) https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP already have example, like: substring('foobar' from 'o(.)b') new patch attached, split su

Re: Avoiding roundoff error in pg_sleep()

2025-10-18 Thread Vladlen Popolitov
Hi David, David G. Johnston писал(а) 2025-09-26 18:08: On Friday, September 26, 2025, Vladlen Popolitov wrote: It looks like sleep has the wrong place in a function. It should be an utility command, that does not start a transaction. Then write that command. We’re not going to change pg_sl

Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward

2025-10-18 Thread Dimitrios Apostolou
Thank you for your work on this, Tom. I'll try to test it in the weekend. Dimitris On 16 October 2025 19:01:10 CEST, Tom Lane wrote: >I wrote: >> I think this is more or less committable, and then we could get >> back to the original question of whether it's worth tweaking >> pg_restore's seek-

Re: pg_restore --no-policies should not restore policies' comment

2025-10-18 Thread Alexander Lakhin
Hello Jian, 16.10.2025 17:22, jian he пишет: Buildfarm member petalura reported a failure at [1] after 0001 was backpatched to v13. However, the server logs show a "double free or corruption" error occurring as the backend was exiting. Since that code was not touched by 0001, for now I don't thi

Re: VACUUM (PARALLEL) option processing not using DefElem the way it was intended

2025-10-18 Thread David Rowley
On Thu, 9 Oct 2025 at 00:36, Álvaro Herrera wrote: > Yeah, that change makes sense to me. With an eye towards not forcing > the translators to understand the message context or forced to translate > the word "parallel", I would suggest to take the option name out of the > sentence, maybe somethin

Re: src/include/utils/float.h comment one link stable

2025-10-18 Thread David Rowley
On Tue, 7 Oct 2025 at 02:11, Daniel Gustafsson wrote: > Judging by the cec8394b5ccd3 this was added for MSVC 2013 support, and commit > 8fd9bb1d9654c59d bumped the minimum requirement to MSVC 2019, so I wonder if > this at all relevant anymore? Looks like these were added in cec8394b5 for VS2013

Re: plan shape work

2025-10-18 Thread Tom Lane
Richard Guo writes: > Looking at choose_plan_name(), IIUC, the nested loop is used to find > the next unused suffix number for a given name. I'm wondering why not > simply iterate through glob->subplanNames once, check the suffix > number for each name matching the given base name, determine the

Re: Should we update the random_page_cost default value?

2025-10-18 Thread Robert Haas
On Wed, Oct 8, 2025 at 4:20 PM Tomas Vondra wrote: > What I imagined is more like a process that regularly walks shared > buffers, counts buffers per relation (or relfilenode), stores the > aggregated info into some shared memory (so that standby can have it's > own concept of cache contents). And

Re: a couple of small patches for simd.h

2025-10-18 Thread Nathan Bossart
On Fri, Oct 03, 2025 at 02:40:22PM +0700, John Naylor wrote: > LGTM. Committed, thanks for reviewing. -- nathan

Re: SQL:2023 JSON simplified accessor support

2025-10-18 Thread Chao Li
> On Sep 24, 2025, at 09:05, Alexandra Wang > wrote: > > This is the expected behavior for array subscripting, and my patch > doesn't change that. I don't think this is a problem. With or without > my patch, you can avoid the ERROR by adding parentheses: > > test=# select ((p).meta[1])['a'] f

Re: Use "?=" operator for a contrib makefile in documentation

2025-10-18 Thread Peter Eisentraut
On 25.09.25 15:17, Maxim Orlov wrote: I think that the Makefile should be written so that variable values, specifically, PG_CONFIG, can be given to it from the environment rather than the make command line. As a result, using the "?=" operator rather than "=" to set a default value to the PG_CONF

Re: test_json_parser/002_inline is kind of slow

2025-10-18 Thread Tom Lane
Robert Haas writes: > On Sat, Sep 27, 2025 at 12:43 PM Tom Lane wrote: >> I tried it on my Mac M4 laptop, and saw the 002 test dropping from >> 3592 ms to 540 ms, about an 85% savings. So I agree this is worth >> doing. It's still unclear why Robert is seeing times so much worse >> than mine, t

Re: remove partColsUpdated

2025-10-18 Thread Michael Paquier
On Wed, Oct 15, 2025 at 08:18:41PM -0400, Tom Lane wrote: > Chao Li writes: >> On Oct 15, 2025, at 23:50, Nathan Bossart wrote: >>> This was first added in commit 2f17844 (v11), and AFAICT it was only used >>> for a variable named update_tuple_routing_needed in ExecInitModifyTable(), >>> which wa

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

2025-10-18 Thread shveta malik
On Fri, Oct 17, 2025 at 8:55 AM Amit Kapila wrote: > > On Thu, Oct 16, 2025 at 11:10 PM Masahiko Sawada > wrote: > > > > On Thu, Oct 16, 2025 at 1:41 AM Amit Kapila wrote: > > > > > > > Using PMSIGNAL_BACKGROUND_WORKER_CHANGE sounds mis-using since the > > slotsync worker is not a background wo

Re: Report bytes and transactions actually sent downtream

2025-10-18 Thread shveta malik
On Fri, Sep 19, 2025 at 8:11 PM Ashutosh Bapat wrote: > > On Fri, Sep 19, 2025 at 11:48 AM shveta malik wrote: > > > > On Thu, Sep 18, 2025 at 3:54 PM Ashutosh Bapat > > wrote: > > > > > > > > > > > > > > Few comments: > > > > > > > > 1) > > > > postgres=# select slot_name, > > > > total_bytes,p

Re: We broke the defense against accessing other sessions' temp tables

2025-10-18 Thread Jim Jones
Hi Thomas On 10/5/25 03:55, Tom Lane wrote: > Anyway, happy to turn this over to you, I'm just the messenger. Just to avoid any duplication of effort: there's already a patch that substantially overlaps with this issue[1] Best regards, Jim 1 - https://commitfest.postgresql.org/patch/5379/

Re: Optimize LISTEN/NOTIFY

2025-10-18 Thread Matheus Alcantara
On Tue Oct 7, 2025 at 6:17 PM -03, Tom Lane wrote: > "Matheus Alcantara" writes: >> On Tue Oct 7, 2025 at 1:51 PM -03, Tom Lane wrote: >>> Also, I don't think it's the job of this patch to provide test >>> coverage for dshash. That should be quite well covered already. > >> When I was mentioning

Re: speedup COPY TO for partitioned table.

2025-10-18 Thread Masahiko Sawada
On Wed, Oct 15, 2025 at 7:57 PM jian he wrote: > > On Thu, Oct 16, 2025 at 9:21 AM Masahiko Sawada wrote: > > > > > Please check the attached v18. > > > > Thank you for updating the patch! > > > > I've reviewed the patch and here is one review comment: > > > > from->inh = false; /* a

Re: Use "?=" operator for a contrib makefile in documentation

2025-10-18 Thread Peter Eisentraut
On 29.09.25 16:00, Tom Lane wrote: Peter Eisentraut writes: On 25.09.25 15:17, Maxim Orlov wrote: I think that the Makefile should be written so that variable values, specifically, PG_CONFIG, can be given to it from the environment rather than the make command line. As a result, using the "?="

Re: Adding some error context for lock wait failures

2025-10-18 Thread Tom Lane
Andres Freund writes: > valgrind complains that there's a memory leak here: > ==374853== 1,024 bytes in 1 blocks are definitely lost in loss record 1,257 > of 1,459 > ==374853==at 0xFD902A: palloc (mcxt.c:1389) > ==374853==by 0x101A3D6: initStringInfoInternal (stringinfo.c:45) > ==374853

Re: Suggestion to add --continue-client-on-abort option to pgbench

2025-10-18 Thread Yugo Nagata
On Thu, 25 Sep 2025 13:49:05 +0900 Fujii Masao wrote: > On Thu, Sep 25, 2025 at 11:17 AM Yugo Nagata wrote: > > > > On Thu, 25 Sep 2025 11:09:40 +0900 > > Yugo Nagata wrote: > > > > > On Thu, 25 Sep 2025 02:19:27 +0900 > > > Fujii Masao wrote: > > > > > > > On Tue, Sep 23, 2025 at 11:58 AM Rin

Re: Optimizing ResouceOwner to speed up COPY

2025-10-18 Thread Tom Lane
Tomas Vondra writes: > The reason is pretty simple - ResourceOwner tracks the resources in a > very simple hash table, with O(n^2) behavior with duplicates. This > happens with COPY, because COPY creates an array of a 1000 tuple slots, > and each slot references the same tuple descriptor. And the

Re: Fix misuse use of window_gettupleslot function (src/backend/executor/nodeWindowAgg.c)

2025-10-18 Thread Ranier Vilela
Em dom., 5 de out. de 2025 às 13:05, Tom Lane escreveu: > Ranier Vilela writes: > > Per Coverity. > > CID 1635309: (#1 of 1): Unchecked return value (CHECKED_RETURN) > > 7. check_return: Calling window_gettupleslot without checking return > value > > (as is done elsewhere 8 out of 9 times). > >

Re: bug, ALTER TABLE call ATPostAlterTypeCleanup twice for the same relation

2025-10-18 Thread jian he
On Wed, Oct 1, 2025 at 11:04 AM jian he wrote: > > we can simply change from > > if (pass == AT_PASS_ALTER_TYPE || pass == AT_PASS_SET_EXPRESSION) > ATPostAlterTypeCleanup(wqueue, tab, lockmode); > > to > if (pass == AT_PASS_SET_EXPRESSION) >

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

2025-10-18 Thread shveta malik
Few comments: 1) + /* + * Logical decoding is normally disabled after dropping the last logical + * slot, but if it happens during process exit time for example when + * releasing a temporary logical slot on an error, the process sets this + * flag to true, delegating the checkpointer to disable l

Re: IO in wrong state on riscv64

2025-10-18 Thread Alexander Lakhin
13.10.2025 01:44, Thomas Munro wrote: On Sun, Oct 12, 2025 at 6:00 PM Alexander Lakhin wrote: Please find those attached (gdb "disass/m pgaio_io_update_state" misses the start of the function (but it's still disassembled below), so I decided to share the whole output). Could you please also di

create table like including storage parameter

2025-10-18 Thread jian he
hi. attached patch is to make CREATE TABLE LIKE copy source relation storage parameter demo: create table t(a text) with (fillfactor = 100, toast.vacuum_truncate=true); create table t2(like t including storage parameter) with (parallel_workers = 3); Tabl

Re: What is the build strategy between make and meson?

2025-10-18 Thread Tom Lane
Chao Li writes: > It is my first time trying meson build, and I got a bunch of warnings on my > MacBook with macOS Sequoia 15.6.1: > ... > ../src/interfaces/libpq/fe-connect.c:5622:12: warning: 'ldap_init' is > deprecated: first deprecated in macOS 10.10 - use ldap_initialize > [-Wdeprecated-de

Re: A tidyup of pathkeys.c

2025-10-18 Thread David Rowley
Thanks for having a look. On Tue, 14 Oct 2025 at 21:15, Chao Li wrote: > I have only a trivial comment. As you pull out the shared code into > count_common_leading_pathkeys_ordered()/unordered(), it’s reasonable to make > them inline, which ensures the new code has the same performance as befor

Re: VACUUM (PARALLEL) option processing not using DefElem the way it was intended

2025-10-18 Thread David Rowley
On Fri, 10 Oct 2025 at 06:35, Masahiko Sawada wrote: > > On Thu, Oct 9, 2025 at 5:02 AM Álvaro Herrera wrote: > > LGTM, thanks. > > LGTM too. Thank you! Thank you to you both for looking. Pushed. David

Re: Extend documentation for pg_stat_replication.backend_xmin

2025-10-18 Thread Renzo Dani
On Thu, Oct 16, 2025 at 8:07 AM Renzo Dani wrote: > Really nice, > Thanks a lot for the info and review. > Taken into the patch. > > Regards, > Renzo Dani > > On Thu, Oct 16, 2025 at 5:32 AM Fujii Masao wrote: > >> On Thu, Oct 16, 2025 at 12:47 AM Renzo Dani wrote: >> > >> > Hi, >> > recently I

Re: Changing shared_buffers without restart

2025-10-18 Thread Dmitry Dolgov
> On Thu, Oct 16, 2025 at 09:55:05PM +0530, Ashutosh Bapat wrote: > > BTW, this idea isn't new and it's certainly not only mine. > It's a combination of an implementation shared by Thomas Munro [4] and > an implementation I had shared with you offlist on 30th January 2025. > I never saw any comment

Re: Should we update the random_page_cost default value?

2025-10-18 Thread Robert Haas
On Wed, Oct 8, 2025 at 12:24 PM Tomas Vondra wrote: > I don't think there's all that much disagreement, actually. This is a > pretty good illustration that we're using random_page_cost to account > for things other than "I/O cost" (like the expected cache hit ratios), > because we simply don't hav

Re: Inconsistent Behavior of GROUP BY ROLLUP in v17 vs master

2025-10-18 Thread David Rowley
On Wed, 24 Sept 2025 at 02:39, Tom Lane wrote: > Is there anything we can salvage from 67a54b9e, or should > we just revert it? It doesn't seem great that we need to reconsider the safety of that optimisation post-release. It's not as if 67a54b9e added several cases to test for and got one of the

Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward

2025-10-18 Thread Chao Li
> On Oct 12, 2025, at 09:25, Tom Lane wrote: > > While playing around with the test cases for pg_dump compression, > I was startled to discover that the performance of compress_lz4's > "stream API" code is absolutely abysmal. Here is a simple test > case to demonstrate, using the regression da

Re: "openssl" should not be optional

2025-10-18 Thread Daniel Gustafsson
> On 24 Sep 2025, at 13:14, Christoph Berg wrote: > While it is probably possible to skip the tests when the configure > probe did not find the openssl binary, IMHO the configure check should > already fail. That's more robust and easier. It seems a bit restrictive to require the openssl binary

Re: Invalid pointer access in logical decoding after error

2025-10-18 Thread Masahiko Sawada
On Mon, Oct 6, 2025 at 6:55 PM Euler Taveira wrote: > > On Mon, Oct 6, 2025, at 5:00 PM, Masahiko Sawada wrote: > > I agree with your analysis. It seems there is no convenient way to > > move RelationSyncCache inside PGOutputData. So let's proceed with the > > proposed approach. > > > > +1. Should

Re: Mutable listen_addresses GUC

2025-10-18 Thread Tom Lane
Ivan Kovmir writes: > It is necessary to restart PostgreSQL to bind to a different network > interface, thus breaking the active connections. On most platforms, if you set listen_addresses to "*" then there's no problem, the kernel will automatically cope with IP address changes. Do we really nee

Re: another autovacuum scheduling thread

2025-10-18 Thread Nathan Bossart
On Thu, Oct 09, 2025 at 12:15:31PM -0400, Andres Freund wrote: > On 2025-10-09 11:01:16 -0500, Nathan Bossart wrote: >> I also wonder how hard it would be to gracefully catch the error and let >> the worker continue with the rest of its list... > > The main set of cases I've seen are when workers

Re: Proposal: Conflict log history table for Logical Replication

2025-10-18 Thread Dilip Kumar
On Sun, Sep 28, 2025 at 2:43 AM Amit Kapila wrote: > > I agree that option-2 is useful and IIUC, we are already working on > something similar in thread [1]. However, it is better to use option-1 > here because we are using non-user specified mechanism to skip changes > during replication, so fol

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

2025-10-18 Thread Hayato Kuroda (Fujitsu)
Dear Shlok, Thanks for updating the patch. Here are my comments. 01. ``` + /* Update the slot sync reason */ + SpinLockAcquire(&slot->mutex); + if (slot->slot_sync_skip_reason != skip_reason) + slot->slot_sync_skip_reason = skip_reason; + SpinLockRelease(&slo

  1   2   3   4   5   6   7   8   >