Re: Assertion failure in smgr.c when using pg_prewarm with partitioned tables

2025-07-04 Thread Fujii Masao
On 2025/06/02 16:32, Masahiro Ikeda wrote: OK, I think v5-0002 should be back-patched, since using incorrect error codes is essentially a bug. Thanks for updating the patches! While reviewing the code: amtup = SearchSysCache1(AMOID, ObjectIdGetDatum(am_id));

Re: Support for 8-byte TOAST values (aka the TOAST infinite loop problem)

2025-07-04 Thread Nikita Malakhov
Hi! Hannu, we'd already made an attempt to extract the TOAST functionality as API and make it extensible and usable by other AMs in [1], the patch set was met calmly but we still have some hopes on it. Michael, glad you continue this work! Took patch set for review. [1] Pluggable TOAST

Re: Remove unused wait_event_info parameter in FileStartReadV()

2025-07-04 Thread Aleksander Alekseev
Hi Bertrand, > While working on wait events related stuff, I noticed that the wait_event_info > parameter in FileStartReadV() is unused. > > The unused parameter is there since 50cb7505b301, and I think it's ok to just > remove it (as it is set correctly in pgaio_io_perform_synchronously()). Any

Remove unused wait_event_info parameter in FileStartReadV()

2025-07-04 Thread Bertrand Drouvot
Hi hackers, While working on wait events related stuff, I noticed that the wait_event_info parameter in FileStartReadV() is unused. The unused parameter is there since 50cb7505b301, and I think it's ok to just remove it (as it is set correctly in pgaio_io_perform_synchronously()). PFA, a patch d

Re: Remove unused wait_event_info parameter in FileStartReadV()

2025-07-04 Thread Bertrand Drouvot
Hi Aleksander, On Fri, Jul 04, 2025 at 01:16:02PM +0300, Aleksander Alekseev wrote: > Hi Bertrand, > > > While working on wait events related stuff, I noticed that the > > wait_event_info > > parameter in FileStartReadV() is unused. > > > > The unused parameter is there since 50cb7505b301, and I

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

2025-07-04 Thread Hayato Kuroda (Fujitsu)
Dear Ikeda-san, Nagata-san, Thanks for updating the patch! > > Could I confirm what you mean by "start new one"? > > > > In the current pgbench, when a query raises an error (a deadlock or > > serialization failure), it can be retried using the same random state. > > This typically means the quer

Re: Bloom Filter improvements in postgesql

2025-07-04 Thread Ross Heaney
Hi David, I appreciate you taking the time to explore this. I plan to work on getting the patches more production ready state and do some more benchmarking. I also appreciate you highlighting that I did not reply to all in my previous email. This was an oversight on my part. I will paste my messag

Re: A assert failure when initdb with track_commit_timestamp=on

2025-07-04 Thread Fujii Masao
On 2025/07/05 0:30, Tom Lane wrote: Fujii Masao writes: On 2025/07/04 16:29, Hayato Kuroda (Fujitsu) wrote: If more GUCs were found which cannot be set during the bootstrap mode, how about introducing a new flag like GUC_DEFAULT_WHILE_BOOTSTRAPPING for GUC variables? If the flag is set all

Re: A assert failure when initdb with track_commit_timestamp=on

2025-07-04 Thread Fujii Masao
On 2025/07/04 16:29, Hayato Kuroda (Fujitsu) wrote: Dear Fujii-san, By the way, although it's a separate issue, I noticed that running initdb -c transaction_timeout=1 causes an assertion failure: I feel it may be able to discuss in other places OK, I've started a new thread for this issu

Re: Add progressive backoff to XactLockTableWait functions

2025-07-04 Thread Xuneng Zhou
Hi, On Thu, Jul 3, 2025 at 9:30 AM Xuneng Zhou wrote: > Hi, > >> >> >>> On 2025-07-02 22:55:16 +0900, Fujii Masao wrote: >> On 2025/06/24 1:32, Xuneng Zhou wrote: >> > 3. The proposed solution >> > >> > If the above analysis is sound, one potential fix would be to add >> > s

Re: Support for 8-byte TOAST values (aka the TOAST infinite loop problem)

