Re: Statistics Import and Export

2025-02-28 Thread Nathan Bossart
On Fri, Feb 28, 2025 at 04:52:02PM -0500, Corey Huinker wrote: > On Fri, Feb 28, 2025 at 4:25 PM Jeff Davis wrote: >> On Fri, 2025-02-28 at 14:56 -0600, Nathan Bossart wrote: >>> I'm curious what the use-case is for pg_upgrade's --no-statistics >>> option. >> >> Mostly completeness and paranoia. I

Add assertion for failed alloc to palloc0() and palloc_extended()

2025-02-28 Thread Andreas Karlsson
Hi, I noticed that we have Assert(ret != NULL) in palloc() but not in palloc0() so for consistency I decided to add it. I also added an assertion that the MCXT_ALLOC_NO_OOM flag is set if alloc() returns NULL to palloc_extended(). I feel that this might be useful since while palloc() is much

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-28 Thread Jacob Champion
On Fri, Feb 28, 2025 at 5:44 AM Thomas Munro wrote: > If you trigger the new optional NetBSD CI task, the oauthvalidator > tests implode[1]. Oh, thank you for reporting that. I need to pay more attention to the BSD CI thread. > Apparently that OS's kevent() doesn't like zero > relative timeouts

Re: vacuumdb changes for stats import/export

2025-02-28 Thread Nathan Bossart
On Thu, Feb 27, 2025 at 04:36:04PM +0700, John Naylor wrote: > On Wed, Feb 5, 2025 at 4:44 AM Nathan Bossart > wrote: >> [v2] > > I started looking just at 0001, and it seems like a fairly > straightforward rearrangement. Thanks for taking a look. > I found this comment quite hard to read: >

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-28 Thread Thomas Munro
On Sat, Mar 1, 2025 at 6:37 AM Jacob Champion wrote: > Should we maybe consider just doing that across the board, and put up > with the inefficiency? Admittedly 1ms is a lot more dead time than > 1ns... Last time I checked, NetBSD is still using scheduler ticks (100hz periodic interrupt) for all

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-28 Thread Thomas Munro
On Sat, Mar 1, 2025 at 10:57 AM Jacob Champion wrote: > After your patch gets us past the zero timeout bug, NetBSD next runs into > > failed to fetch OpenID discovery document: Unsupported protocol > (libcurl: Received HTTP/0.9 when not allowed)' > > ...but only for a single test (nonempty oau

Re: optimize file transfer in pg_upgrade

2025-02-28 Thread Robert Haas
On Fri, Feb 28, 2025 at 3:01 PM Nathan Bossart wrote: > That's exactly where I landed (see v3-0002). I haven't measured whether > transferring relfilenodes or dumping the sequence data is faster for the > existing modes, but for now I've left those alone, i.e., they still dump > sequence data. T

Re: optimize file transfer in pg_upgrade

2025-02-28 Thread Robert Haas
On Wed, Nov 6, 2024 at 5:07 PM Nathan Bossart wrote: > these user relation files will have the same name. Therefore, it can be > much faster to instead move the entire data directory from the old cluster > to the new cluster and to then swap the catalog relation files. This is a cool idea. > An

Metadata and record block access stats for indexes

2025-02-28 Thread Mircea Cadariu
Hi, For the purpose of writing a blog post I was checking the index stats recorded for a workload, but found them rather confusing. Following along the code with the debugger it eventually made sense, and I could eventually understand what's counted.  Looking around a bit, I discovered an old

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

2025-02-28 Thread Masahiko Sawada
On Thu, Feb 27, 2025 at 7:57 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Thu, 27 Feb 2025 15:24:26 -0800, > Masahiko Sawada wrote: > > > Pushed the 0001 patch. > > Thanks! > > > Regarding the 0002 patch, I realized w

Re: Statistics Import and Export

2025-02-28 Thread Jeff Davis
On Thu, 2025-02-27 at 22:42 -0500, Greg Sabino Mullane wrote: > I know I'm coming late to this, but I would like us to rethink having > statistics dumped by default. I was caught by this today, as I was > doing two dumps in a row, but the output changed between runs solely > because the stats got u

Re: making EXPLAIN extensible

2025-02-28 Thread Sami Imseih
> EXPLAIN output. It wouldn't make sense for core to have an EXPLAIN > option whose whole purpose is to cater to the needs of some extension, > so that made me think of providing some extensibility infrastructure. Making EXPLAIN extensible sounds like a good idea.. FWIW, There is a discussion [0]

Re: Should work_mem be stable for a prepared statement?

2025-02-28 Thread Tom Lane
Sami Imseih writes: > However, I think any GUC that can influence the planner > should be considered for consistency in behavior. > It was mentioned above with the enable_* GUCs, but another > one I can think of is the max_parallel_workers_per_gather which > should then force a re-plan if changed.

Re: Log connection establishment timings

