Re: ALTER TABLE SET ACCESS METHOD on partitioned tables

2023-04-24 Thread Michael Paquier
On Thu, Mar 30, 2023 at 12:07:58AM -0500, Justin Pryzby wrote: > What more points ? There's nothing that's been raised here. In fact, > your message last week is the first comment since last June .. When I wrote this message, I felt like this may still be missing something in the area of

Re: Autogenerate some wait events code and documentation

2023-04-24 Thread Michael Paquier
On Mon, Apr 24, 2023 at 09:03:53AM +0200, Drouvot, Bertrand wrote: > Oh right, fixed. I may tweak a few things if I put my hands on it, but that looks pretty solid seen from here.. I have spotted a few extra issues. One thing I have noticed with v4 is that the order of the tables generated in

Re: Add two missing tests in 035_standby_logical_decoding.pl

2023-04-24 Thread Amit Kapila
On Mon, Apr 24, 2023 at 5:38 PM Drouvot, Bertrand wrote: > > On 4/24/23 11:45 AM, Amit Kapila wrote: > > On Mon, Apr 24, 2023 at 11:54 AM Amit Kapila > > wrote: > >> > >> On Mon, Apr 24, 2023 at 11:24 AM Drouvot, Bertrand > >> wrote: > >>> > >> > >> Few comments: > >> > >> > > > >

Re: Order changes in PG16 since ICU introduction

2023-04-24 Thread Jeff Davis
On Fri, 2023-04-21 at 16:00 -0400, Tom Lane wrote: > I think I might like this idea, except for one thing: you're > imagining > that the locale doesn't control anything except string comparisons. > What about to_upper/to_lower, character classifications in regexes, > etc? If provider='libc' and

Re: Add two missing tests in 035_standby_logical_decoding.pl

2023-04-24 Thread Amit Kapila
On Mon, Apr 24, 2023 at 3:36 PM Drouvot, Bertrand wrote: > > On 4/24/23 8:24 AM, Amit Kapila wrote: > > > 2. > > +# Speed up the subscription creation > > +$node_primary->safe_psql('postgres', "SELECT pg_log_standby_snapshot()"); > > + > > +# Explicitly shut down psql instance gracefully - to

Re: seemingly useless #include recently added

2023-04-24 Thread Thomas Munro
On Tue, Apr 25, 2023 at 3:12 PM Tom Lane wrote: > Kyotaro Horiguchi writes: > > While working on a patch, I noticed that a rcent commit (d4e71df6d75) > > added an apparently unnecessary inclusion of guc.h in smgr.h. > > Yes, that seems quite awful, and I also wonder why it changed fd.h. > Adding

Re: seemingly useless #include recently added

2023-04-24 Thread Tom Lane
Kyotaro Horiguchi writes: > While working on a patch, I noticed that a rcent commit (d4e71df6d75) > added an apparently unnecessary inclusion of guc.h in smgr.h. Yes, that seems quite awful, and I also wonder why it changed fd.h. Adding #include's to header files is generally not the first

seemingly useless #include recently added

2023-04-24 Thread Kyotaro Horiguchi
Hello. While working on a patch, I noticed that a rcent commit (d4e71df6d75) added an apparently unnecessary inclusion of guc.h in smgr.h. The only change made by the commit to the file is the added #include directive, which doesn't seem to be functioning, and the build actually suceeds without

Re: buffer refcount leak in foreign batch insert code

2023-04-24 Thread Michael Paquier
On Mon, Apr 24, 2023 at 09:57:10AM +0900, Michael Paquier wrote: > The attached is what I am finishing with, with a minimal regression > test added to postgres_fdw. Two partitions are enough. Well, I have gone through that again this morning, and applied the fix down to 14. The buildfarm is

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Melanie Plageman
On Mon, Apr 24, 2023 at 7:02 PM Melanie Plageman wrote: > On Mon, Apr 24, 2023 at 03:56:54PM -0700, Andres Freund wrote: > > > > I was thinking we'd track writeback separately from the write, rather > than > > attributing the writeback to "write". Otherwise it looks good, based on > a > > quick

Re: ALTER TABLE SET ACCESS METHOD on partitioned tables

