Re: plan shape work

2025-09-25 Thread Richard Guo
On Fri, Sep 26, 2025 at 11:37 AM Tom Lane wrote: > Richard Guo writes: > > FWIW, I'm a bit concerned about the double for loop inside > > choose_plan_name(), especially since the outer loop runs with a true > > condition. Maybe I'm just worrying over nothing, as we probably don't > > expect a la

Re: Add memory_limit_hits to pg_stat_replication_slots

2025-09-25 Thread Chao Li
Hi Bertrand, Thanks for the patch. The patch overall goods look to me. Just a few small comments: > On Sep 25, 2025, at 18:17, Bertrand Drouvot > wrote: > > 1. ``` --- a/src/include/replication/reorderbuffer.h +++ b/src/include/replication/reorderbuffer.h @@ -690,6 +690,9 @@ struct Reorder

Mark function arguments of type "Datum *" as "const Datum *" where possible

2025-09-25 Thread Chao Li
Hi Hackers, I noticed that many functions take "Datum *" parameters while they don't update the data. So I created this patch to change "Datum *" to "const Datum *" wherever possible, which should improve type safety and make the interfaces clearer about their intent, also helps the compiler catch

Re: GNU/Hurd portability patches

2025-09-25 Thread Michael Banck
Hi, On Thu, Sep 25, 2025 at 12:52:33PM -0400, Tom Lane wrote: > In short, your patch looks good and I'll go apply it with a slightly > smaller delay parameter. Great, thanks! I let my VM run for a few thousand iterations with that timeout and so far there were no failures. Michael

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

2025-09-25 Thread shveta malik
On Fri, Sep 26, 2025 at 12:46 AM Masahiko Sawada wrote: > > On Thu, Sep 25, 2025 at 4:57 AM shveta malik wrote: > > > > On Tue, Sep 23, 2025 at 3:28 AM Masahiko Sawada > > wrote: > > > > > > > > > I've attached the updated patch. It incorporates all comments I got so > > > far and implements to

Re: Add memory_limit_hits to pg_stat_replication_slots

2025-09-25 Thread Bertrand Drouvot
Hi, On Thu, Sep 25, 2025 at 12:14:04PM -0700, Masahiko Sawada wrote: > On Thu, Sep 25, 2025 at 3:17 AM Bertrand Drouvot > wrote: > > > > That probably means that mem_exceeded_count would need to be increased. > > > > What do you think? > > Right. But one might argue that if we increment mem_exce

Re: Remove unused for_all_tables field from AlterPublicationStmt

2025-09-25 Thread Michael Paquier
On Fri, Sep 26, 2025 at 09:24:03AM +0800, Chao Li wrote: > On Sep 26, 2025, at 04:47, Masahiko Sawada wrote: >> I found that the for_all_table field in the AlterPublicationStmt is >> not used at all unless I'm missing something. I've attached the patch >> for only master that removes it. > > Yep,

Re: Add support for entry counting in pgstats

2025-09-25 Thread Michael Paquier
On Thu, Sep 25, 2025 at 07:47:48PM -0500, Sami Imseih wrote: > I spent a bit of time testing this with a pg_stat_statements like extension > using a custom stats kind, and while I think there is value for both "live" > ( ! ->dropped) counter and an exact dshash counter ( current proposal), > I rath

Re: [PATCH] Write Notifications Through WAL

2025-09-25 Thread Rishu Bagga
Attached a new patch that resolves failing tests reported by cfbot. There were still some failing tests on cfbot - related to expecting new pages to be zeroed in the notify queue, but since we only write a single compact notify record in a transaction, regardless of the size or number of notificat

Re: Optimize LISTEN/NOTIFY

2025-09-25 Thread Chao Li
> On Sep 26, 2025, at 05:13, Joel Jacobson wrote: > > Hmm, I don't see how duplicate timeout could happen? > > Once we decide to defer the wakeup, wakeup_pending_flag remains set, > which avoids further signals from notifiers, so I don't see how we could > re-enter ProcessIncomingNotify(), sin

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

2025-09-25 Thread Tom Lane
=?utf-8?B?6YKx5a6H6Iiq?= writes: > And what about the query 2. This is caused by another commit, and > it's not mentioned in the commit message or the mailing discussion. That one indeed seems quite broken. EXPLAIN confirms that it's pushing the HAVING below the aggregation, which is simply wron

Re: Mark ItemPointer arguments as const thoughoutly

2025-09-25 Thread Chao Li
On Wed, Sep 10, 2025 at 1:20 PM Chao Li wrote: > > > On Sep 10, 2025, at 12:20, Chao Li wrote: > > v2 tries to fix the CI failure. > > Chao Li (Evan) > - > HighGo Software Co., Ltd. > https://www.highgo.com/ > > > > > Here is the CF patch https://commitfest.postgresql.org/pa

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

2025-09-25 Thread Yugo Nagata
On Thu, 25 Sep 2025 10:27:44 +0200 Anthonin Bonnefoy wrote: > Hi, > > The patch looks good, I've spotted some typos in the doc. > > +Allows clients to continue their run even if an SQL statement > fails due to > +errors other than serialization or deadlock. Unlike > serializatio

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

2025-09-25 Thread Yugo Nagata
On Thu, 25 Sep 2025 17:17:36 +0800 Chao Li wrote: > Hi Yugo, > > Thanks for the patch. After reviewing it, I got a few small comments: Thank you for your reviewing and comments. > > On Sep 25, 2025, at 15:22, Yugo Nagata wrote: > > > > -- > > Yugo Nagata mailto:[email protected]>> > > >

Re: issue with synchronized_standby_slots

2025-09-25 Thread Shlok Kyal
On Tue, 23 Sept 2025 at 09:55, Amit Kapila wrote: > > On Fri, Sep 12, 2025 at 2:34 PM Shlok Kyal wrote: > > > > I have attached the updated v4 patch > > > > +# Cannot be set synchronized_standby_slots to a reserved slot name > +($result, $stdout, $stderr) = $primary->psql('postgres', > + "ALTER S

Re: Fix overflow of nbatch

2025-09-25 Thread Tomas Vondra
On 9/23/25 02:02, David Rowley wrote: > On Tue, 23 Sept 2025 at 09:31, Tomas Vondra wrote: >> On 9/22/25 22:45, David Rowley wrote: >>> I think a1b4f289b mistakenly thought that there'd be size_t arithmetic >>> in the following two lines because the final result is a size_t: >>> >>> size_t current

Re: plan shape work

2025-09-25 Thread Tom Lane
Richard Guo writes: > FWIW, I'm a bit concerned about the double for loop inside > choose_plan_name(), especially since the outer loop runs with a true > condition. Maybe I'm just worrying over nothing, as we probably don't > expect a large number of subroots in practice, but the nested loops > s

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

2025-09-25 Thread Michael Paquier
On Thu, Sep 25, 2025 at 09:05:15PM -0500, Sami Imseih wrote: >> In short, I would be inclined to do nothing here, > > Maybe we document this behavior? [2] In the GUC description. Why not. The protocol piece with unnamed portal cleanup is hard to notice by itself.. -- Michael signature.asc Des

Re: plan shape work

2025-09-25 Thread Richard Guo
FWIW, I'm a bit concerned about the double for loop inside choose_plan_name(), especially since the outer loop runs with a true condition. Maybe I'm just worrying over nothing, as we probably don't expect a large number of subroots in practice, but the nested loops still make me a little uneasy.

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

2025-09-25 Thread Sami Imseih
> > After thinking about this a bit more, I found the test that breaks > > with v12. It is a bind statement in an implicit transaction. The > > portal will get dropped by the end of the transaction and will not > > reach drop_unnamed_portal. So, v13 takes Frederic's original idea, > > saves the poi

Re: plan shape work

2025-09-25 Thread Tom Lane
Robert Haas writes: > But maybe there's still some way to improve this. It would probably be > hard to make it perfect because of the fact that EXPLAIN names are > unique across all relations in the query, as noted above. However, we > might be able to make it so the names match in the absence of

Re: plan shape work

2025-09-25 Thread Robert Haas
On Thu, Sep 25, 2025 at 9:21 PM Alexandra Wang wrote: > I've tried v10-000{1,2}+v9-0002 and v9-000{1,2}. I was curious whether > the names choose_plan_name() chose for subqueries match the Subquery > Scan names in the EXPLAIN plan. My guess is that since the former is > chosen before planning and

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

2025-09-25 Thread Michael Paquier
On Fri, Sep 19, 2025 at 03:28:46PM -0500, Sami Imseih wrote: > After thinking about this a bit more, I found the test that breaks > with v12. It is a bind statement in an implicit transaction. The > portal will get dropped by the end of the transaction and will not > reach drop_unnamed_portal. So,

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

2025-09-25 Thread Yugo Nagata
On Fri, 26 Sep 2025 00:03:06 +0900 Fujii Masao wrote: > On Thu, Sep 25, 2025 at 4:22 PM Yugo Nagata wrote: > > I've attached updated patches. > > Thanks for updating the patches! > > About 0001: you mentioned that the lost error message issue occurs in > pipeline mode. > Just to confirm, are y

Re: Remove unused for_all_tables field from AlterPublicationStmt

2025-09-25 Thread Chao Li
> On Sep 26, 2025, at 04:47, Masahiko Sawada wrote: > > Hi, > > I found that the for_all_table field in the AlterPublicationStmt is > not used at all unless I'm missing something. I've attached the patch > for only master that removes it. > Yep, based on code of gram.y and the doc, FOR ALL T

Re: plan shape work

2025-09-25 Thread Alexandra Wang
Hi there, I've tried v10-000{1,2}+v9-0002 and v9-000{1,2}. I was curious whether the names choose_plan_name() chose for subqueries match the Subquery Scan names in the EXPLAIN plan. My guess is that since the former is chosen before planning and the latter after planning, they might differ. I thin

Re: psql: tab-completion support for COPY ... TO/FROM STDIN, STDOUT, and PROGRAM

2025-09-25 Thread Yugo Nagata
On Thu, 25 Sep 2025 14:31:18 -0700 Masahiko Sawada wrote: > > > I fixed it to use 'generator'. > > LGTM. I've pushed the 0001 patch. Thank you! > > > > --- > > > > - /* Complete COPY FROM */ > > > > - else if (Matches("COPY|\\copy", MatchAny, "FROM", MatchAny)) > > > > + /* Complete CO

Re: Add support for specifying tables in pg_createsubscriber.

2025-09-25 Thread Peter Smith
On Thu, Sep 25, 2025 at 6:36 PM Chao Li wrote: > > > > On Sep 25, 2025, at 16:18, Shubham Khanna wrote: > > > > made_publication will always be set regardless of dry_run. > > > You’re right — I made a mistake in my earlier explanation. > made_publication is always set in create_publication(), reg

Re: Add support for entry counting in pgstats

2025-09-25 Thread Sami Imseih
> On Tue, Sep 23, 2025 at 01:39:00PM -0500, Sami Imseih wrote: > > The refcount reaches 0 when all backends release their references to the > > stat, so if something like pg_stat_statements relies on a count for > > deallocation purposes (to stay within the max), and that value only > > decrements

Re: Resetting recovery target parameters in pg_createsubscriber

2025-09-25 Thread Michael Paquier
On Tue, Sep 23, 2025 at 12:04:04PM +0700, Alena Vinter wrote: > About the recovery parameters cleanup: I thought about adding an exit > callback, but it doesn't really make sense because once the target server > gets promoted (which happens soon after we set the parameters), there's no > point in c

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

2025-09-25 Thread Shlok Kyal
Hi Ashutosh, Thanks for reviewing the patch. On Mon, 22 Sept 2025 at 10:59, Ashutosh Sharma wrote: > > Hi, > > @@ -646,7 +670,11 @@ synchronize_one_slot(RemoteSlot *remote_slot, Oid > remote_dbid) > remote_slot->name, > LSN_FORMAT_ARGS(latestFlushPtr))); > > - return false; > + /* If s

Re: Invalid pointer access in logical decoding after error

2025-09-25 Thread Masahiko Sawada
On Thu, Jul 3, 2025 at 7:55 AM vignesh C wrote: > > On Wed, 2 Jul 2025 at 13:21, Zhijie Hou (Fujitsu) > wrote: > > > > On Wed, Jul 2, 2025 at 2:42 PM vignesh C wrote: > > > > > > > > Hi, > > > > > > I encountered an invalid pointer access issue. Below are the steps to > > > reproduce the issue: >

Re: Orphan page in _bt_split

2025-09-25 Thread Michael Paquier
On Thu, Sep 25, 2025 at 03:45:21PM +0900, Michael Paquier wrote: > Hmm. This looks kind of explicit enough to document the purpose. > The wording could be simplified a bit more. I'll take it from there. Reworded a bit more the comments, and applied on HEAD. There could be an argument for back-p

Re: Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Tom Lane
Nathan Bossart writes: > Agreed, I'm not too worried about the system calls in this case. I think I > was more interested in seeing whether we could avoid the complicated float > handling. Something else that seems to work is moving the initial endtime > calculation to within the loop, like so:

Remove unused parameter on check_and_push_window_quals

2025-09-25 Thread Matheus Alcantara
Hi, While reading the check_and_push_window_quals() I realize that the Index rti parameter is not being used by check_and_push_window_quals() and find_window_run_conditions(). The attached patch remove this parameter for these functions. -- Matheus Alcantara From 80a580a73fbc12200ea19e112ad1a583c

Re: mislead comments in pg_get_statisticsobjdef_string

2025-09-25 Thread David Rowley
On Fri, 26 Sept 2025 at 01:17, jian he wrote: > * Internal version for use by ALTER TABLE. > * Includes a tablespace clause in the result. > * Returns a palloc'd C string; no pretty-printing. > */ > char * > pg_get_statisticsobjdef_string(Oid statextid) > { > return pg_get_statisticsobj_wo

Re: Remove unused parameter on check_and_push_window_quals

2025-09-25 Thread David Rowley
On Fri, 26 Sept 2025 at 09:50, David Rowley wrote: > > On Fri, 26 Sept 2025 at 09:01, Matheus Alcantara > wrote: > > While reading the check_and_push_window_quals() I realize that the Index > > rti parameter is not being used by check_and_push_window_quals() and > > find_window_run_conditions().

Re: GIN tries to form a tuple with a partial compressedList during insertion

2025-09-25 Thread Masahiko Sawada
On Wed, Jul 2, 2025 at 12:41 PM Arseniy Mukhin wrote: > > Hi! > > Here is a new version. I added a commit message. I will add it to PG19-2. Thank you for the patch. I think the proposed change is reasonable; if we fail to compress all ItemPointers, it doesn't make sense to try to form a tuple fr

Re: Remove unused parameter on check_and_push_window_quals

2025-09-25 Thread David Rowley
On Fri, 26 Sept 2025 at 09:01, Matheus Alcantara wrote: > While reading the check_and_push_window_quals() I realize that the Index > rti parameter is not being used by check_and_push_window_quals() and > find_window_run_conditions(). The attached patch remove this parameter > for these functions.

Re: Adding REPACK [concurrently]

2025-09-25 Thread Marcos Pegoraro
Em qui., 25 de set. de 2025 às 18:31, Robert Treat escreveu: > This pattern is used because you can pass more than one argument, for > example, something like I know that > > While I agree that the wording is a little awkward, this follows the same > pattern as pg_dump and friends. > well, I

Re: Adding REPACK [concurrently]

2025-09-25 Thread Robert Treat
On Thu, Sep 25, 2025 at 4:21 PM Marcos Pegoraro wrote: > > Em qui., 25 de set. de 2025 às 15:12, Álvaro Herrera > escreveu: > > Some typos I've found on usage of pg_repackdb. > > + printf(_(" -n, --schema=SCHEMA repack tables in the specified > schema(s) only\n")); > + printf(_("

Re: psql: tab-completion support for COPY ... TO/FROM STDIN, STDOUT, and PROGRAM

2025-09-25 Thread Masahiko Sawada
On Wed, Sep 17, 2025 at 8:27 PM Yugo Nagata wrote: > > On Thu, 18 Sep 2025 12:05:06 +0900 > Yugo Nagata wrote: > > > On Wed, 17 Sep 2025 12:53:10 -0700 > > Masahiko Sawada wrote: > > > > > On Fri, Jul 18, 2025 at 12:49 AM Yugo Nagata wrote: > > > > > > > > On Thu, 17 Jul 2025 10:57:36 +0900 > >

Re: a couple of small patches for simd.h

2025-09-25 Thread Nathan Bossart
On Thu, Sep 25, 2025 at 02:10:19PM -0500, Nathan Bossart wrote: > Here's a new version of 0002 with a modified SSE2 implementation, as > discussed elsewhere [0]. This allows us to remove vector8_ssub(). Sorry for the noise. v3 fixes the mixed-declarations-and-code problems. -- nathan >From 2d3

Re: Optimize LISTEN/NOTIFY

2025-09-25 Thread Joel Jacobson
On Thu, Sep 25, 2025, at 10:25, Chao Li wrote: > Hi Joel, > > Thanks for the patch. After reviewing it, I got a few comments. Thanks for reviewing! >> On Sep 25, 2025, at 04:34, Joel Jacobson wrote: > 1. ... > Can we define the new one after STARTUP_PROGRESS_TIMEOUT to try to > preserve the exi

Re: Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Nathan Bossart
On Thu, Sep 25, 2025 at 04:11:14PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> LGTM. I considered suggesting initializing the delay before the loop and >> then updating it at the end of the loop, but that moves the >> CHECK_FOR_INTERRUPTS between the delay calculation and the WaitLatch(),

Remove unused for_all_tables field from AlterPublicationStmt

2025-09-25 Thread Masahiko Sawada
Hi, I found that the for_all_table field in the AlterPublicationStmt is not used at all unless I'm missing something. I've attached the patch for only master that removes it. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com 0001-Remove-unused-for_all_tables-field-from-A

Re: Adding REPACK [concurrently]

2025-09-25 Thread Marcos Pegoraro
Em qui., 25 de set. de 2025 às 15:12, Álvaro Herrera escreveu: Some typos I've found on usage of pg_repackdb. + printf(_(" -n, --schema=SCHEMA repack tables in the specified schema(s) only\n")); + printf(_(" -N, --exclude-schema=SCHEMA do not repack tables in the specified sche

Re: Missing parentheses

2025-09-25 Thread Chao Li
Hi Marcos, The change looks good to me. People usually create a patch file by: $ git checkout -b $ git commit # create a commit for your change $ git format-patch -v1 master # it will generate a patch file and attach the patch file in your email For more details, see https://wiki.postgresql.o

Re: Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Tom Lane
Nathan Bossart writes: > On Thu, Sep 25, 2025 at 02:42:32PM -0400, Tom Lane wrote: >> Anyway, I propose trying to get rid of this misbehavior by avoiding >> floating point in the delay computation, as attached. > LGTM. I considered suggesting initializing the delay before the loop and > then upd

Re: Per-role disabling of LEAKPROOF requirements for row-level security?

2025-09-25 Thread Andreas Lind
Yugo Nagata wrote: > Therefore, if bypassing LEAKPROOF checks is to be allowed, I believe it > would be better to make this configurable on a per-policy basis. I've implemented a first iteration of a per-policy BYPASSLEAKPROOF flag. It makes a distinction between "normal quals" and "security qua

Re: Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Tom Lane
Robert Haas writes: > The patch looks good except that (places tongue firmly in cheek) it > will cause problems for users who want to sleep for more than 150,000 > years. We will all be safely dead before the first such bug report ;-) regards, tom lane

Re: Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Robert Haas
On Thu, Sep 25, 2025 at 2:42 PM Tom Lane wrote: > I chanced to notice that if you ask pg_sleep for 1ms delay, > what you actually get is 2ms, for example Oh, wow. I tested and I get the same behavior. > Anyway, I propose trying to get rid of this misbehavior by avoiding > floating point in the d

Re: Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Nathan Bossart
On Thu, Sep 25, 2025 at 02:42:32PM -0400, Tom Lane wrote: > Anyway, I propose trying to get rid of this misbehavior by avoiding > floating point in the delay computation, as attached. With this > patch I get less surprising behavior: > > [...] > > The code is a little more tied to TimestampTz be

Re: Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Tom Lane
=?utf-8?q?=D0=9F=D0=BE=D0=BF=D0=BE=D0=BB=D0=B8=D1=82=D0=BE=D0=B2_=D0=92=D0=BB=D0=B0=D0=B4=D0=BB=D0=B5=D0=BD?= writes: > I suspect, that any user, that run something like pg_sleep(10),  > start transaction, that stops autovacuum and creates other negative effects > up to server crash, > a

Re: delimiter inconsistency in generate-wait_event_types.pl

2025-09-25 Thread Daniel Gustafsson
> On 29 Jul 2025, at 10:08, Daniel Gustafsson wrote: > While looking at this I noticed that the --docs option is incorrectly refered > to as --sgml in the usage output, which is fixed in 0002. I was helpfully reminded about this thread and after taking another look at it I went ahead and pushed

Sending unflushed WAL in physical replication

2025-09-25 Thread Rahila Syed
Hi, Please find attached a POC patch that introduces changes to the WAL sender and receiver, allowing WAL records to be sent to standbys before they are flushed to disk on the primary during physical replication. This is intended to improve replication latency by reducing the amount of WAL read fr

Re: [PATCH] Fix pg_rewind false positives caused by shutdown-only WAL

2025-09-25 Thread Robert Haas
On Sat, Sep 6, 2025 at 12:34 PM Srinath Reddy Sadipiralla wrote: > While working with pg_rewind, I noticed that it can sometimes request a > rewind even when no actual changes exist after a failover. > > Problem: > Currently, pg_rewind determines the end-of-WAL on the target by using the > last

Re: a couple of small patches for simd.h

2025-09-25 Thread Nathan Bossart
Here's a new version of 0002 with a modified SSE2 implementation, as discussed elsewhere [0]. This allows us to remove vector8_ssub(). [0] https://postgr.es/m/aNWO7L43UevRErw_%40nathan -- nathan >From a644f049add68ea78326f88d8994898c92f23c20 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date:

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

2025-09-25 Thread Masahiko Sawada
On Thu, Sep 25, 2025 at 4:57 AM shveta malik wrote: > > On Tue, Sep 23, 2025 at 3:28 AM Masahiko Sawada wrote: > > > > > > I've attached the updated patch. It incorporates all comments I got so > > far and implements to lazily disable logical decoding. It's used only > > when the process tries to

Re: Add memory_limit_hits to pg_stat_replication_slots

2025-09-25 Thread Masahiko Sawada
On Thu, Sep 25, 2025 at 3:17 AM Bertrand Drouvot wrote: > > Hi, > > On Wed, Sep 24, 2025 at 10:11:20AM -0700, Masahiko Sawada wrote: > > On Tue, Sep 23, 2025 at 11:31 PM Bertrand Drouvot > > wrote: > > > > Thank you for updating the patch! Here are some comments: > > > > --- > > + boolm

Re: [PATCH] Hex-coding optimizations using SVE on ARM.

2025-09-25 Thread Nathan Bossart
On Thu, Sep 25, 2025 at 09:16:35PM +0700, John Naylor wrote: > + if (unlikely(!success)) > + i = 0; > > This is after the main loop exits, and the cold path is literally one > instruction, so the motivation is not apparent to me. Removed. I was thinking about smaller inputs when I added this, bu

Re: Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Пополитов Владлен
Hi   I suspect, that any user, that run something like pg_sleep(10),  start transaction, that stops autovacuum and creates other negative effects up to server crash, and only this user can stop it by command interrupt (all signals only restart  this sleep or kill whole server). If I am co

Avoiding roundoff error in pg_sleep()

2025-09-25 Thread Tom Lane
I chanced to notice that if you ask pg_sleep for 1ms delay, what you actually get is 2ms, for example regression=# \timing on Timing is on. regression=# do $$ begin for i in 1..1000 loop perform pg_sleep(0.001); end loop; end $$; DO Time: 2081.175 ms (00:02.081) regression=# do $$ begin for i in 1

Re: Making pg_rewind faster

2025-09-25 Thread Robert Haas
On Mon, Jul 7, 2025 at 2:46 PM John H wrote: > I've created the commitfest entry here: > https://commitfest.postgresql.org/patch/5902/ > > I realized I wasn't testing properly in 0006. I've updated the latest > one to move it into a separate test file to make the results cleaner. Thanks to everyo

Re: Remove obsolate comments from 047_checkpoint_physical_slot

2025-09-25 Thread Daniel Gustafsson
> On 25 Sep 2025, at 13:11, Hayato Kuroda (Fujitsu) > wrote: > Is "injection point)" a typo? I feel it is enough to remove ")". > Feel free to include if you agree this point as well. Nice catch, I included this with the other fixes and pushed them today. -- Daniel Gustafsson

Re: [PATCH] Add tests for Bitmapset

2025-09-25 Thread Greg Burd
On Sep 23 2025, at 7:23 pm, Michael Paquier wrote: > On Tue, Sep 23, 2025 at 02:26:19PM -0400, Greg Burd wrote: >> patch attached, best. > > All that seems to work corrently here, so done. > -- > Michael Thanks Michael, Tom, for the help getting this into shape and in the tree. best. -greg

Re: Non-blocking archiver process

2025-09-25 Thread Artem Gavrilov
Hello Patrick I did a review of your patch. Initial Run === The patch applies cleanly to HEAD (196063d6761). All tests successfully pass on MacOS 15.7. Comments === 1) Instead of `malloc` and `free` it should be `palloc` and `pfree`. 2) In fact `archiveFileno` is a file descript

Re: minimum Meson version

2025-09-25 Thread Jacob Champion
On Wed, Jun 18, 2025 at 11:36 AM Tom Lane wrote: > Maybe we could compromise on > > If the expected PG major version release date is more than N years > after the end of full support for an LTS distribution, that OS > version does not need to be supported. > > Defining it relative to "full s

Re: Fix bug with accessing to temporary tables of other sessions

2025-09-25 Thread Daniil Davydov
Hi, On Thu, Sep 25, 2025 at 5:45 PM Jim Jones wrote: > > A few days ago I reviewed one patch[1] that has a significant overlap > with this one. Perhaps they should be merged? > Thanks for looking into it! I don't know what exactly is meant by merging. Maybe we should just apply a current patch t

Re: Add support for specifying tables in pg_createsubscriber.

2025-09-25 Thread Chao Li
> On Sep 25, 2025, at 16:18, Shubham Khanna wrote: >> >> >> made_publication will always be set regardless of dry_run. >> > > You’re right — I made a mistake in my earlier explanation. > made_publication is always set in create_publication(), regardless of > dry-run. I have double-checked th

Re: GNU/Hurd portability patches

2025-09-25 Thread Tom Lane
Michael Banck writes: > On Wed, Sep 24, 2025 at 05:52:02PM +0200, Michael Banck wrote: >> I did that in the attached, so far my Hurd VM ran the stats test more >> than 1000 times without a failure with it. I have the loop running till >> 1, I'll report back tomorrow. > For the record, the sta

Re: RHEL 8 EOL for the PGDG RPM repository

2025-09-25 Thread Jesper Pedersen
Hi Devrim, On 9/25/25 11:52 AM, Devrim Gündüz wrote: Just wanted to let you know that PostgreSQL 18 will be the last major release for RHEL 8. The details are here: https://yum.postgresql.org/news/news-rhel8-end-of-life/ Thank you for all of your work on the RHEL 8 packages ! Best regards,

Re: RFC: extensible planner state

2025-09-25 Thread Robert Haas
On Wed, Sep 24, 2025 at 12:18 PM Tom Lane wrote: > I'm good with 0001, and the release freeze is over, so push that > whenever you like. I'll try to look at the rest soon. Done now. Here's a rebase of the rest, plus I tweaked the GEQO patch to try to avoid a compiler warning that cfbot was compl

RHEL 8 EOL for the PGDG RPM repository

2025-09-25 Thread Devrim Gündüz
Hi, Just wanted to let you know that PostgreSQL 18 will be the last major release for RHEL 8. The details are here: https://yum.postgresql.org/news/news-rhel8-end-of-life/ This may help developers to concentrate on recent RHEL releases and recent toolchains for the upcoming major releases. Reg

Re: GNU/Hurd portability patches

2025-09-25 Thread Michael Banck
Hi, On Wed, Sep 24, 2025 at 05:52:02PM +0200, Michael Banck wrote: > I did that in the attached, so far my Hurd VM ran the stats test more > than 1000 times without a failure with it. I have the loop running till > 1, I'll report back tomorrow. For the record, the stats test ran 1 times w

Re: plan shape work

2025-09-25 Thread Robert Haas
On Wed, Sep 24, 2025 at 6:03 PM Tom Lane wrote: > I don't think so. We do not have a nice story on marking Node fields > const: it's very unclear for example what consequences that ought to > have for copyObject(). Maybe somebody will tackle that issue someday, > but it's not something to touch

Re: plan shape work

2025-09-25 Thread Tom Lane
Robert Haas writes: > On Wed, Sep 24, 2025 at 6:03 PM Tom Lane wrote: >> I think a better idea is to keep a list of just the subplan >> names that we've assigned so far. That has a far clearer >> charter, plus it can be updated immediately by choose_plan_name() >> instead of relying on the calle

Re: Get rid of pgstat_count_backend_io_op*() functions

2025-09-25 Thread Bertrand Drouvot
Hi, On Thu, Sep 25, 2025 at 03:42:33PM +0900, Michael Paquier wrote: > On Wed, Sep 24, 2025 at 07:48:32AM +, Bertrand Drouvot wrote: > > On Wed, Sep 03, 2025 at 07:33:37AM +, Bertrand Drouvot wrote: > >> As far the ordering concern for v1, what about: > >> > >> - let backend kind enum def

Re: Missing parentheses

2025-09-25 Thread Tom Lane
Marcos Pegoraro writes: > New version for removing spaces between function names and parentheses Hmph, this documentation section needs work doesn't it. Aside from the lack of parens, it's using to label functions, the layout is a poor match to what we do elsewhere, and the grammar is pretty inc

Re: Vacuum statistics

2025-09-25 Thread Alena Rybakina
Hi all, I’ve prepared an extension that adds vacuum statistics [0] (master branch), and it’s working stably. The attached patch is a core patch that enables this extension to work. Right now, I’m experimenting with a core patch. Specifically, in load_file I can detect whether vacuum_statisti

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

2025-09-25 Thread Fujii Masao
On Thu, Sep 25, 2025 at 4:22 PM Yugo Nagata wrote: > I've attached updated patches. Thanks for updating the patches! About 0001: you mentioned that the lost error message issue occurs in pipeline mode. Just to confirm, are you sure it never happens in non-pipeline mode? >From a quick look, readC

Re: [PATCH] Hex-coding optimizations using SVE on ARM.

2025-09-25 Thread John Naylor
On Thu, Sep 25, 2025 at 4:40 AM Nathan Bossart wrote: > > On Wed, Sep 24, 2025 at 10:59:38AM +0700, John Naylor wrote: > > + if (unlikely(!hex_decode_simd_helper(srcv, &dstv1))) > > + break; > > > > But if you really want to do something here, sprinkling "(un)likely"'s > > here seems like solving

Re: Missing parentheses

2025-09-25 Thread Marcos Pegoraro
Em qui., 25 de set. de 2025 às 10:55, Marcos Pegoraro escreveu: New version for removing spaces between function names and parentheses patch.diff Description: Binary data

Re: Fix bug with accessing to temporary tables of other sessions

2025-09-25 Thread Jim Jones
On 9/25/25 15:15, Daniil Davydov wrote: > I don't know what exactly is meant by merging. Maybe we should just > apply a current > patch that fixes all problems ?.. Here I just wanted to bring to your attention that we have duplicate efforts with these two patches. This one covers much more grou

Missing parentheses

2025-09-25 Thread Marcos Pegoraro
New function uuidv7 was added and that changed how other two functions are described on DOCs, so is missing parentheses on both. regards Marcos patch.diff Description: Binary data

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

2025-09-25 Thread Maxim Orlov
Hi! Please give notice to this discussion [0]. 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 th

Re: Report bytes and transactions actually sent downtream

2025-09-25 Thread Bertrand Drouvot
Hi, On Thu, Sep 25, 2025 at 10:16:35AM +0530, Ashutosh Bapat wrote: > On Wed, Sep 24, 2025 at 8:11 PM Bertrand Drouvot > wrote: > > > > === 4 > > > > +extern Size ReorderBufferChangeSize(ReorderBufferChange *change); > > > > Another approach could be to pass the change's size as an argument to th

Re: allow benign typedef redefinitions (C11)

2025-09-25 Thread Álvaro Herrera
On 2025-Sep-20, Tom Lane wrote: > =?utf-8?Q?=C3=81lvaro?= Herrera writes: > > Here's a proposed fix. > > I didn't test this, but it passes an eyeball sanity check > and looks like an improvement overall. Thanks, pushed now. -- Álvaro Herrera PostgreSQL Developer — https://www.Enterp

Re: Fix incorrect function comment of stringToNodeInternal

2025-09-25 Thread Chao Li
> On Sep 25, 2025, at 17:54, Daniel Gustafsson wrote: > >> On 25 Sep 2025, at 10:01, Chao Li wrote: > >> There are 5 different cases, showing that there is not a unique way for what >> function name should be put to xxInternal() functions’ comment. >> >> Is it deserve to take this opportuni

Re: allow benign typedef redefinitions (C11)

2025-09-25 Thread Álvaro Herrera
On 2025-Sep-23, Peter Eisentraut wrote: > On 19.09.25 12:52, Álvaro Herrera wrote: > > Here's a few more forward struct declarations turned into typedefs, for > > cleanliness sake. > > Two comments; the rest looks okay to me. Thanks, pushed. -- Álvaro HerreraBreisgau, Deutschland —

Re: Logical Replication of sequences

2025-09-25 Thread shveta malik
On Tue, Sep 23, 2025 at 6:39 PM vignesh C wrote: > > On Mon, 22 Sept 2025 at 12:03, shveta malik wrote: > > > > On Thu, Sep 18, 2025 at 4:07 PM vignesh C wrote: > > > > > > Thanks for the comments, these are handled in the attached patch. > > > > > > > Please find a few comments: > > > > > > pat

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

2025-09-25 Thread shveta malik
On Tue, Sep 23, 2025 at 3:28 AM Masahiko Sawada wrote: > > > I've attached the updated patch. It incorporates all comments I got so > far and implements to lazily disable logical decoding. It's used only > when the process tries to disable logical decoding during process > exit. > I am resuming t

Re: Skipping schema changes in publication

2025-09-25 Thread vignesh C
On Fri, 5 Sept 2025 at 11:57, Shlok Kyal wrote: > > On Mon, 25 Aug 2025 at 13:38, Shlok Kyal wrote: > > > > On Thu, 21 Aug 2025 at 05:33, Peter Smith wrote: > > > > > > Hi Shlok, > > > > > > I reviewed your latest v20-0003 patch and have no more comments at > > > this time; I only found one triv

Re: Proposal: Conflict log history table for Logical Replication

2025-09-25 Thread Dilip Kumar
On Thu, Sep 25, 2025 at 11:53 AM Dilip Kumar wrote: > > > [1] > > /* > > * For logical decode we need combo CIDs to properly decode the > > * catalog > > */ > > if (RelationIsAccessibleInLogicalDecoding(relation)) > > log_heap_new_cid(relation, &tp); > > > > Meanwhile I am also exploring the optio

Re: Fix incorrect function comment of stringToNodeInternal

2025-09-25 Thread Daniel Gustafsson
> On 25 Sep 2025, at 10:01, Chao Li wrote: > There are 5 different cases, showing that there is not a unique way for what > function name should be put to xxInternal() functions’ comment. > > Is it deserve to take this opportunity to make all of them in a consistent > format? We don't have a

Re: tiny step toward threading: reduce dependence on setlocale()

2025-09-25 Thread Alexander Kukushkin
Hi Jeff, On Thu, 25 Sept 2025 at 11:08, Jeff Davis wrote: > Committed v2-0001. > 06421b084364 commit broke possibility to call GetSharedSecurityLabel() from ClientAuthentication_hook. Now GetSharedSecurityLabel() calls fail with the error "cannot read pg_class without having selected a database

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

2025-09-25 Thread Chao Li
Hi Yugo, Thanks for the patch. After reviewing it, I got a few small comments: > On Sep 25, 2025, at 15:22, Yugo Nagata wrote: > > -- > Yugo Nagata mailto:[email protected]>> > 1 - 0001 ``` @@ -3265,6 +3271,7 @@ readCommandResponse(CState *st, MetaCommand meta, char *varprefix) P

Re: GNU/Hurd portability patches

2025-09-25 Thread Michael Banck
Hi, On Thu, Sep 25, 2025 at 08:00:00AM +0300, Alexander Lakhin wrote: > 25.09.2025 00:22, Michael Banck wrote: > > I ran that five times now without a problem, both with and without the > > Mach patch I mentioned earlier, and on 32 and 64 bit. Not sure what is > > going on here. > > Maybe you're

Re: pg_waldump: support decoding of WAL inside tarfile

2025-09-25 Thread Amul Sul
On Fri, Sep 12, 2025 at 11:58 PM Robert Haas wrote: > > Here are some review comments on v3-0004: > Thanks for the review. My replies are below. > There doesn't seem to be any reason for > astreamer_waldump_content_new() to take an astreamer *next argument. > If you look at astreamer.h, you'll s

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

2025-09-25 Thread Anthonin Bonnefoy
Hi, The patch looks good, I've spotted some typos in the doc. +Allows clients to continue their run even if an SQL statement fails due to +errors other than serialization or deadlock. Unlike serialization and deadlock +failures, clients do not retry the same transactions b

  1   2   >