2025-02-28 Thread Melanie Plageman
On Fri, Feb 28, 2025 at 12:16 AM Bertrand Drouvot wrote: > > Yup but my idea was to put all those line: > > " > if (Log_connections && > (child_type == B_BACKEND || child_type == B_WAL_SENDER)) > { > instr_time fork_time = ((BackendStartupData *) > startup_data)->fork_tim

Re: Trigger more frequent autovacuums of heavy insert tables

2025-02-28 Thread Nathan Bossart
On Wed, Feb 26, 2025 at 04:48:20PM -0500, Melanie Plageman wrote: > Makes sense. Thanks Robert and Nathan. Attached v11 changes the docs > wording and is rebased. 0001 LGTM. > > - Specifies a fraction of the table size to add to > - autovacuum_vacuum_insert_threshold > -

Re: Proposal: Limitations of palloc inside checkpointer

2025-02-28 Thread Maxim Orlov
After done some testing, I found a bug in the patch. If more requests were pushed while we release the lock, num_requests could not be set to zero. Here is a fixed version. -- Best regards, Maxim Orlov. v2-0001-AbsorbSyncRequests-incrementally-instead-of-doing.patch Description: Binary data

Re: [BUG]: the walsender does not update its IO statistics until it exits

2025-02-28 Thread Michael Paquier
On Fri, Feb 28, 2025 at 02:41:34PM +0900, Michael Paquier wrote: > With smaller records, the loop can become hotter, can't it? Also, > there can be a high number of WAL senders on a single node, and I've > heard of some customers with complex logical decoding deployments with > dozens of logical W

Re: Update docs for UUID data type

2025-02-28 Thread Masahiko Sawada
On Thu, Feb 27, 2025 at 5:50 PM Andy Alsup wrote: > > Masahiko, > > I have combined the gen_random_uuid() and uuidv4() into a single row, as you > suggested. Please find the v5 patch, which has been squashed into a single > commit. Thank you for updating the patch! I like that the patch adds t

Re: Enhancing Memory Context Statistics Reporting

2025-02-28 Thread Daniel Gustafsson
> On 24 Feb 2025, at 13:46, Rahila Syed wrote: > PFA the updated and rebased patches. Thanks for the rebase, a few mostly superficial comments from a first read-through. I'll do some more testing and playing around with it for functional comments. + ... + child contexts' statistics, with num

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

2025-02-28 Thread Masahiko Sawada
On Fri, Feb 28, 2025 at 1:58 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Fri, 28 Feb 2025 11:50:39 -0800, > Masahiko Sawada wrote: > > > I initially thought it would be acceptable to stop > > NextCopyFromRawFields ex

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

2025-02-28 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Fri, 28 Feb 2025 11:50:39 -0800, Masahiko Sawada wrote: > I initially thought it would be acceptable to stop > NextCopyFromRawFields exposed since NextCopyFrom() could serve as an > alternative. For example

Re: Space missing from EXPLAIN output

2025-02-28 Thread Fabrízio de Royes Mello
On Fri, Feb 28, 2025 at 4:48 PM Ilia Evdokimov < ilya.evdoki...@tantorlabs.com> wrote: > > On 28.02.2025 21:08, Robert Haas wrote: > > On Fri, Feb 28, 2025 at 12:12 PM Thom Brown wrote: > >> Rebased and attached. > > Thanks, committed. Sorry for the mistake and thanks for the patch. > > > > Hi ha

Re: Statistics Import and Export: difference in statistics dumped

2025-02-28 Thread Jeff Davis
On Fri, 2025-02-28 at 14:51 +0530, Ashutosh Bapat wrote: > 2. We aren't restoring the statistics faithfully - as mentioned in > Greg's reply. If users dump and restore with autovacuum turned off, > they will be surprised to see the statistics to be different on the > original and restored database

Re: optimize file transfer in pg_upgrade

2025-02-28 Thread Nathan Bossart
On Fri, Feb 28, 2025 at 03:37:49PM -0500, Robert Haas wrote: > On Fri, Feb 28, 2025 at 3:01 PM Nathan Bossart > wrote: >> That's exactly where I landed (see v3-0002). I haven't measured whether >> transferring relfilenodes or dumping the sequence data is faster for the >> existing modes, but for

Re: jsonb_strip_nulls with arrays?

2025-02-28 Thread Florents Tselai
> On 20 Feb 2025, at 12:18 AM, Andrew Dunstan wrote: > > > > On 2025-02-19 We 4:23 PM, Florents Tselai wrote: >> >> >>> On 18 Jan 2025, at 11:51 AM, Florents Tselai >>> wrote: >>> >>> >>> On 8 Jan 2025, at 6:45 PM, Andrew Dunstan

Re: Statistics Import and Export

2025-02-28 Thread Nathan Bossart
On Fri, Feb 28, 2025 at 12:54:03PM -0800, Jeff Davis wrote: > (Aside: I assume everyone here agrees that pg_upgrade should transfer > the stats by default.) That feels like a safe assumption to me... I'm curious what the use-case is for pg_upgrade's --no-statistics option. -- nathan

Re: Restrict copying of invalidated replication slots