2023-04-24 Thread Justin Pryzby
On Thu, Mar 30, 2023 at 12:07:58AM -0500, Justin Pryzby wrote: > On Mon, Mar 27, 2023 at 11:34:36PM -0500, Justin Pryzby wrote: > > On Tue, Mar 28, 2023 at 09:13:10AM +0900, Michael Paquier wrote: > > > On Mon, Mar 20, 2023 at 09:30:50AM +0900, Michael Paquier wrote: > > > > Did you check dump and

Re: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call

2023-04-24 Thread Andres Freund
Hi, On 2023-04-24 15:32:25 -0700, Andres Freund wrote: > On 2023-04-24 10:53:35 +0200, Christoph Berg wrote: > > I'm often seeing PG16 builds erroring out in the pgbench tests: > > I don't think the disk is full since it's always hitting that same > > spot, on some of the builds: > > Yea, the

Re: base backup vs. concurrent truncation

2023-04-24 Thread Andres Freund
Hi, On 2023-04-21 09:42:57 -0400, Robert Haas wrote: > Apologies if this has already been discussed someplace, but I couldn't > find a previous discussion. It seems to me that base backups are > broken in the face of a concurrent truncation that reduces the number > of segments in a relation. I

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Jonathan S. Katz
On 4/24/23 6:14 PM, Andres Freund wrote: Hi, On 2023-04-24 10:52:15 +0530, Amit Kapila wrote: On Sun, Apr 23, 2023 at 12:55 AM Jonathan S. Katz wrote: I wonder if it's worth doing so for 16? It'd give a more complete picture that way. The counter-argument I see is that we didn't track the

Re: Request for comment on setting binary format output per session

2023-04-24 Thread Merlin Moncure
On Thu, Apr 20, 2023 at 2:52 PM Dave Cramer wrote: > > As promised here is a patch with defines for all of the protocol messages. > I created a protocol.h file and put it in src/includes > I'm fairly sure that some of the names I used may need to be changed but > the grunt work of finding and

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Melanie Plageman
On Mon, Apr 24, 2023 at 03:56:54PM -0700, Andres Freund wrote: > Hi, > > On 2023-04-24 18:36:24 -0400, Melanie Plageman wrote: > > On Mon, Apr 24, 2023 at 6:13 PM Andres Freund wrote: > > > > Also, it seems like this (given the current code) is only reachable for > > > > permanent relations

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Andres Freund
Hi, On 2023-04-24 18:36:24 -0400, Melanie Plageman wrote: > On Mon, Apr 24, 2023 at 6:13 PM Andres Freund wrote: > > > Also, it seems like this (given the current code) is only reachable for > > > permanent relations (i.e. not for IO object temp relation). If other > > backend > > > types than

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Melanie Plageman
On Mon, Apr 24, 2023 at 6:13 PM Andres Freund wrote: > Hi, > > On 2023-04-24 17:37:48 -0400, Melanie Plageman wrote: > > On Mon, Apr 24, 2023 at 02:14:32PM -0700, Andres Freund wrote: > > > It starts blocking once "enough" IO is in flight. For things like an > immediate > > > checkpoint, that

Re: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call

2023-04-24 Thread Andres Freund
Hi, On 2023-04-24 10:53:35 +0200, Christoph Berg wrote: > I'm often seeing PG16 builds erroring out in the pgbench tests: Interesting! > I don't think the disk is full since it's always hitting that same > spot, on some of the builds: Yea, the EINTR pretty clearly indicates that it's not

Re: Remove io prefix from pg_stat_io columns

2023-04-24 Thread Andres Freund
On 2023-04-21 07:38:01 +0900, Michael Paquier wrote: > On Thu, Apr 20, 2023 at 11:38:42AM +0900, Michael Paquier wrote: > > No worries, committers should take care of that. > > Done as of 0ecb87e, as I can keep an eye on the buildfarm today, with > a catversion bump. Thanks!

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Andres Freund
Hi, On 2023-04-24 10:52:15 +0530, Amit Kapila wrote: > On Sun, Apr 23, 2023 at 12:55 AM Jonathan S. Katz > wrote: > > > I wonder if it's > > > worth doing so for 16? It'd give a more complete picture that way. The > > > counter-argument I see is that we didn't track the time for it in existing

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Andres Freund
Hi, On 2023-04-24 17:37:48 -0400, Melanie Plageman wrote: > On Mon, Apr 24, 2023 at 02:14:32PM -0700, Andres Freund wrote: > > It starts blocking once "enough" IO is in flight. For things like an > > immediate > > checkpoint, that can happen fairly quickly, unless you have a very fast IO > >

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Melanie Plageman
On Mon, Apr 24, 2023 at 02:14:32PM -0700, Andres Freund wrote: > Hi, > > On 2023-04-24 16:39:36 -0400, Melanie Plageman wrote: > > On Wed, Apr 19, 2023 at 10:23:26AM -0700, Andres Freund wrote: > > > Hi, > > > > > > I noticed that the numbers in pg_stat_io dont't quite add up to what I > > >

