Re: Avoid circular header file dependency

2025-04-26 Thread Michael Paquier
On Sat, Apr 26, 2025 at 01:20:56AM -0400, Tom Lane wrote: > Bertrand Drouvot writes: >> While working on wait events I faced some compilation issues due to circular >> header file dependency (introduced in fa88928470b5) between wait_event.h and >> wait_event_types.h. > > Ugh. I still carry the s

Re: Fix premature xmin advancement during fast forward decoding

2025-04-26 Thread Masahiko Sawada
On Sat, Apr 26, 2025 at 5:01 AM Amit Kapila wrote: > > On Sat, Apr 26, 2025 at 12:01 AM Masahiko Sawada > wrote: > > > > On Fri, Apr 25, 2025 at 4:42 AM Amit Kapila wrote: > > > > > > Can you think of any better ideas? > > > > No idea. Hmm, there seems no reasonable way to fix this issue for ba

Re: Logical Replication of sequences

2025-04-26 Thread Peter Smith
Hi Vignesh. Some review comments for v20250426-0005. == doc/src/sgml/catalogs.sgml 1. - State code: + State code for tables: i = initialize, d = data is being copied, f = finished table copy, s = synchronized, r = ready (normal repl

Re: Avoid circular header file dependency

2025-04-26 Thread Bertrand Drouvot
Hi, On Sat, Apr 26, 2025 at 04:42:56PM +0900, Michael Paquier wrote: > This one is my fault, I do feel guilty too... > Splitting the values > of the wait classes into their own header makes sense, but the header > name wait_class_constants.h sounds a bit off. Why not a simpler > "wait_classes.h

Re: Logical Replication of sequences

2025-04-26 Thread Peter Smith
Hi Vignesh. FYI, patch v20250424-0004 reported whitespace errors when applied. [postgres@CentOS7-x64 oss_postgres_misc]$ git apply ../patches_misc/v20250424-0004-Enhance-sequence-synchronization-during-su.patch ../patches_misc/v20250424-0004-Enhance-sequence-synchronization-during-su.patch:366: t

Re: Fix premature xmin advancement during fast forward decoding

2025-04-26 Thread Amit Kapila
On Sat, Apr 26, 2025 at 12:01 AM Masahiko Sawada wrote: > > On Fri, Apr 25, 2025 at 4:42 AM Amit Kapila wrote: > > > > On Fri, Apr 25, 2025 at 10:46 AM Masahiko Sawada > > wrote: > > > > > > What I'm concerned about is the back branches. With this approach all > > > back branches will have such

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

2025-04-26 Thread Sami Imseih
I found several issues with v4. It does not deal correctly with pipelining, and we should only really be concerned with dropping an unnamed portal only. So, v5 now moves the DropPortal call after the unnamed portal was executed to completion ( as v4 was doing ), but does so only in the case in whi

Re: Avoid circular header file dependency

2025-04-26 Thread Bertrand Drouvot
Hi, On Sat, Apr 26, 2025 at 01:20:56AM -0400, Tom Lane wrote: > Bertrand Drouvot writes: > > While working on wait events I faced some compilation issues due to circular > > header file dependency (introduced in fa88928470b5) between wait_event.h and > > wait_event_types.h. > > I don't have an o

Re: Avoid circular header file dependency

2025-04-26 Thread Tom Lane
Bertrand Drouvot writes: > On Sat, Apr 26, 2025 at 01:20:56AM -0400, Tom Lane wrote: >> Whatever it contains, we need to kill it with fire before the problem >> metastasizes like it did the last time. (yeah, yeah, badly mixed >> metaphors) I can take a look at this one over the weekend if nobody

Re: Removing unneeded self joins

2025-04-26 Thread Alexander Korotkov
On Sat, Apr 26, 2025 at 11:04 PM Alexander Korotkov wrote: > On Sun, Apr 6, 2025 at 12:02 AM Alena Rybakina > wrote: > > Should we add more regression tests covering these cases? > > > > I experimented with some examples like this and noticed that it does affect > > cardinality estimation, thoug

Re: Removing unneeded self joins

2025-04-26 Thread Alexander Korotkov
Hi, Alena! On Sun, Apr 6, 2025 at 12:02 AM Alena Rybakina wrote: > Should we add more regression tests covering these cases? > > I experimented with some examples like this and noticed that it does affect > cardinality estimation, though I'm not sure the impact is significant. > I used the table

Re: Get rid of integer divide in FAST_PATH_REL_GROUP() macro

2025-04-26 Thread Tomas Vondra
On 4/14/25 04:09, David Rowley wrote: > I noticed a while ago that the new fast-path locking code uses integer > division to figure out the fast-path locking group slot. To me, this > seems a bit unnecessary as FastPathLockGroupsPerBackend is always a > power-of-two value, so we can use bitwise-A

Re: pgsql: Add function to get memory context stats for processes

2025-04-26 Thread Tomas Vondra
On 4/23/25 20:14, Tom Lane wrote: > Robert Haas writes: >> My primary concern about the patch is that >> ProcessGetMemoryContextInterrupt() can be called from any >> CHECK_FOR_INTERRUPTS() and calls lots of DSA functions, including >> dsa_create() and, via PublishMemoryContext(), dsa_allocate0().

Re: Does RENAME TABLE rename associated identity sequence?

2025-04-26 Thread Jason Song
Hi all, Thank you for the detailed discussion and clarifications. I sincerely appreciate everyone's time and valuable insights shared in this discussion.

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-26 Thread Amit Kapila
On Fri, Apr 25, 2025 at 9:57 PM Masahiko Sawada wrote: > > On Fri, Apr 25, 2025 at 3:43 AM Amit Kapila wrote: > > > > On Fri, Apr 25, 2025 at 6:02 AM Masahiko Sawada > > wrote: > > > > > > I realized that users who create a logical slot using > > > pg_create_logical_replication_slot() would not

Re: Back-patch of: avoid multiple hard links to same WAL file after a crash

2025-04-26 Thread Noah Misch
On Fri, Apr 25, 2025 at 03:35:06PM -0400, Andres Freund wrote: > On 2025-04-20 14:53:39 -0700, Noah Misch wrote: > > The checkpoints and WAL creation took 30s, but archiving was only 20% done > > (based on file name 0001006D) at the 360s PGCTLTIMEOUT. > > Huh. That seems surprisin

Re: Get rid of integer divide in FAST_PATH_REL_GROUP() macro

2025-04-26 Thread David Rowley
On Sun, 27 Apr 2025 at 08:44, Tomas Vondra wrote: > Thanks. Those changes seem fine to me to. Thanks for checking. > Do you intend to push these, or do you want me to do it? I made a few tweaks to the comments and pushed. David