2025-07-04 Thread Hannu Krosing
Hi Michael I'll take a look at the patch set. While digging around in the TOAST code did you have any ideas on how one could extract the TOAST APIs in a way that they can be added in Table Access Method definition ? Not all TAMs need TOAST, but the ones that do could also be the ones that still

Re: Adding basic NUMA awareness

2025-07-04 Thread Jakub Wartak
On Tue, Jul 1, 2025 at 9:07 PM Tomas Vondra wrote: Hi! > 1) v1-0001-NUMA-interleaving-buffers.patch [..] > It's a bit more complicated, because the patch distributes both the > blocks and descriptors, in the same way. So a buffer and it's descriptor > always end on the same NUMA node. This is on

Re: Improve verification of recovery_target_timeline GUC.

2025-07-04 Thread David Steele
On 7/2/25 22:24, Michael Paquier wrote: On Fri, Apr 25, 2025 at 01:50:16PM +, David Steele wrote: That was my expectation. I just had some time to get this patch updated so took the opportunity. And well, now is the time to get this patch done. So, applied after an extra lookup, with a sw

Re: amcheck: Remove unused IndexCheckableCallback typedef

2025-07-04 Thread Fujii Masao
On 2025/07/04 17:25, Andrey Borodin wrote: On 4 Jul 2025, at 10:50, Fujii Masao wrote: From the discussion in [1], it seems this typedef was originally used as a function argument in early versions of the patch. However, the argument was removed in v23, and the typedef was accidentally l

Re: Changing shared_buffers without restart

2025-07-04 Thread Dmitry Dolgov
> On Fri, Jul 04, 2025 at 02:06:16AM +0200, Tomas Vondra wrote: > I took a look at this patch, because it's somewhat related to the NUMA > patch series I posted a couple days ago, and I've been wondering if > it makes some of the NUMA stuff harder or simpler. Thanks a lot for the review! It's a pl

Re: Report replica identity in pg_publication_tables

2025-07-04 Thread Ashutosh Bapat
On Wed, Jul 2, 2025 at 1:46 PM Zhijie Hou (Fujitsu) wrote: > > I'm concerned about whether we can correctly display replica identity in the > view for partitioned tables. > > In the case of partitioned tables, we display only the root table in the view > if publish_via_partition_root is enabled f

Re: Assertion failure during initdb with transaction_timeout set

2025-07-04 Thread Tom Lane
Fujii Masao writes: > While discussing the assertion failure with track_commit_timestamp=on during > initdb [1], > I found a similar issue with another GUC: transaction_timeout. > This happens because enable_timeout() tries to start the transaction timeout > before InitializeTimeouts() has been

Re: Using failover slots for PG-non_PG logical replication

2025-07-04 Thread Ashutosh Bapat
On Fri, Jul 4, 2025 at 9:23 AM Amit Kapila wrote: > > > > > > > How about this: > > We change the following sentence in the third paragraph > > To confirm that the standby server is indeed ready for failover > addition> so that a given PostgreSQL subscriber can continue logical > > replication ,

Re: POC: Parallel processing of indexes in autovacuum

2025-07-04 Thread Matheus Alcantara
On Wed Jun 18, 2025 at 5:03 AM -03, Daniil Davydov wrote: > > Thanks for the review! Please, see v5 patch : > 1) GUC variable and field in autovacuum shmem are renamed > 2) ParallelAutoVacuumReleaseWorkers call moved from parallel.c to > vacuumparallel.c > 3) max_parallel_autovacuum_workers is now

Re: PG 18 beta1 release notes misses mention of pg_noreturn

2025-07-04 Thread Ashutosh Bapat
On Thu, Jul 3, 2025 at 8:08 PM Steve Chavez wrote: > > Yes, otherwise I had to grep the commits in `git log` and find what's the > correct way to use `pg_noreturn`. > It's not a simple keyword replacement since the order has to change now: > > Old: void my_worker(Datum main_arg) pg_attribute_nore

Re: Changing shared_buffers without restart