Re: Missing update of all_hasnulls in BRIN opclasses

2023-04-24 Thread Tomas Vondra
On 4/24/23 17:36, Alvaro Herrera wrote: > On 2023-Apr-23, Tomas Vondra wrote: > >> here's an updated version of the patch, including a backport version. I >> ended up making the code yet a bit closer to master by introducing >> add_values_to_range(). The current pre-14 code has the loop adding

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Andres Freund
Hi, On 2023-04-24 16:39:36 -0400, Melanie Plageman wrote: > On Wed, Apr 19, 2023 at 10:23:26AM -0700, Andres Freund wrote: > > Hi, > > > > I noticed that the numbers in pg_stat_io dont't quite add up to what I > > expected in write heavy workloads. Particularly for checkpointer, the > > numbers

Re: Missing update of all_hasnulls in BRIN opclasses

2023-04-24 Thread Tomas Vondra
On 4/24/23 23:05, Tomas Vondra wrote: > > > On 4/24/23 17:46, Tom Lane wrote: >> Alvaro Herrera writes: >>> On 2023-Apr-23, Tomas Vondra wrote: Both cases have a patch extending pageinspect to show the new flag, but obviously we should commit that only in master. In backbranches

Re: Missing update of all_hasnulls in BRIN opclasses

2023-04-24 Thread Tom Lane
Tomas Vondra writes: > On 4/24/23 17:46, Tom Lane wrote: >> "A bit laborious"? That seems enormously out of proportion to the >> benefit of putting this test case into back branches. It will have >> costs for end users too, not only us. As an example, it would >> unecessarily block some

Re: Missing update of all_hasnulls in BRIN opclasses

2023-04-24 Thread Tomas Vondra
On 4/24/23 17:46, Tom Lane wrote: > Alvaro Herrera writes: >> On 2023-Apr-23, Tomas Vondra wrote: >>> Both cases have a patch extending pageinspect to show the new flag, but >>> obviously we should commit that only in master. In backbranches it's >>> meant only to make testing easier. > >> In

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-04-24 Thread Melanie Plageman
On Mon, Apr 10, 2023 at 3:41 AM Pavel Luzanov wrote: > > On 05.04.2023 03:41, Melanie Plageman wrote: > > On Tue, Apr 4, 2023 at 4:35 PM Pavel Luzanov > > wrote: > > > >> After a little thought... I'm not sure about the term 'bootstrap > >> process'. I can't find this term in the documentation.

Re: pg_stat_io not tracking smgrwriteback() is confusing

2023-04-24 Thread Melanie Plageman
On Wed, Apr 19, 2023 at 10:23:26AM -0700, Andres Freund wrote: > Hi, > > I noticed that the numbers in pg_stat_io dont't quite add up to what I > expected in write heavy workloads. Particularly for checkpointer, the numbers > for "write" in log_checkpoints output are larger than what is visible

Re: Should we remove vacuum_defer_cleanup_age?

2023-04-24 Thread Andres Freund
Hi, On 2023-04-24 14:36:36 +0200, Alvaro Herrera wrote: > On 2023-Apr-22, Andres Freund wrote: > > I'm afraid we'll need TransactionIdRetreatSafely() again, when we convert > > more > > things to 64bit xids (lest they end up with the same bug as fixed by > > be504a3e974), so it's perhaps worth

RE: Should we remove vacuum_defer_cleanup_age?

2023-04-24 Thread Phil Florent
Hi, Not very convenient but if autovacuum is enabled isn't vacuum_defer_cleanup_age the way to make extensions like pg_dirtyread more effective for temporal queries to quickly correct human DML mistakes without the need of a complete restore, even if no standby is in use ?

RE: [PATCH] Support % wildcard in extension upgrade filenames