2025-02-28 Thread Masahiko Sawada
On Thu, Feb 27, 2025 at 7:26 PM Amit Kapila wrote: > > On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada wrote: > > > > On Thu, Feb 27, 2025 at 12:52 AM Amit Kapila > > wrote: > > > > > > On Thu, Feb 27, 2025 at 10:47 AM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, Feb 25, 2025 at 7:33 

Re: Statistics Import and Export

2025-02-28 Thread Corey Huinker
On Fri, Feb 28, 2025 at 4:25 PM Jeff Davis wrote: > On Fri, 2025-02-28 at 14:56 -0600, Nathan Bossart wrote: > > On Fri, Feb 28, 2025 at 12:54:03PM -0800, Jeff Davis wrote: > > > (Aside: I assume everyone here agrees that pg_upgrade should > > > transfer > > > the stats by default.) > > > > That

Re: Log connection establishment timings

2025-02-28 Thread Melanie Plageman
On Fri, Feb 28, 2025 at 12:54 AM Bertrand Drouvot wrote: > > On Thu, Feb 27, 2025 at 05:55:19PM -0500, Melanie Plageman wrote: > > It still needs polishing (e.g. I need to figure out where to put the new > > guc hook > > functions and enums and such) > > yeah, I wonder if it would make sense to c

Re: Should work_mem be stable for a prepared statement?

2025-02-28 Thread Sami Imseih
> The argument for treating work_mem specially is that it has effects at > both plan time and run time, so that the planner's cost assumptions > are invalidated if the executor uses a different value than the > planner did. I see that now. Thanks! > Maybe that refactoring is one that would conven

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-02-28 Thread Alvaro Herrera
On 2025-Feb-21, Suraj Kharage wrote: > Thanks, Alvaro. > > I have revised the patch as per your last update. > Please find attached v5 for further review. Hello I noticed two issues. One is that we are OK to modify a constraint that's defined in our parent, which breaks everything. We can onl

Re: [18] CREATE SUBSCRIPTION ... SERVER

2025-02-28 Thread Jeff Davis
On Mon, 2024-12-16 at 20:05 -0800, Jeff Davis wrote: > On Wed, 2024-10-30 at 08:08 -0700, Jeff Davis wrote: > Rebased v14. The approach has changed multiple times. It starte off with more in- core code, but in response to review feedback, has become more decoupled from core and more coupled to p

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-28 Thread Jacob Champion
On Fri, Feb 28, 2025 at 9:37 AM Jacob Champion wrote: > Just from inspection, that looks good to me. I'll look into running > the new BSD tasks on the other patches I posted above, too. After your patch gets us past the zero timeout bug, NetBSD next runs into failed to fetch OpenID discovery

Re: Space missing from EXPLAIN output

2025-02-28 Thread Ilia Evdokimov
On 28.02.2025 21:08, Robert Haas wrote: On Fri, Feb 28, 2025 at 12:12 PM Thom Brown wrote: Rebased and attached. Thanks, committed. Sorry for the mistake and thanks for the patch. Hi hackers, First of all, sorry about the space issue - that was my oversight. I also just noticed another d

making EXPLAIN extensible

2025-02-28 Thread Robert Haas
Prior to PostgreSQL 10, EXPLAIN had just 2 options: VACUUM and ANALYZE. Now, we're up to 12 options, which is already quite a lot, and there's plenty more things that somebody might like to do. However, not all of those things necessarily need to be part of the core code. My original reason for wan

Re: optimize file transfer in pg_upgrade

2025-02-28 Thread Nathan Bossart
On Fri, Feb 28, 2025 at 02:41:22PM -0500, Robert Haas wrote: > On Fri, Feb 28, 2025 at 2:40 PM Robert Haas wrote: >> Maybe we should rethink the decision not to transfer relfilenodes for >> sequences. Or have more than one way to do it. pg_upgrade >> --binary-upgrade --binary-upgrade-even-for-sequ

Re: Should work_mem be stable for a prepared statement?

2025-02-28 Thread Sami Imseih
> It sounds like the behavior change would be desirable or at least > neutral. I will have to try it out and see if the refactoring is a net > improvement or turns into a mess. I think this is a good operational improvement, particularly if someone wants to change work_mem in a pinch, and the only

Re: Update docs for UUID data type

2025-02-28 Thread Andy Alsup
Masahiko, I like the change you've made. Thanks, Andy Alsup On Fri, Feb 28, 2025 at 2:05 PM Masahiko Sawada wrote: > On Thu, Feb 27, 2025 at 5:50 PM Andy Alsup wrote: > > > > Masahiko, > > > > I have combined the gen_random_uuid() and uuidv4() into a single row, as > you suggested. Please fin

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

2025-02-28 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Fri, 28 Feb 2025 14:00:18 -0800, Masahiko Sawada wrote: > Yes, I've submitted the patch to re-export that function[1]. Could you > review it? > > [1] > https://www.postgresql.org/message-id/CAD21AoBA414Q7

Re: making EXPLAIN extensible