2025-07-04 Thread Tomas Vondra
On 7/4/25 16:41, Dmitry Dolgov wrote: >> On Fri, Jul 04, 2025 at 02:06:16AM +0200, Tomas Vondra wrote: >> I took a look at this patch, because it's somewhat related to the NUMA >> patch series I posted a couple days ago, and I've been wondering if >> it makes some of the NUMA stuff harder or simple

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

2025-07-04 Thread Yugo Nagata
On Fri, 4 Jul 2025 13:01:12 + "Hayato Kuroda (Fujitsu)" wrote: > Thanks for the diagram, it's quite helpful. Let me share my understanding and > opinion. > > The terminology "retry" is being used for the transition > CSTATE_ERROR->CSTATE_RETRY, > and here the random state would be restored

Re: A assert failure when initdb with track_commit_timestamp=on

2025-07-04 Thread Tom Lane
Fujii Masao writes: > On 2025/07/04 16:29, Hayato Kuroda (Fujitsu) wrote: >> If more GUCs were found which cannot be set during the bootstrap mode, how >> about >> introducing a new flag like GUC_DEFAULT_WHILE_BOOTSTRAPPING for GUC >> variables? >> If the flag is set all setting can be ignored w

Re: Assertion failure during initdb with transaction_timeout set

2025-07-04 Thread Fujii Masao
On 2025/07/04 23:47, Tom Lane wrote: Fujii Masao writes: While discussing the assertion failure with track_commit_timestamp=on during initdb [1], I found a similar issue with another GUC: transaction_timeout. This happens because enable_timeout() tries to start the transaction timeout be

Re: [PATCH] Allow parallelism for plpgsql return expression after commit 556f7b7

2025-07-04 Thread Tom Lane
Dilip Kumar writes: > On Fri, Jul 4, 2025 at 1:22 AM Tom Lane wrote: >> There's no initplan in the given test case, so I don't see how >> that idea is going to fix it. Also, allowing initplans to begin >> parallelism when the outer query isn't using parallelism seems >> like it'd be fraught with

Re: Metadata and record block access stats for indexes

2025-07-04 Thread Mircea Cadariu
Hi, Just attaching v2 of the patch.  It’s a trimmed down version compared to what I started with.  For context, this is the original discussion on which this work is based on: https://www.postgresql.org/message-id/flat/CAH2-WzmdZqxCS1widYzjDAM%2BZ-Jz%3DejJoaWXDVw9Qy1UsK0tLA%40mail.gmail.com

Re: Add progressive backoff to XactLockTableWait functions

2025-07-04 Thread Fujii Masao
On 2025/07/04 17:57, Xuneng Zhou wrote: Hi, On Thu, Jul 3, 2025 at 9:30 AM Xuneng Zhou mailto:xunengz...@gmail.com>> wrote: Hi, >>> On 2025-07-02 22:55:16 +0900, Fujii Masao wrote: On 2025/06/24 1:32, Xuneng Zhou wrote: > 3. The proposed solution

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2025-07-04 Thread Álvaro Herrera
Two more minor things on this: I found it a bit silly to mention the ALTER command in the error message and then output only the three-part-qualified name in the output file (and no specific command to run) -- so for an instant I was tempted to write the full ALTER TABLE command in the output file

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2025-07-04 Thread Alvaro Herrera
On 2025-Jul-03, Tom Lane wrote: > Alvaro Herrera writes: > > On 2025-Jul-03, Justin Pryzby wrote: > >>> Actually I think we should consider backporting to all live versions > > >> If you don't backpatch it, there's no point. > > > Oh yeah, you're absolutely right. > > No, it'd still be useful

Re: Add progressive backoff to XactLockTableWait functions

2025-07-04 Thread Andres Freund
On 2025-07-05 01:14:45 +0900, Fujii Masao wrote: > > > On 2025/07/04 17:57, Xuneng Zhou wrote: > > Hi, > > > > On Thu, Jul 3, 2025 at 9:30 AM Xuneng Zhou > > wrote: > > > > Hi, > > > > > > >>> On 2025-07-02 22:55:16 +0900, Fujii Masao wrote: > >

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2025-07-04 Thread Alvaro Herrera
Hmm, crake doesn't like the fact that there's no regnamespace in 9.4. Apparently in version 13 we claim to support back to 9.0. I only tried with an old server version 12. Should be an easy fix ... -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/