2023-04-24 Thread Regina Obe
> This change also makes it easier for extensions that use versioned .so files > (by that I mean uses extension-.so rather than extension.so). > Because such extensions can't really use the chaining property of the > existing upgrade system and so need to write a direct X--Y.sql migration file

Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name

2023-04-24 Thread Yurii Rashkovskii
You're absolutely right. Here's v3. On Mon, Apr 24, 2023 at 6:30 PM Aleksander Alekseev < aleksan...@timescale.com> wrote: > Hi, > > > This is a very good catch and a suggestion. I've slightly reworked the > patch, and I also made this static assertion to have less indirection and, > therefore,

Re: [PATCH] Support % wildcard in extension upgrade filenames

2023-04-24 Thread Mat Arye
Hi All, I've done upgrade maintenance for multiple extensions now (TimescaleDB core, Promscale) and I think the original suggestion (wildcard filenames with control-file switch to enable) here is a good one. Having one big upgrade file, at its core, enables you to do is move the logic for "what

Re: Memory leak in CachememoryContext

2023-04-24 Thread Tom Lane
Alvaro Herrera writes: > On 2023-Apr-24, Tom Lane wrote: >> I guess we could have the back branches continue to create a >> shared_cast_context and just not use it in core. Seems rather >> expensive for a very hypothetical compatibility measure, though. > I think a session-long memory leak is

Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands

2023-04-24 Thread Nathan Bossart
On Sat, Apr 22, 2023 at 10:38:58AM -0400, Melanie Plageman wrote: > If you are planning to wait and commit the change to support CLUSTER > (VERBOSE) until July, then you can consolidate the two and say before > v17. If you plan to commit it before then (making it available in v16), > I would move

Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name

2023-04-24 Thread Aleksander Alekseev
Hi, > This is a very good catch and a suggestion. I've slightly reworked the patch, > and I also made this static assertion to have less indirection and, > therefore, make it easier to understand the premise. > Version 2 is attached. ``` sizeof((BackgroundWorker *)NULL)->bgw_library_name ```

Re: Correct the documentation for work_mem

2023-04-24 Thread Imseih (AWS), Sami
Based on the feedback, here is a v1 of the suggested doc changes. I modified Gurjeets suggestion slightly to make it clear that a specific query execution could have operations simultaneously using up to work_mem. I also added the small hash table memory limit clarification. Regards, Sami

Re: Should we remove vacuum_defer_cleanup_age?

2023-04-24 Thread Robert Haas
On Mon, Apr 24, 2023 at 8:36 AM Alvaro Herrera wrote: > The one thing that IMO makes it less confusing is to have it return the > value rather than modifying it in place. Yeah, I don't understand why we have these functions that modify the value in place. Those are probably convenient here and

Re: Memory leak in CachememoryContext

2023-04-24 Thread Alvaro Herrera
On 2023-Apr-24, Tom Lane wrote: > I wrote: > > Alvaro Herrera writes: > >> Hmm, we can leave it unused in our code, but it still needs to be > >> initialized to some valid memory context anyway; otherwise hypothetical > >> code that uses it would still crash. > > > I think we want that to

Re: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call

2023-04-24 Thread Melanie Plageman
On Mon, Apr 24, 2023 at 10:53:35AM +0200, Christoph Berg wrote: > Re: Andres Freund > > Add smgrzeroextend(), FileZero(), FileFallocate() > > Hi, > > I'm often seeing PG16 builds erroring out in the pgbench tests: > > 00:33:12 make[2]: Entering directory '/<>/build/src/bin/pgbench' > 00:33:12

Re: Missing update of all_hasnulls in BRIN opclasses

2023-04-24 Thread Tom Lane
Alvaro Herrera writes: > On 2023-Apr-23, Tomas Vondra wrote: >> Both cases have a patch extending pageinspect to show the new flag, but >> obviously we should commit that only in master. In backbranches it's >> meant only to make testing easier. > In backbranches, I think it should be reasonably

Re: base backup vs. concurrent truncation

2023-04-24 Thread Robert Haas
On Fri, Apr 21, 2023 at 5:19 PM Aleksander Alekseev wrote: > Naturally the database is consistent too. So it looks like the > recovery protocol worked as expected after all, at least in the > upcoming PG16 and this specific scenario. > > Did I miss anything? If not, perhaps we should just update

