Re: amcheck support for BRIN indexes

2025-08-03 Thread Arseniy Mukhin
On Fri, Aug 1, 2025 at 11:22 PM Arseniy Mukhin wrote: > > Hi, > > On Tue, Jul 22, 2025 at 6:43 PM Arseniy Mukhin > wrote: > > > > Hi, > > > > While reviewing gist amcheck patch [1] I realized that brin amcheck > > also must check if current snapshot is OK with index indcheckxmin (as > > btree, gi

Re: Skipping schema changes in publication

2025-08-03 Thread Shlok Kyal
On Tue, 22 Jul 2025 at 15:57, shveta malik wrote: > > Shlok, I was trying to validate the interaction of > 'publish_via_partition_root' with 'EXCEPT". Found some unexpected > behaviour, can you please review: > > Pub: > - > CREATE TABLE tab_root (range_col int,i int,j int) PARTITION BY RAN

Re: Skipping schema changes in publication

2025-08-03 Thread Shlok Kyal
On Wed, 23 Jul 2025 at 10:08, shveta malik wrote: > > I further tested inherited tables flow as well wrt ONLY and EXCEPT, it > works well. But while reading docs for the saem, I have few concerns. > > 1) > While explaining ONLY for EXCEPT, create-publication doc says this > > + This does not

Re: Skipping schema changes in publication