Re: cpluspluscheck vs ICU again

2025-07-04 Thread Andres Freund
Hi, On 2025-07-02 14:01:13 +0700, John Naylor wrote: > On Tue, Jul 1, 2025 at 9:24 PM Tom Lane wrote: > > Ha, indeed you are right. On my RHEL9 box, it's kinda drowned out > > by complaints about > > > > /usr/include/c++/11/bits/range_access.h:109:3: error: template with C > > linkage > > 109

Re: Explicitly enable meson features in CI

2025-07-04 Thread Daniel Gustafsson
> On 4 Jul 2025, at 09:33, Nazir Bilal Yavuz wrote: > On Thu, 3 Jul 2025 at 17:07, Daniel Gustafsson wrote: >> An alternative approach would be to instead of having opt-in's for >> non-Windows >> have opt-outs for Windows, ie a MESON_WINDOWS_EXCLUDES which does =disabled >> on >> the specific

Re: [PATCH] Allow parallelism for plpgsql return expression after commit 556f7b7

2025-07-04 Thread Dilip Kumar
On Fri, Jul 4, 2025 at 9:56 PM Tom Lane wrote: > > Dilip Kumar writes: > > On Fri, Jul 4, 2025 at 1:22 AM Tom Lane wrote: > >> There's no initplan in the given test case, so I don't see how > >> that idea is going to fix it. Also, allowing initplans to begin > >> parallelism when the outer quer

Re: Bloom Filter improvements in postgesql

2025-07-04 Thread Matthias van de Meent
On Fri, 4 Jul 2025 at 17:43, Ross Heaney wrote: > The witness does not store information for every element in the entire > universe. Instead, it only needs to store a bit for each element that passes > the Bloom filter test. I think this has a major flaw, in that it is nearly impossible to guar

Re: A assert failure when initdb with track_commit_timestamp=on

2025-07-04 Thread Tom Lane
Fujii Masao writes: > On 2025/07/05 0:30, Tom Lane wrote: >> As I remarked in the other thread, I don't like inventing a different >> solution for each GUC. So if there are even two that need something >> done, I think Hayato-san's idea has merit. > This code seems to assume that the processing

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2025-07-04 Thread Tom Lane
Alvaro Herrera writes: > On 2025-Jul-04, Alvaro Herrera wrote: >> Hmm, crake doesn't like the fact that there's no regnamespace in 9.4. >> Apparently in version 13 we claim to support back to 9.0. I only tried >> with an old server version 12. Should be an easy fix ... > It goes like this. It'

walwriter can set XLP_BKP_REMOVABLE wrongly: race w/ backup start