Re: Missing update of all_hasnulls in BRIN opclasses

2023-04-24 Thread Alvaro Herrera
On 2023-Apr-23, Tomas Vondra wrote: > here's an updated version of the patch, including a backport version. I > ended up making the code yet a bit closer to master by introducing > add_values_to_range(). The current pre-14 code has the loop adding data > to the BRIN tuple in two places, but with

Re: Order changes in PG16 since ICU introduction

2023-04-24 Thread Peter Eisentraut
On 22.04.23 01:00, Jeff Davis wrote: On Fri, 2023-04-21 at 16:33 -0400, Robert Haas wrote: And the fact that "C" or "POSIX" gets transformed into "en-US-u-va-posix" I already expressed, on reflection, that we should probably just not do that. So I think we're in agreement on this point; patch

Re: Order changes in PG16 since ICU introduction

2023-04-24 Thread Peter Eisentraut
On 21.04.23 19:14, Peter Eisentraut wrote: On 21.04.23 19:09, Sandro Santilli wrote: On Fri, Apr 21, 2023 at 11:48:51AM -0400, Tom Lane wrote: "Regina Obe" writes: https://trac.osgeo.org/postgis/ticket/5375 If they actually are using locale C, I would say this is a bug. That should

Re: Memory leak in CachememoryContext

2023-04-24 Thread Tom Lane
I wrote: > Alvaro Herrera writes: >> Hmm, we can leave it unused in our code, but it still needs to be >> initialized to some valid memory context anyway; otherwise hypothetical >> code that uses it would still crash. > I think we want that to happen, actually, because it's impossible > to guess

Re: Minor code de-duplication in fe-connect.c

2023-04-24 Thread Gurjeet Singh
On Mon, Apr 24, 2023 at 5:14 AM Daniel Gustafsson wrote: > > On 21 Apr 2023, at 18:38, Gurjeet Singh wrote: > > > > On Fri, Apr 21, 2023 at 7:47 AM Robert Haas > wrote: > >> > >> On Fri, Apr 21, 2023 at 8:25 AM Daniel Gustafsson > wrote: > >>> The reason I left it like this when reviewing and

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-04-24 Thread Julien Rouhaud
Hi, On Mon, Apr 24, 2023 at 12:03:05PM +, Hayato Kuroda (Fujitsu) wrote: > > > I think that this test should be different when just checking for the > > prerequirements (live_check / --check) compared to actually doing the > > upgrade, > > as it's almost guaranteed that the slots won't have

Re: [PATCH] Allow Postgres to pick an unused port to listen

2023-04-24 Thread Peter Eisentraut
On 19.04.23 06:21, Stephen Frost wrote: I don't think involving pg_ctl is necessary or desirable, since it would make any future changes like that even more complicated. I'm a bit confused by this- if pg_ctl is invoked then we have more-or-less full control over parsing and reporting out the

Re: run pgindent on a regular basis / scripted manner

2023-04-24 Thread Tom Lane
Peter Eisentraut writes: > Does anyone find perltidy useful? To me, it functions more like a > JavaScript compiler in that once you process the source code, it is no > longer useful for manual editing. If we are going to have the buildfarm > check indentation and that is going to be extended