2025-02-28 Thread Isaac Morland
On Fri, 28 Feb 2025 at 15:09, Thom Brown wrote: > One thing I am wondering is whether extensions should be required to > prefix their EXPLAIN option with the extension name to avoid > collisions. > > If two extensions happen to choose the same name, it won't be possible > to use both simultaneou

Re: Trigger more frequent autovacuums of heavy insert tables

2025-02-28 Thread wenhui qiu
Hi > + * It could be the stats were updated manually and relallfrozen > > + * relpages. Clamp relallfrozen to relpages to avoid nonsensical > + * calculations. > + */ > + relallfrozen = Min(relallfrozen, relpages); > + pcnt_unfrozen = 1 - ((float4) relallfrozen / relpages); > + } > + Based on the c

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2025-02-28 Thread Jacob Champion
On Fri, Feb 14, 2025 at 5:34 PM Jacob Champion wrote: > (But it doesn't > seem like we're going to agree on this for now; in the meantime I'll > prepare a version of the patch that only calls > pgstat_bestart_security() once.) v9 removes the first call, and moves the second (now only) call up and

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

2025-02-28 Thread Sutou Kouhei
Hi, Our 0001/0002 patches were merged into master. I've rebased on master. Can we discuss how to proceed rest patches? The contents of them aren't changed but I'll show a summary of them again: 0001-0003 are for COPY TO and 0004-0007 are for COPY FROM. For COPY TO: 0001: Add support for adding

Re: Orphaned users in PG16 and above can only be managed by Superusers

2025-02-28 Thread Ashutosh Sharma
Added a commitfest entry for this here: https://commitfest.postgresql.org/patch/5608/ -- With Regards, Ashutosh Sharma. On Tue, Feb 18, 2025 at 2:54 PM Ashutosh Sharma wrote: > > Hi Robert, > > On Tue, Feb 11, 2025 at 9:48 PM Ashutosh Sharma wrote: > > > > Hi Robert, > > > > On Tue, Feb 4, 202

Re: Introduce "log_connection_stages" setting.

2025-02-28 Thread Sergey Dudoladov
Hello hackers, here is the new rebased version of the patch. Regards, Sergey From 8a695aacfd9590737a6e10aca8ddf33181806937 Mon Sep 17 00:00:00 2001 From: Sergey Dudoladov Date: Fri, 28 Feb 2025 10:33:11 +0100 Subject: [PATCH] Introduce log_connection_messages This patch removes 'log_connections

Re: Statistics Import and Export: difference in statistics dumped

2025-02-28 Thread Ashutosh Bapat
Hi Jeff, I am changing the subject on this email and thus creating a new thread to discuss this issue. On Fri, Feb 28, 2025 at 8:02 AM Jeff Davis wrote: > > On Tue, 2025-02-25 at 11:11 +0530, Ashutosh Bapat wrote: > > So the dumped statistics are not restored exactly. The reason for > > this > >

Re: Small memory fixes for pg_createsubcriber

2025-02-28 Thread Ranier Vilela
Em qui., 27 de fev. de 2025 às 22:19, Michael Paquier escreveu: > On Thu, Feb 27, 2025 at 10:23:31AM -0300, Ranier Vilela wrote: > > Yeah, I also think it would look good like this. > > It's the least confusing option, indeed. I've reduced a bit the diffs > and done that down to v16 for the pg_u

Re: Proposal: Limitations of palloc inside checkpointer

2025-02-28 Thread Maxim Orlov
Here is an alternative solution. We can limit the number of processed requests to fit in a 1Gb memory chunk for each pass. Obviously, we left some requests in the queue to be processed in the next call. We can overcome this by using multi-step processing: estimating the number of steps in the begin

Re: Extend postgres_fdw_get_connections to return remote backend pid

2025-02-28 Thread Fujii Masao
On 2025/02/28 15:10, Sagar Shedge wrote: For now, I think it makes sense to keep postgres_fdw_get_connections() aligned with the current implementation. Otherwise, explaining what remote_backend_pid = NULL means could be confusing, especially since pipeline mode isn't supported yet in postgres_

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

2025-02-28 Thread m . litsarev
Hi, Fix an error in the patch. Respectfully, Mikhail Litsarev, Postgres Professional: https://postgrespro.com From d96d322e9c146e35ef1a5c3168109d3b059585f7 Mon Sep 17 00:00:00 2001 From: Mikhail Litsarev Date: Fri, 10 Jan 2025 21:23:02 +0300 Subject: [PATCH v6 1/2] Replace recovery boolean fla

Re: doc: create table improvements

2025-02-28 Thread Laurenz Albe
On Wed, 2024-04-24 at 07:45 -0700, David G. Johnston wrote: > On Wed, Apr 24, 2024 at 3:30 AM Peter Eisentraut wrote: > >  > +   The reliability characteristics of a table are governed by its > >  > +   persistence mode.  The default mode is described > >  > +   here > >  > +   There are two alter

Re: [PATCH] Add regression tests of ecpg command notice (error / warning)

2025-02-28 Thread Fujii Masao
On 2025/02/28 9:24, Ryo Kanbayashi wrote: I have rewrote my patch on TAP test sttyle :) File for build are also updated. Thanks for updating the patch! +'tests': [ + 't/001_ecpg_notice.pl', + 't/002_ecpg_notice_informix.pl', Since neither test emits "notice" messages, shouldn

Re: Adding NetBSD and OpenBSD to Postgres CI

2025-02-28 Thread Thomas Munro
On Tue, Feb 18, 2025 at 11:33 AM Thomas Munro wrote: > Maybe we could try this? > > https://man.netbsd.org/mount_tmpfs.8 > https://man.openbsd.org/mount_tmpfs.8 NetBSD's test_world: 10:30 -> 3:23 OpenBSD test_world: 15:45 - >9:10 I think NetBSD would finish around 2nd place if turned on by defau

Re: Licence preamble update

2025-02-28 Thread Tom Lane
Noah Misch writes: > On Thu, Feb 27, 2025 at 04:56:05PM +, Dave Page wrote: >> --- a/COPYRIGHT >> +++ b/COPYRIGHT >> @@ -1,5 +1,5 @@ >> PostgreSQL Database Management System >> -(formerly known as Postgres, then as Postgres95) >> +(also known as Postgres, formerly as Postgres95) >> >> Portion

Re: Space missing from EXPLAIN output

2025-02-28 Thread Thom Brown
On Fri, 28 Feb 2025 at 16:54, Fabrízio de Royes Mello wrote: > > > On Fri, Feb 28, 2025 at 1:38 PM Thom Brown wrote: >> >> Hi, >> >> Commit ddb17e387aa introduced fractional row counts, but the rejigging >> has introduced a formatting issue: >> >> Worker 0: actual time=34.779..34.780rows=0 loops

Re: moving some code out of explain.c

2025-02-28 Thread Robert Haas
On Fri, Feb 28, 2025 at 9:52 AM Robert Haas wrote: > On Thu, Feb 27, 2025 at 4:48 PM Tom Lane wrote: > > Oversight I assume? > > Yeah, that was dumb. Thanks for catching it. Here's v3. Committed so I can see what the buildfarm thinks before it gets too late in the day. -- Robert Haas EDB: http

Re: Amcheck verification of GiST and GIN

2025-02-28 Thread Mark Dilger
> So, we have an entry tree page, where there is tuple on offset 80, > with gin tuple category = 3, and then it goes category 0 again. And > one more such pattern on the same page. > The ginCompareEntries function compares the gin tuples category first. > I do not understand how this would be a val

Space missing from EXPLAIN output

2025-02-28 Thread Thom Brown
Hi, Commit ddb17e387aa introduced fractional row counts, but the rejigging has introduced a formatting issue: Worker 0: actual time=34.779..34.780rows=0 loops=1 Buffers: shared hit=1200 Worker 1: actual time=39.737..39.738rows=0 loops=1 Buffers: shared hit=1084 A space is missing between t

Re: Proposal: Limitations of palloc inside checkpointer

2025-02-28 Thread Maxim Orlov
I think I figured it out. Here is v4. If the number of requests is less than 1 GB, the algorithm stays the same as before. If we need to process more, we will do it incrementally with slices of 1 GB. Best regards, Maxim Orlov. v4-0001-Process-sync-requests-incrementally-in-AbsorbSync.patch Desc

Re: Space missing from EXPLAIN output

2025-02-28 Thread Fabrízio de Royes Mello
On Fri, Feb 28, 2025 at 1:38 PM Thom Brown wrote: > Hi, > > Commit ddb17e387aa introduced fractional row counts, but the rejigging > has introduced a formatting issue: > > Worker 0: actual time=34.779..34.780rows=0 loops=1 > Buffers: shared hit=1200 > Worker 1: actual time=39.737..39.738rows=

Re: [PATCH] New predefined role pg_manage_extensions

2025-02-28 Thread Michael Banck
Hi, On Fri, Jan 17, 2025 at 10:03:17AM +0100, Laurenz Albe wrote: > On Thu, 2024-10-31 at 22:47 +0100, Michael Banck wrote: > > Even though there has not been a lot of discussion on this, here is a > > rebased patch.  I have also added it to the upcoming commitfest. > > I had a look at the patch.

Re: Disabling vacuum truncate for autovacuum

2025-02-28 Thread Nathan Bossart
On Thu, Feb 27, 2025 at 08:29:16PM -0800, Gurjeet Singh wrote: > On Mon, Jan 27, 2025 at 1:55 AM Laurenz Albe wrote: >> I hope it is possible to override the global setting with the >> "vacuum_truncate" >> option on an individual table. > > Current patch behaviour is that if the autovacuum_vacuu

Re: Lowering temp_buffers minimum

2025-02-28 Thread Matthias van de Meent
On Tue, 25 Feb 2025 at 15:33, Andres Freund wrote: > It seems rather odd that our minimum for temp_buffers is 100 while the minimum > for shared_buffers, which is shared across connections!, is 16. Hmm, given that, I'd say we also increase that minimum shared_buffers to a value >= 33 as the highe

Re: moving some code out of explain.c

2025-02-28 Thread Robert Haas
On Thu, Feb 27, 2025 at 4:48 PM Tom Lane wrote: > Oversight I assume? Yeah, that was dumb. Thanks for catching it. Here's v3. -- Robert Haas EDB: http://www.enterprisedb.com v3-0001-Avoid-including-explain.h-in-explain_format.h-and.patch Description: Binary data

Re: Introduce "log_connection_stages" setting.

2025-02-28 Thread Melanie Plageman
On Fri, Feb 28, 2025 at 5:04 AM Bertrand Drouvot wrote: > > Did not realized that before but FWIW, it looks "very close" to what Melanie > is > doing in [1] (0001 patch). Idea looks similar excepts, among other things, > that > log_connections is kept. Oh wow, yes, I never saw this thread. I pr

Re: Add Pipelining support in psql

2025-02-28 Thread Daniel Verite
Anthonin Bonnefoy wrote: > > What is the reasoning here behind this restriction? \gx is a wrapper > > of \g with expanded mode on, but it is also possible to call \g with > > expanded=on, bypassing this restriction. > > The issue is that \gx enables expanded mode for the duration of the

Re: Incorrect result of bitmap heap scan.

2025-02-28 Thread Matthias van de Meent
On Tue, 7 Jan 2025 at 18:46, Matthias van de Meent wrote: > > Hi, > > I've rebased my earlier patch to fix some minor conflicts with the > work done on bitmaps in December last year. I've also included Andres' > cursor-based isolation test as 0002; which now passes. Rebased again, now on top of h

Re: Changing shared_buffers without restart

2025-02-28 Thread Ashutosh Bapat
On Tue, Feb 25, 2025 at 3:22 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Fri, Oct 18, 2024 at 09:21:19PM GMT, Dmitry Dolgov wrote: > > TL;DR A PoC for changing shared_buffers without PostgreSQL restart, via > > changing shared memory mapping layout. Any feedback is appreciated. > > Hi,

Re: Get rid of WALBufMappingLock

2025-02-28 Thread Yura Sokolov
26.02.2025 11:52, Andrey Borodin wrote: >> On 25 Feb 2025, at 20:19, Alexander Korotkov wrote: >> >> > > > Hi! > > One little piece of code looks suspicious to me. But I was not raising > concern because I see similar code everywhere in the codebase. But know > Kirill asked to me explain what

Re: RFC: Additional Directory for Extensions

2025-02-28 Thread Matheus Alcantara
Hi On Tue, Feb 25, 2025 at 5:29 PM Matheus Alcantara wrote: > Fixed on the attached v3. > After I've sent the v3 patch I noticed that the tests were failing on windows. The problem was on TAP test that was using ":" as a separator on extension_control_path and also the path was not being escaped

Re: [BUG]: the walsender does not update its IO statistics until it exits

2025-02-28 Thread Bertrand Drouvot
Hi, On Fri, Feb 28, 2025 at 02:41:34PM +0900, Michael Paquier wrote: > On Wed, Feb 26, 2025 at 09:48:50AM +, Bertrand Drouvot wrote: > > Yeah I think that makes sense, done that way in the attached. > > > > Speaking about physical walsender, I moved the test to 001_stream_rep.pl > > instead

Re: long-standing data loss bug in initial sync of logical replication

2025-02-28 Thread Benoit Lobréau
Hi, It took me a while but I ran the test on my laptop with 20 runs per test. I asked for a dedicated server and will re-run the tests if/when I have it. count of partitions | Head (sec) |Fix (sec) |Degradation (%)

Re: bug: ALTER TABLE ADD VIRTUAL GENERATED COLUMN with table rewrite

2025-02-28 Thread Srinath Reddy
Hi, I have applied the patch and verified,and patch LGTM. Thanks and regards Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/

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

2025-02-28 Thread m . litsarev
Hi! Rebased the patch. Respectfully, Mikhail Litsarev, Postgres Professional: https://postgrespro.comFrom 67b190ce15f8ba7480ba1691b804b27f96fd5540 Mon Sep 17 00:00:00 2001 From: Mikhail Litsarev Date: Fri, 10 Jan 2025 21:23:02 +0300 Subject: [PATCH v5 1/2] Replace recovery boolean flags with a

Re: Get rid of WALBufMappingLock

2025-02-28 Thread Michael Paquier
On Fri, Feb 28, 2025 at 02:13:23PM +0100, Álvaro Herrera wrote: > On 2025-Feb-28, Michael Paquier wrote: >> Saying that, I have also done similar tests with your v12 for a couple >> of hours and this looks stable under installcheck-world. I can see >> that you've reworked quite a bit the surroundi

Re: per backend WAL statistics

2025-02-28 Thread Bertrand Drouvot
Hi, On Fri, Feb 28, 2025 at 11:34:14AM +0900, Michael Paquier wrote: > On Thu, Feb 27, 2025 at 07:47:09AM +, Bertrand Drouvot wrote: > > That's how I did it initially but decided to move it to pgstat_backend.c. > > The > > reason was that it's fully linked to "per backend" stats and that ther

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

2025-02-28 Thread Tatsuo Ishii
>> BTW, I noticed that in the code path where >> ignorenulls_getfuncarginframe() is called, WinSetMarkPosition() is >> never called? >> >> Attached version uses the mark_pos at the end. I did simple performance test against v8. EXPLAIN ANALYZE SELECT x, nth_value(x,2) IGNORE NULLS OVER w FROM g

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-02-28 Thread Shubham Khanna
On Thu, Feb 20, 2025 at 4:56 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Shubham, > > Thanks for updating the patch quickly! > > > > 04. > > > ``` > > > +# Verify that only user databases got subscriptions (not template > > > databases) > > > +my @user_dbs = ($db1, $db2); > > > +foreach my $dbname

Re: SIMD optimization for list_sort

2025-02-28 Thread John Naylor
On Fri, Feb 28, 2025 at 12:43 PM R, Rakshit wrote: > > I don't think "another extension might use it someday" makes a very strong > > case, > > particularly for something that requires a new dependency. > > The x86-simdsort library is an optional dependency in Postgres. Also the new > list sort

Re: explain analyze rows=%.0f

2025-02-28 Thread Ilia Evdokimov
On 27.02.2025 19:51, Robert Haas wrote: On Mon, Feb 24, 2025 at 2:16 PM Robert Haas wrote: On Mon, Feb 24, 2025 at 12:12 PM Ilia Evdokimov wrote: If no one is concerned about rows being a non-integer, then I support this, as it's quite strange for the average rows to be an integer only for

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-02-28 Thread Shubham Khanna
On Fri, Feb 21, 2025 at 9:44 AM Ashutosh Bapat wrote: > > On Fri, Feb 21, 2025 at 5:18 AM Peter Smith wrote: > > > > On Thu, Feb 20, 2025 at 10:26 PM Hayato Kuroda (Fujitsu) > > wrote: > > > > > > Dear Shubham, > > > > > > Thanks for updating the patch quickly! > > > > > > > > 04. > > > > > ```

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-28 Thread Thomas Munro
Hi, If you trigger the new optional NetBSD CI task, the oauthvalidator tests implode[1]. Apparently that OS's kevent() doesn't like zero relative timeouts for EVFILT_TIMER[2]. I see that you worked around the same problem for Linux timerfd already by rounding 0 up to 1, so we could just do the s

Re: Simplify the logic a bit (src/bin/scripts/reindexdb.c)

2025-02-28 Thread Ranier Vilela
Hi Álvaro. Em qui., 27 de fev. de 2025 às 16:50, Álvaro Herrera < alvhe...@alvh.no-ip.org> escreveu: > On 2025-Feb-14, Ranier Vilela wrote: > > > Attached is the prototype version v1. > > What do you think? > > I think this is still a bit confused. The new function's comment says > "prepare the

Re: Implement waiting for wal lsn replay: reloaded

2025-02-28 Thread Yura Sokolov
28.02.2025 16:03, Yura Sokolov пишет: > 17.02.2025 00:27, Alexander Korotkov wrote: >> On Thu, Feb 6, 2025 at 10:31 AM Yura Sokolov >> wrote: >>> I briefly looked into patch and have couple of minor remarks: >>> >>> 1. I don't like `palloc` in the `WaitLSNWakeup`. I believe it wont issue >>> prob

Re: long-standing data loss bug in initial sync of logical replication

2025-02-28 Thread Amit Kapila
On Fri, Feb 28, 2025 at 6:15 AM Masahiko Sawada wrote: > > On Thu, Feb 27, 2025 at 12:14 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Monday, February 24, 2025 5:50 PM Amit Kapila > > wrote: > > > > > > On Wed, Dec 11, 2024 at 12:37 PM Masahiko Sawada > > > wrote: > > > > > > > > I confirmed th

Re: long-standing data loss bug in initial sync of logical replication

2025-02-28 Thread Amit Kapila
On Fri, Feb 28, 2025 at 9:45 AM Amit Kapila wrote: > > On Fri, Feb 28, 2025 at 6:15 AM Masahiko Sawada wrote: > > > > On Thu, Feb 27, 2025 at 12:14 AM Zhijie Hou (Fujitsu) > > > > > > I think distributing invalidations to a transaction that has not yet > > > built a > > > base snapshot is un-nec

Re: Improve CRC32C performance on SSE4.2

2025-02-28 Thread John Naylor
Hi Raghuveer, You raised some interesting points, which deserve a thoughtful response. After sleeping on it, however I came to the conclusion that a sweeping change in runtime checks, with either of our approaches, has downsides and unresolved questions. Perhaps we can come back to it at a later t

Reduce the instruction overhead of OpenSSL calls

2025-02-28 Thread ryanewang(王蕾)
Hi, From the openssl documentation, when the value of ret is greater than 0, the SSL_get_error() function returns SSL_ERROR_NONE.  So, it seems that when the return value of SSL_read() or SSL_write() function is greater than 0, we don't need to make an error judgment.  The attached patch attempts

Re: Add “FOR UPDATE NOWAIT” lock details to the log.

2025-02-28 Thread Yuki Seino
On 2025/02/27 15:44, Yuki Seino wrote: (4) https://github.com/postgres/postgres/blob/master/src/backend/access/heap/heapam_handler.c#L463 ...I don't know how to reproduce it. I have confirmed that (4) can be reproduced using the following procedure. (4) https://github.com/postgres/postgres

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

2025-02-28 Thread Alena Rybakina
Hi! On 21.02.2025 00:09, Alena Rybakina wrote: Hi! On 09.02.2025 18:38, Alexander Korotkov wrote: Also, aren't we too restrictive while requiring is_simple_values_sequence()? For instance, I believe cases like this (containing Var) could be transformed too. select * from t t1, lateral (sele

Re: per backend WAL statistics

2025-02-28 Thread Michael Paquier
On Fri, Feb 28, 2025 at 09:26:08AM +, Bertrand Drouvot wrote: > Also attaching the patch I mentioned up-thread to address some of Rahila's > comments ([1]): It adds a AuxiliaryPidGetProc() call in > pgstat_fetch_stat_backend_by_pid() > and pg_stat_reset_backend_stats(). I think that fully make

Re: Get rid of WALBufMappingLock

2025-02-28 Thread Yura Sokolov
26.02.2025 14:48, Alexander Korotkov пишет: > Hi, Michael! > > On Wed, Feb 26, 2025 at 3:04 AM Michael Paquier wrote: >> >> On Tue, Feb 25, 2025 at 05:19:29PM +0200, Alexander Korotkov wrote: >>> It seems that I managed to reproduce the issue on my Raspberry PI 4. >>> After running our test suite

Re: Extend postgres_fdw_get_connections to return remote backend pid

2025-02-28 Thread Sagar Shedge
Hi Fujii, Thanks for updates. Looks good to me. We can proceed with latest potch. -- Sagar Dilip Shedge, SDE AWS

Re: long-standing data loss bug in initial sync of logical replication

2025-02-28 Thread Amit Kapila
On Mon, Feb 24, 2025 at 4:49 PM Shlok Kyal wrote: > > Patches need a rebase. Attached the rebased patch. > I would like to discuss 0002 patch: publication_invalidation_cb(Datum arg, int cacheid, uint32 hashvalue) { publications_valid = false; - - /* - * Also invalidate per-relation cache so t

RE: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-02-28 Thread Hayato Kuroda (Fujitsu)
Dear Shubham, Thanks for updating the patch. I think the modification [1] is not correct - the loop is meaningless because the same query would be executed every time. How about idea like attached? Here, instead of try escaping dbname, dbname is directly obtained from the instance and they are

Re: Implement waiting for wal lsn replay: reloaded

2025-02-28 Thread Yura Sokolov
17.02.2025 00:27, Alexander Korotkov wrote: > On Thu, Feb 6, 2025 at 10:31 AM Yura Sokolov wrote: >> I briefly looked into patch and have couple of minor remarks: >> >> 1. I don't like `palloc` in the `WaitLSNWakeup`. I believe it wont issue >> problems, but still don't like it. I'd prefer to see

Re: Add “FOR UPDATE NOWAIT” lock details to the log.

2025-02-28 Thread Fujii Masao
On 2025/02/28 21:08, Yuki Seino wrote: On 2025/02/27 15:44, Yuki Seino wrote: (4) https://github.com/postgres/postgres/blob/master/src/backend/access/heap/heapam_handler.c#L463 ...I don't know how to reproduce it. I have confirmed that (4) can be reproduced using the following procedure.

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-02-28 Thread Shubham Khanna
On Fri, Feb 21, 2025 at 5:18 AM Peter Smith wrote: > > On Thu, Feb 20, 2025 at 10:26 PM Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Shubham, > > > > Thanks for updating the patch quickly! > > > > > > 04. > > > > ``` > > > > +# Verify that only user databases got subscriptions (not template > >

Re: Get rid of WALBufMappingLock

2025-02-28 Thread Álvaro Herrera
On 2025-Feb-28, Michael Paquier wrote: > Saying that, I have also done similar tests with your v12 for a couple > of hours and this looks stable under installcheck-world. I can see > that you've reworked quite a bit the surroundings of InitializedFrom > in this one. If you apply that once again

Re: Introduce "log_connection_stages" setting.

2025-02-28 Thread Bertrand Drouvot
Hi, On Fri, Feb 28, 2025 at 10:40:37AM +0100, Sergey Dudoladov wrote: > Hello hackers, > > here is the new rebased version of the patch. > Thanks for the patch! Did not realized that before but FWIW, it looks "very close" to what Melanie is doing in [1] (0001 patch). Idea looks similar excepts

  1   2   >