2025-07-04 Thread Noah Misch
During a post-commit review of bc22dc0 "Get rid of WALBufMappingLock", I got suspicious of this older AdvanceXLInsertBuffer() code: /* * If online backup is not in progress, mark the header to indicate * that WAL records beginning in this page hav

Re: Adding basic NUMA awareness

2025-07-04 Thread Tomas Vondra
On 7/4/25 13:05, Jakub Wartak wrote: > On Tue, Jul 1, 2025 at 9:07 PM Tomas Vondra wrote: > > Hi! > >> 1) v1-0001-NUMA-interleaving-buffers.patch > [..] >> It's a bit more complicated, because the patch distributes both the >> blocks and descriptors, in the same way. So a buffer and it's descrip

Re: Get rid of WALBufMappingLock

2025-07-04 Thread Noah Misch
On Mon, Mar 31, 2025 at 09:18:30PM +0300, Alexander Korotkov wrote: > I'm going to push the first patch ("nowalbuf") if no objections. I completed a post-commit review of this patch. I think the patch is correct. I found some of the variable names and comments challenging, so I made the attache

Re: Inconsistent LSN format in pg_waldump output

2025-07-04 Thread Álvaro Herrera
On 2025-Jul-04, Japin Li wrote: > I've opted to directly use %X/%08X for LSN formatting in this patch, with an > accompanying comment near LSN_FORMAT_ARGS. Thank you! I support this approach and intend to work on getting this patch committed soon after some more review, unless there are further

amcheck: Remove unused IndexCheckableCallback typedef

2025-07-04 Thread Fujii Masao
Hi, Commit d70b17636dd introduced the IndexCheckableCallback typedef for a callback function, but it appears to be unused. From the discussion in [1], it seems this typedef was originally used as a function argument in early versions of the patch. However, the argument was removed in v23, and th

Re: Adding pg_dump flag for parallel export to pipes

2025-07-04 Thread Hannu Krosing
I have added this to the commitfest We would be grateful for any reviews and feedback on this. When adding to commitfest I tried to put Nitin as "first author" as he has done the bulk of the work (I did just a quick pg_dump-only PoC) but it looks like Commitfest just orders all provided authors a

Re: Fix deprecation warning with libxml2 2.14 in contrib/xml2/

2025-07-04 Thread Jim Jones
On 04.07.25 06:03, Michael Paquier wrote: > The solution is simple: we need to replace buf->content by a call to > xmlBufferContent(). This routine exists since be803967dbec (year > 2000), so 25 years should make that safe enough to use. > > The last batch of libxml deprecation warning fixes we

RE: A assert failure when initdb with track_commit_timestamp=on

2025-07-04 Thread Hayato Kuroda (Fujitsu)
Dear Fujii-san, > By the way, although it's a separate issue, I noticed that running > initdb -c transaction_timeout=1 causes an assertion failure: I feel it may be able to discuss in other places but let me say one comment. > running bootstrap script ... TRAP: failed Assert("all_timeouts_initia

Re: Explicitly enable meson features in CI

2025-07-04 Thread Nazir Bilal Yavuz
Hi, On Thu, 3 Jul 2025 at 17:07, Daniel Gustafsson wrote: > > > On 3 Jul 2025, at 15:50, Nazir Bilal Yavuz wrote: > > On Thu, 3 Jul 2025 at 16:21, Daniel Gustafsson wrote: > > >> + # Like 'MESON_COMMON_FEATURES' but not shared with 'Windows - VS' task > >> too > >> + MESON_NON_VS_FEATURES: >

Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2025-07-04 Thread Ilia Evdokimov
On 01.05.2025 15:22, Ilia Evdokimov wrote: I attached updated v9 patch with the suggested changes. The updated line in the EXPLAIN looks like this: Text format:     Estimates: capacity=1 distinct keys=1 lookups=2 hit percent=50.00% Non-text format:     Estimated Capacity: 1     Estimated Dist

Re: amcheck: Remove unused IndexCheckableCallback typedef

2025-07-04 Thread Andrey Borodin
> On 4 Jul 2025, at 10:50, Fujii Masao wrote: > > From the discussion in [1], it seems this typedef was originally used as > a function argument in early versions of the patch. However, > the argument was removed in v23, and the typedef was accidentally left behind. Yes, your analysis is corr

Re: Add 64-bit XIDs into PostgreSQL 15

2025-07-04 Thread Andrey Borodin
> On 2 Jul 2025, at 18:38, Maxim Orlov wrote: > > If you > know of any real problems, please tell me If I understood correctly, pages can differ on primary and standby. That might be problematic for WAL debug tests. Best regards, Andrey Borodin.

Assertion failure during initdb with transaction_timeout set

2025-07-04 Thread Fujii Masao
Hi, While discussing the assertion failure with track_commit_timestamp=on during initdb [1], I found a similar issue with another GUC: transaction_timeout. Running initdb -c transaction_timeout=1 triggers the following assertion failure: running bootstrap script ... TRAP: failed Assert("all_t

Wrong off type in smgrfd and mdfd

2025-07-04 Thread 邱宇航
While reading code, I notice off in mdfd is an uint32, which might be problematic. Considering enlarge segsize to 8GB and even larger, the off might be overflowed. So I change it to off_t. Best regards, Yuhang Qiu 0001-Change-off-in-mdfd-from-uint32-to-off_t.patch Description: Binary data

Re: Add 64-bit XIDs into PostgreSQL 15

2025-07-04 Thread Yura Sokolov
04.07.2025 11:31, Andrey Borodin wrote: > > >> On 2 Jul 2025, at 18:38, Maxim Orlov wrote: >> >> If you >> know of any real problems, please tell me > > If I understood correctly, pages can differ on primary and standby. That > might be problematic for WAL debug tests. They may differ. They

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2025-07-04 Thread Alvaro Herrera
On 2025-Jul-04, Alvaro Herrera wrote: > Hmm, crake doesn't like the fact that there's no regnamespace in 9.4. > Apparently in version 13 we claim to support back to 9.0. I only tried > with an old server version 12. Should be an easy fix ... It goes like this. It's tested with 9.2 only though,

Re: Non-blocking archiver process

2025-07-04 Thread Noah Misch
On Fri, Jul 04, 2025 at 08:46:08AM +0200, Ronan Dunklau wrote: > We've noticed a behavior that seems surprising to us. > Since DROP DATABASE now waits for a ProcSignalBarrier, it can hang up > indefinitely if the archive_command hangs. > > The reason for this is that the builtin archive module

Re: array_random

2025-07-04 Thread jian he
On Mon, Jun 30, 2025 at 11:04 PM jian he wrote: > > demo: > SELECT array_random(1, 6, array[2,5], array[2,4]); > array_random > -- > [2:3][4:8]={{6,2,2,5,4},{4,5,6,4,6}} > > reasons for adding array_random is: > 1. This is better than array_fill. T

Re: alter check constraint enforceability

2025-07-04 Thread jian he
On Mon, Jun 2, 2025 at 9:57 PM jian he wrote: > > Currently in pg18, we can add not enforced check constraints. > but we can not do ALTER TABLE ALTER CONSTRAINT [NOT] ENFORCED > for check constraint. > > The attached patch is implementation of changing enforceability of > check constraint. hi. r

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

2025-07-04 Thread Yugo Nagata
Hi, On Tue, 1 Jul 2025 17:43:18 +0900 Rintaro Ikeda wrote: > I've updated the previous patch based on your feedback. Below is a summary of > the changes from v4 to v5: Thank you for updating the patch. > On 2025/06/14 0:24, Yugo Nagata wrote: > > case PGRES_NONFATAL_ERROR: > >

Re: cpluspluscheck vs ICU again

2025-07-04 Thread Tom Lane
Andres Freund writes: > On 2025-07-02 14:01:13 +0700, John Naylor wrote: >> I came up with the attached -- Andres, Peter, does this match your >> recollection? > I think the proper fix here would be to not expose ucol.h to the world, > i.e. not include it from something like pg_locale.h. The st

Re: A assert failure when initdb with track_commit_timestamp=on

2025-07-04 Thread Tom Lane
Michael Paquier writes: > This is assuming that the default value assigned to a GUC will always > take the right decision in the bootstrap case, which is perhaps OK > anyway in most cases, or we would know about that during initdb. Yeah, I've been wondering about whether the code ought to accept

Re: stats.sql might fail due to shared buffers also used by parallel tests

2025-07-04 Thread Alexander Lakhin
Hello Shlok, 03.07.2025 09:54, Shlok Kyal wrote: I have also encountered a similar buildfarm failure [1]. | 1/1 + subscription 142 ms FAIL 1/1 postgresql:regress / regress/regress ERROR 284.85s exit status 1 diff --strip-trailing-cr -U3 c:/build-farm-lo

Re: Support for 8-byte TOAST values (aka the TOAST infinite loop problem)

2025-07-04 Thread Michael Paquier
On Fri, Jul 04, 2025 at 02:38:34PM +0300, Nikita Malakhov wrote: > Hannu, we'd already made an attempt to extract the TOAST functionality as > API and make it extensible and usable by other AMs in [1], the patch > set was met calmly but we still have some hopes on it. Yeah, it's one of these I hav

Re: A assert failure when initdb with track_commit_timestamp=on

2025-07-04 Thread Michael Paquier
On Fri, Jul 04, 2025 at 11:30:17AM -0400, Tom Lane wrote: > As I remarked in the other thread, I don't like inventing a different > solution for each GUC. So if there are even two that need something > done, I think Hayato-san's idea has merit. > > + /* > + * Certain GUCs aren't safe to e