Re: Add missing copyright for pg_upgrade/t/* files

2023-04-24 Thread Andrew Dunstan
On 2023-04-24 Mo 03:08, Hayato Kuroda (Fujitsu) wrote: Dear David, It is great to make sure each file has the Copyright and I see this patch has already been committed. Thanks! While checking more, I was surprised because I found many files which do not have Copyright via " grep -Lr

Re: Memory leak in CachememoryContext

2023-04-24 Thread Tom Lane
Alvaro Herrera writes: >> (Note to self: we can't remove the cast_hash_context field in >> back branches for fear of causing an ABI break for pldebugger. >> But we can leave it unused, I think.) > Hmm, we can leave it unused in our code, but it still needs to be > initialized to some valid

Re: run pgindent on a regular basis / scripted manner

2023-04-24 Thread Peter Eisentraut
On 23.04.23 17:29, Jelte Fennema wrote: On Sun, 23 Apr 2023 at 17:16, Tom Lane wrote: I think we could go ahead and commit the perltidyrc and README changes now. But the ensuing reformatting should happen as part of the mass pgindent run, probably next month sometime. I think it's better to

Re: Memory leak in CachememoryContext

2023-04-24 Thread Alvaro Herrera
On 2023-Apr-21, Tom Lane wrote: > (Note to self: we can't remove the cast_hash_context field in > back branches for fear of causing an ABI break for pldebugger. > But we can leave it unused, I think.) Hmm, we can leave it unused in our code, but it still needs to be initialized to some valid

Re: Request for comment on setting binary format output per session

2023-04-24 Thread Dave Cramer
> > > > > Backing up a level, the purpose of the protocol extension mechanism is > to help us agree on the communication protocol -- that is, the set of > messages that we can send and receive on a certain connection. The > question for the protocol extension mechanism isn't "which types > should

Re: Should we remove vacuum_defer_cleanup_age?

2023-04-24 Thread Alvaro Herrera
On 2023-Apr-22, Andres Freund wrote: > On 2023-04-13 13:18:38 +0200, Alvaro Herrera wrote: > > > > > Updated patch attached. I think we should either apply something like that > > > patch, or at least add a to the docs. > > > > I gave this patch a look. The only code change is that > >

Re: Minor code de-duplication in fe-connect.c

2023-04-24 Thread Daniel Gustafsson
> On 21 Apr 2023, at 18:38, Gurjeet Singh wrote: > > On Fri, Apr 21, 2023 at 7:47 AM Robert Haas wrote: >> >> On Fri, Apr 21, 2023 at 8:25 AM Daniel Gustafsson wrote: >>> The reason I left it like this when reviewing and committing is that I >>> think it >>> makes for more readable code.

Re: Add two missing tests in 035_standby_logical_decoding.pl

2023-04-24 Thread Drouvot, Bertrand
Hi, On 4/24/23 11:45 AM, Amit Kapila wrote: On Mon, Apr 24, 2023 at 11:54 AM Amit Kapila wrote: On Mon, Apr 24, 2023 at 11:24 AM Drouvot, Bertrand wrote: Few comments: +# We can not test if the WAL file still exists immediately. +# We need to let some time to the standby

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-04-24 Thread Hayato Kuroda (Fujitsu)
Dear Vignesh, Thank you for giving comments. New patchset can be available in [1]. > Thanks for the updated patch. > A Few comments: > 1) if the verbose option is enabled, we should print the new slot > information, we could add a function print_slot_infos similar to > print_rel_infos which

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-04-24 Thread Hayato Kuroda (Fujitsu)
Dear Julien, Thank you for giving comments! PSA new version. > I think that this test should be different when just checking for the > prerequirements (live_check / --check) compared to actually doing the upgrade, > as it's almost guaranteed that the slots won't have sent everything when the >

Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name

2023-04-24 Thread Yurii Rashkovskii
Aleksander, On Mon, Apr 24, 2023 at 1:01 PM Aleksander Alekseev < aleksan...@timescale.com> wrote: > > The patch is backwards-compatible and ensures that bgw_library_name > stays *at least* as long as BGW_MAXLEN. Existing external code that uses > BGW_MAXLEN is a length boundary (for example, in

Re: Memory leak in CachememoryContext

2023-04-24 Thread Ajit Awekar
Tom, Thanks a lot for your patch. I applied the changes and confirmed there is no memory leak with the V2 patch. We are not using MemoryContext variables "cast_hash_context" and "shared_cast_context". Thanks & Best Regards, Ajit On Sat, Apr 22, 2023 at 4:49 AM Tom Lane wrote: > Ajit Awekar

Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name

2023-04-24 Thread Aleksander Alekseev
Hi, > The trade-off of this patch is that the `BackgroundWorker` structure becomes > larger. From my perspective, this is a reasonable cost (less than a kilobyte > of extra space per worker). Agree. > The patch is backwards-compatible and ensures that bgw_library_name stays *at > least* as

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-04-24 Thread Etsuro Fujita
On Mon, Apr 24, 2023 at 3:31 PM Nishant Sharma wrote: > Any updates? -- did you get a chance to look into this? Sorry, I have not looked into this yet, because I have been busy with some other work recently. I plan to do so early next week. Best regards, Etsuro Fujita

Re: Add two missing tests in 035_standby_logical_decoding.pl

2023-04-24 Thread Drouvot, Bertrand
Hi, On 4/24/23 8:24 AM, Amit Kapila wrote: On Mon, Apr 24, 2023 at 11:24 AM Drouvot, Bertrand wrote: Few comments: Thanks for looking at it! 1. +$node_subscriber->init(allows_streaming => 'logical'); +$node_subscriber->append_conf('postgresql.conf', 'max_replication_slots

RE: Test failures of 100_bugs.pl

2023-04-24 Thread Yu Shi (Fujitsu)
On Fri, Apr 21, 2023 1:48 PM Yu Shi (Fujitsu) wrote: > > I wrote a patch to dump rel state in wait_for_subscription_sync() as > suggested. > Please see the attached patch. > I will try to add some debug logs in code later. > Please see the attached v2 patch. I added some debug logs when

Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert

2023-04-24 Thread Daniel Gustafsson
> On 21 Apr 2023, at 18:56, Jacob Champion wrote: > > On Fri, Apr 21, 2023 at 12:55 AM Daniel Gustafsson wrote: >> This has been done and the open item marked as completed. > > Thanks! Now that the weirdness is handled by the tests, I think we can > remove the Cirrus workaround. Something like

Re: Add two missing tests in 035_standby_logical_decoding.pl

2023-04-24 Thread Amit Kapila
On Mon, Apr 24, 2023 at 11:54 AM Amit Kapila wrote: > > On Mon, Apr 24, 2023 at 11:24 AM Drouvot, Bertrand > wrote: > > > > Few comments: > > +# We can not test if the WAL file still exists immediately. +# We need to let some time to the standby to actually "remove" it. +my $i = 0;

Re: duplicate function declaration in multirangetypes_selfuncs.c

2023-04-24 Thread Daniel Gustafsson
> On 24 Apr 2023, at 03:35, Alexander Korotkov wrote: > On Sun, Apr 23, 2023 at 3:36 PM Daniel Gustafsson wrote: >> I had planned to backpatch these two fixes for just that reason, to avoid >> the risk for other backpatches not applying. > > OK. I'm good with this plan. Done. -- Daniel

could not extend file "base/5/3501" with FileFallocate(): Interrupted system call

2023-04-24 Thread Christoph Berg
Re: Andres Freund > Add smgrzeroextend(), FileZero(), FileFallocate() Hi, I'm often seeing PG16 builds erroring out in the pgbench tests: 00:33:12 make[2]: Entering directory '/<>/build/src/bin/pgbench' 00:33:12 echo "# +++ tap check in src/bin/pgbench +++" && rm -rf

Re: Add two missing tests in 035_standby_logical_decoding.pl

2023-04-24 Thread Amit Kapila
On Wed, Apr 12, 2023 at 9:45 PM Drouvot, Bertrand wrote: > > > The attached patch also removes: > > " > -log_min_messages = 'debug2' > -log_error_verbosity = verbose > " > > as also discussed in [1]. > I agree that we should reduce the log level here. It is discussed in an email [1]. I'll push

Re: New committers: Nathan Bossart, Amit Langote, Masahiko Sawada

2023-04-24 Thread Jesper Pedersen
On 4/20/23 13:40, Tom Lane wrote: The Core Team would like to extend our congratulations to Nathan Bossart, Amit Langote, and Masahiko Sawada, who have accepted invitations to become our newest Postgres committers. Please join me in wishing them much success and few reverts. Huge congrats !

Re: xmlserialize bug - extra empty row at the end

2023-04-24 Thread Jim Jones
On 24.04.23 03:18, Tom Lane wrote: I wouldn't actually *use* pchomp here, because that induces an unnecessary copy of the result string. I had in mind more like copying pchomp's code to count up the trailing newline(s) and then pass a corrected length to cstring_to_text_with_len. Changed.

Re: New committers: Nathan Bossart, Amit Langote, Masahiko Sawada

2023-04-24 Thread Andrey M. Borodin
> On 20 Apr 2023, at 22:40, Tom Lane wrote: > > The Core Team would like to extend our congratulations to > Nathan Bossart, Amit Langote, and Masahiko Sawada, who have > accepted invitations to become our newest Postgres committers. > > Please join me in wishing them much success and few

Re: Improving worst-case merge join performance with often-null foreign key

2023-04-24 Thread Richard Guo
On Sun, Apr 23, 2023 at 5:29 PM Richard Guo wrote: > On Sat, Apr 22, 2023 at 11:21 PM Tom Lane wrote: > >> Steinar Kaldager writes: >> > First-time potential contributor here. We recently had an incident due >> > to a sudden 1000x slowdown of a Postgres query (from ~10ms to ~10s) >> > due to a

Re: pg_upgrade and logical replication

2023-04-24 Thread Julien Rouhaud
Hi, On Tue, Apr 18, 2023 at 01:40:51AM +, Hayato Kuroda (Fujitsu) wrote: > > I found a cfbot failure on macOS [1]. According to the log, > "SELECT count(*) FROM t2" was executed before synchronization was done. > > ``` > [09:24:21.018](0.132s) not ok 18 - Table t2 should now have 3 rows on

Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-24 Thread Nikita Malakhov
Hi, This is a production case for large databases with high update rates, but is mistaken with reaching table size limit, although size limit is processed correctly. The note on TOAST limitation does not mention that TOAST values are not actually updated on UPDATE operation - old value is marked

RE: Add missing copyright for pg_upgrade/t/* files

2023-04-24 Thread Hayato Kuroda (Fujitsu)
Dear David, > It is great to make sure each file has the Copyright and I see this > patch has already been committed. Thanks! While checking more, I was surprised because I found many files which do not have Copyright via " grep -Lr Copyright --exclude-dir .git ..." command. I'm not sure whether

Re: Autogenerate some wait events code and documentation

2023-04-24 Thread Drouvot, Bertrand
Hi, On 4/24/23 5:15 AM, Michael Paquier wrote: On Sat, Apr 22, 2023 at 03:36:05PM +0200, Drouvot, Bertrand wrote: On 4/20/23 3:09 AM, Michael Paquier wrote: It is clear that the format of the file is: - category - C symbol in enums. - Format in the system views. - Description in the docs. Or

Re: pg_upgrade and logical replication

2023-04-24 Thread Julien Rouhaud
Hi, On Fri, Apr 14, 2023 at 04:19:35AM +, Hayato Kuroda (Fujitsu) wrote: > > I have tested, but srsublsn became NULL if copy_data was specified as off. > This is because when copy_data is false, all tuples in pg_subscription_rels > are filled > as state = 'r' and srsublsn = NULL, and

Re: Perform streaming logical transactions by background workers and parallel apply

2023-04-24 Thread Masahiko Sawada
On Mon, Apr 24, 2023 at 2:24 PM Amit Kapila wrote: > > On Mon, Apr 24, 2023 at 7:26 AM Masahiko Sawada wrote: > > > > While looking at the worker.c, I realized that we have the following > > code in handle_streamed_transaction(): > > > > default: > > Assert(false); > >

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-04-24 Thread Nishant Sharma
Hi Etsuro Fujita, Any updates? -- did you get a chance to look into this? Regards, Nishant. On Mon, Apr 17, 2023 at 11:00 AM Nishant Sharma < nishant.sha...@enterprisedb.com> wrote: > Thanks Etsuro for your response! > > One small typo correction in my answer to "What is the technical

Re: Add two missing tests in 035_standby_logical_decoding.pl

2023-04-24 Thread Amit Kapila
On Mon, Apr 24, 2023 at 11:24 AM Drouvot, Bertrand wrote: > Few comments: 1. +$node_subscriber->init(allows_streaming => 'logical'); +$node_subscriber->append_conf('postgresql.conf', 'max_replication_slots = 4'); Why do we need slots on the subscriber? 2. +# Speed up the

Re: pg_upgrade and logical replication

2023-04-24 Thread Julien Rouhaud
Hi, On Thu, Apr 13, 2023 at 03:26:56PM +1000, Peter Smith wrote: > > 1. > All the comments look alike, so it is hard to know what is going on. > If each of the main test parts could be highlighted then the test code > would be easier to read IMO. > > Something like below: > [...] I added a bit

Re: [PATCH] Infinite loop while acquiring new TOAST Oid

2023-04-24 Thread Nikita Malakhov
Hi! No, it wasn't. It was a proposal, I thought I'd get some feedback on it before sending it to commitfest. On Sat, Apr 22, 2023 at 6:17 PM Gurjeet Singh wrote: > On Thu, Dec 22, 2022 at 10:07 AM Nikita Malakhov > wrote: > > Any suggestions on the previous message (64-bit toast value ID with