2025-08-03 Thread Shlok Kyal
On Tue, 22 Jul 2025 at 14:29, shveta malik wrote: > > On Sat, Jul 19, 2025 at 4:17 PM Shlok Kyal wrote: > > > > On Mon, 30 Jun 2025 at 16:25, shveta malik wrote: > > > > > > Few more comments on 002: > > > > > > 5) > > > +GetAllTablesPublicationRelations(Oid pubid, bool pubviaroot) > > > { > >

Re: Inval reliability, especially for inplace updates

2025-08-03 Thread Paul A Jungwirth
On Thu, Jul 31, 2025 at 9:53 AM Paul A Jungwirth wrote: > On Thu, Oct 31, 2024 at 09:20:52PM -0700, Noah Misch wrote: > > Here, one of the autovacuum workers had the guilty stack trace, appearing at > > the end of this message. heap_inplace_update_and_unlock() calls > > CacheInvalidateHeapTupleIn

Re: restore_command return code behaviour

2025-08-03 Thread Jean-Christophe Arnu
> > > > I don't think Jean-Christophe's stated problem is with the server's > error message (Jean-Christophe, please jump in and correct me) -- it's > in knowing how to design the command so that the system behaves > correctly. I'm not very excited about removing information at the same > time that

Re: Convert varatt.h macros to static inline functions

2025-08-03 Thread Tom Lane
It looks like the majority vote is still in favor of writing out DatumGetPointer instead of using "_D()" functions, so let's roll with that approach. I looked through our two versions of the varatt.h changes and merged them. The attached is only cosmetically different from yours, I think --- most

Re: Test instability when pg_dump orders by OID

2025-08-03 Thread Noah Misch
On Fri, Jul 25, 2025 at 02:01:01PM -0400, Robert Haas wrote: > On Thu, Jul 24, 2025 at 10:27 PM Noah Misch wrote: > > I regret missing those in v1. I've attached v2, including branch-specific > > patches. I'll first need to back-patch 350e6b8, which fixed sorting of > > CREATE > > RULE, to v17

Re: Fix a typo of comments in AutoVacLauncherMain

2025-08-03 Thread Yugo Nagata
On Fri, 1 Aug 2025 10:00:48 -0700 Masahiko Sawada wrote: > On Fri, Aug 1, 2025 at 8:20 AM Yugo Nagata wrote: > > > > Hi, > > > > While reading autovacuum.c, I found the following comments in > > AutoVacLauncherMain() right before the call to rebuild_database_list(); > > > > * Create the

Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions

2025-08-03 Thread jian he
hi. fix the regress tests failure in https://api.cirrus-ci.com/v1/artifact/task/5894868779663360/testrun/build/testrun/regress/regress/regression.diffs From e60e5190511326568eba8e6748062adb47f1134c Mon Sep 17 00:00:00 2001 From: jian he Date: Fri, 18 Jul 2025 13:00:19 +0800 Subject: [PATCH v4 2/3

Re: Pathify RHS unique-ification for semijoin planning

2025-08-03 Thread Richard Guo
On Fri, Aug 1, 2025 at 11:58 PM Alexandra Wang wrote: > While reviewing the code, the following diff concerns me: > if (joinrel->consider_parallel && > - save_jointype != JOIN_UNIQUE_OUTER && > - save_jointype != JOIN_FULL && > - save_jointype != JOIN_RIGHT && > - save_jointype != JOIN_RIGHT_AN

Re: [PATCH] Avoid unnecessary code execution in Instrument.c when TIMING is FALSE

2025-08-03 Thread torikoshia
On 2025-07-26 00:26, Hironobu SUZUKI wrote: Thanks for the proposal! Hi, Even when using EXPLAIN ANALYZE with TIMING=FALSE, the functions InstrStopNode(), InstrEndLoop(), and InstrAggNode() in Instrument.c still execute code related to the "starttime", "counter", "firsttuple", "startup", and "

Re: restore_command return code behaviour

2025-08-03 Thread David G. Johnston
On Mon, Jul 28, 2025 at 2:22 PM Jacob Champion < jacob.champ...@enterprisedb.com> wrote: > On Mon, Jul 28, 2025 at 1:58 PM Jean-Christophe Arnu > wrote: > > Or > > > > The recovery will be aborted and the server will stop if any of the > following events occur: > > - the command was terminated by

Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX

2025-08-03 Thread Julien Rouhaud
On Mon, Aug 04, 2025 at 01:19:46PM +0900, Michael Paquier wrote: > On Sat, Aug 02, 2025 at 03:09:19PM -0400, Shayon Mukherjee wrote: > > Per this plan, this would mean that pg_hint_plan would need to > > support index-level hints, and it’s not a massive / impossible > > task. But it also means that

Re: A little cosmetic to convert_VALUES_to_ANY()

2025-08-03 Thread Tender Wang
Chao Li 于2025年8月4日周一 11:11写道: > I tested this patch locally and it works for me. > > However I doubt if it really improve performance. The original code > "contain_volatile_functions((Node *) rte->values_lists)" recursively work > through rte-values_list, and this patch move contain_volatile_func

Re: implement CAST(expr AS type FORMAT 'template')

2025-08-03 Thread jian he
hi. one more question: For binary coercible type casts, no formatted related function for it, should we error out? For example, should the following error out or return text '1'. select cast('1'::text as text format ''::text);

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-03 Thread Amit Kapila
On Fri, Aug 1, 2025 at 2:50 PM shveta malik wrote: > > 5) > I tried a test where there were 4 slots on the publisher, where one > was getting used while the others were not. Initiated > pg_sync_replication_slots on standby. Forced unused slots to be > invalidated by setting idle_replication_slot_t

Re: Dropping publication breaks logical replication

2025-08-03 Thread Ashutosh Bapat
Hi Vignesh, Thanks for the patches. On Sat, Aug 2, 2025 at 7:10 PM vignesh C wrote: > > > > The backport seems to be straight forward. Please let me know if you > > need my help in doing so, if we decide to backport the fix. > > Now that this has been reported on the back branches, we should > c

Re: Automatically sizing the IO worker pool

2025-08-03 Thread Thomas Munro
On Wed, Jul 30, 2025 at 10:15 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > Thanks. I was experimenting with this approach, and realized there isn't > much metrics exposed about workers and the IO queue so far. Since the Hmm. You can almost infer the depth from the pg_aios view. All IOs in u

Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX

2025-08-03 Thread Michael Paquier
On Sat, Aug 02, 2025 at 03:09:19PM -0400, Shayon Mukherjee wrote: > Per this plan, this would mean that pg_hint_plan would need to > support index-level hints, and it’s not a massive / impossible > task. But it also means that both systems aren't fighting/overriding > each other or making it diffic

Re: Let plan_cache_mode to be a little less strict

2025-08-03 Thread Michael Paquier
On Fri, Aug 01, 2025 at 03:07:08PM +0200, Andrei Lepikhov wrote: > I considered the worker_spi.c module, which demonstrates various SPI usage > patterns. It might be more beneficial to use this instead of creating > another test module, isn't it? worker_spi is a playground for bgworker tests, so I

Dead code with short varlenas in toast_save_datum()

2025-08-03 Thread Michael Paquier
Hi all, Nikhil (in CC.), has noticed while looking at the 8B-value TOAST patch that this code block used for short varlenas in toast_save_datum() is dead based on the current coverage: if (VARATT_IS_SHORT(dval)) { data_p = VARDATA_SHORT(dval); data_todo = VARSIZE_SHORT(dval

Re: implement CAST(expr AS type FORMAT 'template')

2025-08-03 Thread David G. Johnston
On Sun, Aug 3, 2025 at 8:10 PM jian he wrote: > hi. > one more question: > > For binary coercible type casts, no formatted related function for it, > should we error out? > For example, should the following error out or return text '1'. > > select cast('1'::text as text format ''::text); > I

Re: implement CAST(expr AS type FORMAT 'template')

2025-08-03 Thread Corey Huinker
On Sun, Aug 3, 2025 at 11:36 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Sun, Aug 3, 2025 at 8:10 PM jian he > wrote: > >> hi. >> one more question: >> >> For binary coercible type casts, no formatted related function for it, >> should we error out? >> For example, should the f

Re: implement CAST(expr AS type FORMAT 'template')

2025-08-03 Thread Corey Huinker
> another question is: > should we first implement CAST(expr AS type FORMAT 'template') for limited > types > (to_date, to_char, to_number, to_timestamptz) > or first try to make it more generic? > > That was my plan, essentially rewriting these into safe versions of the existing to_date/to_timesta

Re: A little cosmetic to convert_VALUES_to_ANY()

2025-08-03 Thread Chao Li
I tested this patch locally and it works for me. However I doubt if it really improve performance. The original code "contain_volatile_functions((Node *) rte->values_lists)" recursively work through rte-values_list, and this patch move contain_volatile_functions() into the for loop, and checks

Re: Potential deadlock in pgaio_io_wait()

2025-08-03 Thread Thomas Munro
On Mon, Aug 4, 2025 at 5:54 PM Thomas Munro wrote: > I doubt it's very easy to reproduce with simple queries, but I assume > if you had a SQL function that acquires a central LWLock and you ran > concurrent queries SELECT COUNT(*) FROM t WHERE locking_function(x) Hmm, that's a bad example as it h

Re: CREATE PUBLICATION with 'publish_generated_columns' parameter specified but unassigned

2025-08-03 Thread David G. Johnston
On Sunday, August 3, 2025, Peter Smith wrote: > > Recently, I learned it is possible to say: > > CREATE PUBLICATION pub ... WITH (publish_generated_columns); > > This is equivalent to: > CREATE PUBLICATION pub ... WITH (publish_generated_columns = stored); > > > What is the verdict for this syntax

Re: Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT

2025-08-03 Thread Thomas Munro
On Sun, Aug 3, 2025 at 6:25 AM Nathan Bossart wrote: > On Sat, Aug 02, 2025 at 11:09:16AM +0200, Peter Eisentraut wrote: > > These were introduced (commit efdc7d74753) at the same time as we were > > moving to using the standard inttypes.h format macros (commit a0ed19e0a9e). > > It doesn't seem us

Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions

2025-08-03 Thread Corey Huinker
> > so we need to handle numeric source types with fractional points with > special care. > currently, this applies only to numeric, float4, and float8. > (hope this is all the corner case we need to catch...) > I'm fairly certain that the committers won't like us special-casing the internal cast

Re: implement CAST(expr AS type FORMAT 'template')

2025-08-03 Thread David G. Johnston
On Sunday, August 3, 2025, Corey Huinker wrote: > On Sun, Aug 3, 2025 at 11:36 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Sun, Aug 3, 2025 at 8:10 PM jian he >> wrote: >> >>> hi. >>> one more question: >>> >>> For binary coercible type casts, no formatted related functio

Re: Making WAL archiving faster — multi-file support and async ideas

2025-08-03 Thread Daniil Davydov
Hi, On Tue, Jul 29, 2025 at 3:56 PM Stepan Neretin wrote: > > We’ve been thinking about how to make WAL archiving faster. > This topic was previously discussed in [1], and we’ve taken a first step by > implementing the attached patch, which adds support for archiving multiple > WAL files in one

Re: Conflict detection for update_deleted in logical replication

2025-08-03 Thread Dilip Kumar
On Fri, Aug 1, 2025 at 9:16 PM Zhijie Hou (Fujitsu) wrote: > > On Friday, August 1, 2025 7:42 PM Dilip Kumar wrote: > > > > On Fri, Aug 1, 2025 at 5:02 PM Zhijie Hou (Fujitsu) > > wrote: > > > > > > > 2. > > > > > > > > + If set to true, the detection of > > > > + is enabled,

Re: A little cosmetic to convert_VALUES_to_ANY()

2025-08-03 Thread Tender Wang
David G. Johnston 于2025年8月4日周一 12:33写道: > On Sun, Jul 27, 2025 at 12:53 AM Tender Wang wrote: > >> >> We can merge the two scans into one. This can reduce the time complexity >> from 2O(n) to O(n). >> > > This seems like an unusual usage of big-O notation. Always saw the > meaningful pieces ins

Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX

2025-08-03 Thread Michael Paquier
On Mon, Aug 04, 2025 at 12:34:14PM +0800, Julien Rouhaud wrote: > FWIW if anyone actually needs it, that feature had existed for decades in > plantuner: http://www.sigaev.ru/git/gitweb.cgi?p=plantuner.git;a=summary Your link does not work here, this one does: https://github.com/postgrespro/plantun

Re: Fix a typo of mod_since_analyze in do_analyze_rel

2025-08-03 Thread David Rowley
On Mon, 4 Aug 2025 at 17:01, Yugo Nagata wrote: > I found comments in do_analyze_rel that refers to "change_since_analyze". > I believe that is a typo and shoud be "mod_since_analyze". > I've attached a patch to fix it. Yeah, that looks unintentional. I've pushed your fix. Thanks David

Doc: Add note for running ANALYZE after ALTER TABLE ... SET EXPRESSION

2025-08-03 Thread Yugo Nagata
Hi, The documentation recommends running ANALYZE after the "ALTER TABLE ... SET DATA TYPE" command since the statistics will become wrong after that. That same thing can be applied to "ALTER TABLE ... SET EXPRESSION" commands, but that is not described in the documentation, so I've attached a pa

Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring

2025-08-03 Thread Naga Appani
Hi Ashutosh, Michael, Thanks for the detailed reviews. I have incorporated the feedback; please find attached v2 and my responses inline below. On Fri, Jul 25, 2025 at 5:57 AM Ashutosh Bapat wrote: > In [1], we decided to document pg_get_multixact_member() in section > "Transaction ID and Snaps

Re: Conflict detection for update_deleted in logical replication

2025-08-03 Thread shveta malik
On Fri, Aug 1, 2025 at 9:16 PM Zhijie Hou (Fujitsu) wrote: > > > Thanks for confirming. Here is V56 patch set which addressed all the > comments including the comments from Amit[1] and Shveta[2]. > > I have merged V55-0002 into 0001 and updated the list of author > and reviewers based on my knowle

CREATE PUBLICATION with 'publish_generated_columns' parameter specified but unassigned

2025-08-03 Thread Peter Smith
Hi, Recently, I learned it is possible to say: CREATE PUBLICATION pub ... WITH (publish_generated_columns); This is equivalent to: CREATE PUBLICATION pub ... WITH (publish_generated_columns = stored); ~~~ Example: postgres=# create publication pub for table t with (publish_generated_columns=x

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-03 Thread shveta malik
On Mon, Aug 4, 2025 at 11:31 AM Amit Kapila wrote: > > On Fri, Aug 1, 2025 at 2:50 PM shveta malik wrote: > > > > 5) > > I tried a test where there were 4 slots on the publisher, where one > > was getting used while the others were not. Initiated > > pg_sync_replication_slots on standby. Forced u

Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX

2025-08-03 Thread Julien Rouhaud
On Mon, 4 Aug 2025, 12:39 Michael Paquier, wrote: > On Mon, Aug 04, 2025 at 12:34:14PM +0800, Julien Rouhaud wrote: > > FWIW if anyone actually needs it, that feature had existed for decades in > > plantuner: http://www.sigaev.ru/git/gitweb.cgi?p=plantuner.git;a=summary that's weird, I tried fr

Re: A little cosmetic to convert_VALUES_to_ANY()

2025-08-03 Thread David G. Johnston
On Sun, Jul 27, 2025 at 12:53 AM Tender Wang wrote: > > We can merge the two scans into one. This can reduce the time complexity > from 2O(n) to O(n). > This seems like an unusual usage of big-O notation. Always saw the meaningful pieces inside the O, and in general I thought O(n) =~ O(xn) for

Re: A little cosmetic to convert_VALUES_to_ANY()

2025-08-03 Thread David G. Johnston
On Sun, Aug 3, 2025 at 9:40 PM Tender Wang wrote: > >>> Also, add a brace for better/more consistent style in the attached patch. >>> >> >> Should try and avoid oh-by-the-way fixes like this in behavior patches. >> >> This specific one also doesn't seem warranted. Or, at least, the original >> st

Fix a typo of mod_since_analyze in do_analyze_rel

2025-08-03 Thread Yugo Nagata
Hi, I found comments in do_analyze_rel that refers to "change_since_analyze". I believe that is a typo and shoud be "mod_since_analyze". I've attached a patch to fix it. Regards, Yugo Nagata -- Yugo Nagata diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 7111