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

2025-09-05 Thread Masahiko Sawada
On Thu, Sep 4, 2025 at 11:15 AM Masahiko Sawada wrote: > > od On Tue, Sep 2, 2025 at 8:11 PM Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Sawada-san, > > > > Here are my comments. > > > > 01. > > ``` > > checkPoint.logicalDecodingEnabled = IsLogicalDecodingEnabled(); > > ``` > > > > Per

Re: 回复: Fix segfault while accessing half-initialized hash table in pgstat_shmem.c

2025-09-05 Thread Mikhail Kot
Hi, Do you want me to update the patch based on your suggestion on fault injection, or update the try/catch to the callers as discussed, or it's good to be included in Postgres?

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

2025-09-05 Thread Masahiko Sawada
On Tue, Sep 2, 2025 at 5:12 AM Shlok Kyal wrote: > > > I tested the behaviour with HEAD and with Patch. And I confirmed the > change in behaviour between HEAD and Patch > > Suppose we have a primary and a standby with wal_level = logical and > guc parameters to enable slot sync worker are set acco

Re: Raw parse tree is not dumped to log

2025-09-05 Thread Tatsuo Ishii
>> v7 patch looks good to me. BTW, how do you want to be credited in the >> commit message? >> >> Author: Chao Li mailto:l...@highgo.com>> >> Author: Chao Li mailto:li.evan.c...@gmail.com>> >> >> It seems your email is the latter, however you wrote the former in >> your patch. >> > > Please use

Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

2025-09-05 Thread Melanie Plageman
On Wed, Sep 3, 2025 at 5:06 AM Kirill Reshke wrote: > > small comments regarding new series > > 0001, 0002, 0017 LGTM Thanks for continuing to review! > In 0015: > > Also, maybe GlobalVisXidTestAllVisible is a slightly better name? (The > term 'all-visible' is one that we occasionally utilize)

Re: Differential Code Coverage report for Postgres

2025-09-05 Thread Nazir Bilal Yavuz
Hi, On Fri, 5 Sept 2025 at 22:14, Álvaro Herrera wrote: > > Thanks for working on this! > > On 2025-Sep-05, Nazir Bilal Yavuz wrote: > > > 1- One Github Actions run takes ~50 minutes for now and since this > > runs daily it is ~1500 minutes in total for a month. If you include > > manual triggers

Re: Appetite for syntactic sugar to match result set columns to UDT fields?

2025-09-05 Thread Tom Lane
Philip Warner writes: > The Problem > Currently, if one has: > Create Type FOO( >VALUE1 Int, >VALUE2 Int); > And one has a query: > Select F1, F2 from A_TABLE; > One can return the rows, or one can create a row object and cast it to > FOO type. I'm kind of wondering where is the

Re: Fix inconsistencies with code and beautify xlog structures description and fin hash_xlog.h

2025-09-05 Thread Chao Li
> On Sep 5, 2025, at 16:29, Chao Li wrote: > > > >> On Sep 5, 2025, at 14:24, Kirill Reshke wrote: >> -- >> Best regards, >> Kirill Reshke >> > > > LGTM. SlruRecentlyUsed() is now an inline function. > After pulling master, I just found this patch has been pushed. -- Chao Li (Evan) H

Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters

2025-09-05 Thread Tom Lane
Jim Jones writes: > On 04.09.25 23:52, Tom Lane wrote: >> I'm not entirely sure if this is the way to go, or if we want to >> adopt some other solution that doesn't involve forbidding empty >> list elements. I suspect that anything else we come up with would >> be less intuitive than letting SET

Re: Should io_method=worker remain the default?

2025-09-05 Thread Jeff Davis
On Fri, 2025-09-05 at 13:25 -0700, Jeff Davis wrote: > As an aside, I'm building with meson using -Dc_args="-msse4.2 -Wtype- > limits -Werror=missing-braces". But I notice that the meson build > doesn't seem to use -funroll-loops or -ftree-vectorize when building > checksums.c. Is that intentional?

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

2025-09-05 Thread Masahiko Sawada
On Fri, Sep 5, 2025 at 3:15 PM Masahiko Sawada wrote: > > On Thu, Sep 4, 2025 at 11:15 AM Masahiko Sawada wrote: > > > > od On Tue, Sep 2, 2025 at 8:11 PM Hayato Kuroda (Fujitsu) > > wrote: > > > > > > Dear Sawada-san, > > > > > > Here are my comments. > > > > > > 01. > > > ``` > > > che

Re: RFC: extensible planner state

2025-09-05 Thread Robert Haas
On Mon, Aug 25, 2025 at 3:46 PM Robert Haas wrote: > 0005 is a demo, not for commit, just to show how these pieces fit > together. It uses the hooks from 0001 to count the number of times > set_join_pathlist_hook is called and the number of those that are for > distinct joinrels. Then it uses plan

Re: Should io_method=worker remain the default?

2025-09-05 Thread Jeff Davis
On Wed, 2025-09-03 at 11:55 -0400, Andres Freund wrote: > I think the regression is not due to anything inherent to worker, but > due to > pressure on AioWorkerSubmissionQueueLock - at least that's what I'm > seeing on > a older two socket machine. It's possible the bottleneck is different > on a >

Re: Proposal: Out-of-Order NOTIFY via GUC to Improve LISTEN/NOTIFY Throughput

2025-09-05 Thread Arseniy Mukhin
Hi, On Fri, Sep 5, 2025 at 1:53 AM Rishu Bagga wrote: > > Attached is an initial patch that implements this idea. Thank you for sharing the patch and for working on this! I briefly read the patch and there are some points: 1) There are some compilation warnings about unused functions. 2) I th

Re: Allow logical replication in the same cluster

2025-09-05 Thread Amit Kapila
On Fri, Sep 5, 2025 at 8:21 AM Chao Li wrote: > > I was doing some test about logical replication a few days ago. When I tried > to setup a logical replication on my Macbook. > > The basic workflow is simple: > > ``` > Step 1: edit postgresql.conf and set: > > wal_level = logical > max_replicatio

Re: Parallel Apply

2025-09-05 Thread Dilip Kumar
On Wed, Aug 13, 2025 at 4:17 PM Zhijie Hou (Fujitsu) wrote: > > Here is the initial POC patch for this idea. > > The basic implementation is outlined below. Please note that there are several > TODO items remaining, which we are actively working on; these are also > detailed > further down. Tha

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-09-05 Thread Robert Haas
On Fri, Jul 11, 2025 at 3:48 PM Greg Burd wrote: > I briefly considered how one might use what was left after surgery to produce > some similar boolean signal to no avail. I think that autoprewarm was simply > trying to at most warm NBuffers then stop. The freelist at startup was just > a con

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

2025-09-05 Thread Ashutosh Sharma
On Fri, Sep 5, 2025 at 6:52 PM Ashutosh Bapat wrote: > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > On Fri, Aug 29, 2025 at 6:50 PM Ashutosh Bapat > > wrote: > > > > > > On Fri, Aug 29, 2025 at 11:42 AM Ajin Cherian wrote: > > > > > +/* > > > + * Flag used by pg_sync_replic

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-09-05 Thread Andres Freund
Hi, On 2025-09-04 13:24:00 -0400, Greg Burd wrote: > On Thu, Sep 4, 2025, at 12:59 PM, Andres Freund wrote: > > Hi, > > > > On 2025-08-27 15:42:48 -0400, Greg Burd wrote: > >> Regardless, I feel the first two patches on this set address the > >> intention of this thread. > > > > I'm planning to co

Re: [PG19-3 PATCH] Don't ignore passfile

2025-09-05 Thread Robert Haas
On Thu, Sep 4, 2025 at 7:22 PM Paul Ohlhauser wrote: > > Another idea could be to fail the connection instead of treating this as a > > warning condition. > As noted in the proposal, if the check stays I'd argue that it should be an > error. > I can't imaging a case where the user is happy with

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-09-05 Thread Greg Burd
On Fri, Sep 5, 2025, at 12:27 PM, Andres Freund wrote: > Hi, > > On 2025-09-04 13:24:00 -0400, Greg Burd wrote: >> On Thu, Sep 4, 2025, at 12:59 PM, Andres Freund wrote: >> > Hi, >> > >> > On 2025-08-27 15:42:48 -0400, Greg Burd wrote: >> >> Regardless, I feel the first two patches on this set ad

Re: Differential Code Coverage report for Postgres

2025-09-05 Thread Jacob Champion
On Fri, Sep 5, 2025 at 12:09 AM Nazir Bilal Yavuz wrote: > I have been working on generating differential code coverage for > Postgres and was able to do so with this script [1]. The script checks > out HEAD and the latest release branch (currently REL_18_STABLE), then > generates a differential c

Re: Differential Code Coverage report for Postgres

2025-09-05 Thread Andres Freund
Hi, On 2025-09-05 10:09:27 +0300, Nazir Bilal Yavuz wrote: > I have been working on generating differential code coverage for > Postgres and was able to do so with this script [1]. The script checks > out HEAD and the latest release branch (currently REL_18_STABLE), then > generates a differential

Re: Eager aggregation, take 3

2025-09-05 Thread Robert Haas
On Fri, Sep 5, 2025 at 3:35 AM Richard Guo wrote: > Here is a rebase after the GUC tables change. I spent a bit of time scrolling through this today. Here are a few observations/review comments. It looks as though this will create a bunch of RelOptInfo objects that don't end up getting used for

RE: Avoid retaining conflict-related data when no tables are subscribed

2025-09-05 Thread Zhijie Hou (Fujitsu)
On Thursday, September 4, 2025 7:38 PM Amit Kapila wrote: > > On Tue, Sep 2, 2025 at 10:51 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Friday, August 29, 2025 12:05 PM Amit Kapila > wrote: > > > > > > bool > > > -AllTablesyncsReady(void) > > > +AllTablesyncsReady(bool ready_if_no_tables) > >

Re: Should io_method=worker remain the default?

2025-09-05 Thread Thomas Munro
On Thu, Sep 4, 2025 at 6:50 AM Jeff Davis wrote: > I like the idea of some kind of fallback for multiple reasons. I > noticed that if I set io_workers=1, and then I SIGSTOP that worker, > then sequential scans make no progress at all until I send SIGCONT. A > fallback to synchronous sounds more ro

Re: Differential Code Coverage report for Postgres

2025-09-05 Thread Nazir Bilal Yavuz
Hi, On Fri, 5 Sept 2025 at 18:14, Andres Freund wrote: > > On 2025-09-05 10:09:27 +0300, Nazir Bilal Yavuz wrote: > > I have been working on generating differential code coverage for > > Postgres and was able to do so with this script [1]. The script checks > > out HEAD and the latest release bra

Re: Differential Code Coverage report for Postgres

2025-09-05 Thread Nazir Bilal Yavuz
Hi, On Fri, 5 Sept 2025 at 18:14, Jacob Champion wrote: > > On Fri, Sep 5, 2025 at 12:09 AM Nazir Bilal Yavuz wrote: > > I have been working on generating differential code coverage for > > Postgres and was able to do so with this script [1]. The script checks > > out HEAD and the latest release

Re: Differential Code Coverage report for Postgres

2025-09-05 Thread Álvaro Herrera
Thanks for working on this! On 2025-Sep-05, Nazir Bilal Yavuz wrote: > 1- One Github Actions run takes ~50 minutes for now and since this > runs daily it is ~1500 minutes in total for a month. If you include > manual triggers and failures, it is more than 1500 minutes. Github > allows 2000 minute

Re: Logical Replication of sequences

2025-09-05 Thread vignesh C
On Fri, 5 Sept 2025 at 04:01, Masahiko Sawada wrote: > > On Wed, Aug 20, 2025 at 4:57 AM Amit Kapila wrote: > > > > On Mon, Aug 18, 2025 at 3:36 PM vignesh C wrote: > > > > > > Thanks for the comments, the updated version has the changes for the same. > > > > > > > I wanted to first discuss a fe

Only one version can be installed when using extension_control_path

2025-09-05 Thread Pierrick
If the same extension is in two different paths mentioned in extension_control_path, it is impossible to install the version of the last one. postgres=# show extension_control_path ;    extension_control_path ---

Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible

2025-09-05 Thread Nathan Bossart
On Fri, Sep 05, 2025 at 03:35:21PM +0900, Michael Paquier wrote: > +$old->safe_psql('postgres', q| > +CREATE EXTENSION dummy_seclabel; > > Still I think that this bit is going to fail with installcheck, > because src/test/modules/ is not installed by default :) > > You can mak

Re: Appetite for syntactic sugar to match result set columns to UDT fields?

2025-09-05 Thread Tom Lane
Philip Warner writes: > I'd like a formulation like: > Select Row(T1.T1F7 as F1, T2.T2F3 as F2, Tp.Fq as Fn)::FOO By Name > Or > Select FOO(F1:=T1.T1F7, F2:=T2.T2F3, Fn:=Tp.Fq) > Basically: it's some form of UDT constructor with named parameters, > whether by cast, pseudo functi

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

2025-09-05 Thread Ashutosh Bapat
On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > On Fri, Aug 29, 2025 at 6:50 PM Ashutosh Bapat > wrote: > > > > On Fri, Aug 29, 2025 at 11:42 AM Ajin Cherian wrote: > > > +/* > > + * Flag used by pg_sync_replication_slots() > > + * to do retries if the slot did not persist while syncin

Re: [PATCH] Add tests for Bitmapset

2025-09-05 Thread Burd, Greg
> On Sep 4, 2025, at 10:00 PM, Nathan Bossart wrote: > > On Fri, Aug 15, 2025 at 11:39:23AM -0400, Greg Burd wrote: >> I noticed that there are no tests for Bitmapset in src/test/modules as >> is the case for other similar things like radixtree, rbtree, etc. so I >> created one. I realize that

Re: plan shape work

2025-09-05 Thread Tom Lane
Robert Haas writes: > I was not aware of outer_join_rels, so thank you for pointing it out. > However, consider this query: > select 1 from pg_class a inner join pg_class b on a.relfilenode = > b.relfilenode; > Here, we end up with a three-item range table: one for a, one for b, > and one for t

Re: NOT NULL NOT ENFORCED

2025-09-05 Thread Álvaro Herrera
On 2025-Sep-04, Álvaro Herrera wrote: > On 2025-Sep-04, jian he wrote: > > + else if (notenforced) > > + { > > + /* > > +* We can't use ATExecSetNotNull here because it adds > > an enforced > > +* not-null constraint,

RE: Resetting recovery target parameters in pg_createsubscriber

2025-09-05 Thread Hayato Kuroda (Fujitsu)
Dear Alyona, Thanks for updating the patch! Sadly, your patch cannot be applied cleanly. Even after the manual merge, it could not be built. Maybe `dbinfo` should be `dbinfos.dbinfo`. Obtained message is written in [1]. (cfbot seemed not to run correctly) Regarding patch content, your patch res

Differential Code Coverage report for Postgres

2025-09-05 Thread Nazir Bilal Yavuz
Hi, I have been working on generating differential code coverage for Postgres and was able to do so with this script [1]. The script checks out HEAD and the latest release branch (currently REL_18_STABLE), then generates a differential coverage report. I also set up a GitHub Action so the report

回复: Differential Code Coverage report for Postgres

2025-09-05 Thread Oreo Yang
It looks very cool. So our goal over 90%? Thanks, OreoYang 发件人: Nazir Bilal Yavuz 已发送: 2025 年 9 月 5 日 星期五 15:09 收件人: PostgreSQL Hackers 抄送: Andres Freund ; Álvaro Herrera 主题: Differential Code Coverage report for Postgres Hi, I have been working on generating

Re: --with-llvm on 32-bit platforms?

2025-09-05 Thread Dmitry Mityugov
Dmitry Mityugov писал(а) 2025-09-05 00:32: It seems that when I add --with-llvm flag to ./configure on any 32-bit platform that I have (Debian 12, Debian 13, Arch Linux), many tests invoked by `make check` fail, or, sometimes, hang forever. Is this a known problem? It's not critical to me, just

Re: Logical Replication of sequences

2025-09-05 Thread Chao Li
> On Sep 5, 2025, at 13:49, vignesh C wrote: > > On Fri, 5 Sept 2025 at 03:04, Masahiko Sawada wrote: >> >> Please rebase the patches as they conflict with current HEAD (due to >> commit 6359989654). > > Attached a rebased version of the patches. > > Regards, > Vignesh > A few small comm

Re: Fix inconsistencies with code and beautify xlog structures description and fin hash_xlog.h

2025-09-05 Thread Chao Li
> On Sep 5, 2025, at 14:24, Kirill Reshke wrote: > -- > Best regards, > Kirill Reshke > LGTM. SlruRecentlyUsed() is now an inline function. -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/

Re: Proposal: Out-of-Order NOTIFY via GUC to Improve LISTEN/NOTIFY Throughput

2025-09-05 Thread Joel Jacobson
On Fri, Sep 5, 2025, at 00:53, Rishu Bagga wrote: > With the following sql script, I ran > pgbench -T 100 -c 100 -j 8 -f pgbench_transaction_notify.sql -d postgres > > BEGIN; > INSERT INTO test VALUES(1); > NOTIFY benchmark_channel, 'transaction_completed'; > COMMIT; Thanks for working on this. I

RE: Conflict detection for update_deleted in logical replication

2025-09-05 Thread Zhijie Hou (Fujitsu)
On Friday, September 5, 2025 2:01 PM shveta malik wrote: > > On Thu, Sep 4, 2025 at 3:30 PM Zhijie Hou (Fujitsu) > wrote: > > > > Hi, > > > > As reported by Robert[1], it is worth adding a test for the race condition > > in > > the RecordTransactionCommitPrepared() function to reduce the risk

Re: --with-llvm on 32-bit platforms?

2025-09-05 Thread Dmitry Mityugov
Dmitry Mityugov писал(а) 2025-09-05 11:11: Dmitry Mityugov писал(а) 2025-09-05 00:32: It seems that when I add --with-llvm flag to ./configure on any 32-bit platform that I have (Debian 12, Debian 13, Arch Linux), many tests invoked by `make check` fail, or, sometimes, hang forever. Is this a

Re: Remove traces of long in dynahash.c

2025-09-05 Thread Dean Rasheed
On Mon, 1 Sept 2025 at 04:26, Michael Paquier wrote: > > So, taking a step back, I don't know what would be a good fit for > these duplicates of the "next power" routines upper-bounded on input > when attached to pg_bitutils.h. However, I do see that we can get rid > of pg_log2() and dynahash.h w

Re: Logical Replication of sequences

2025-09-05 Thread Amit Kapila
On Fri, Sep 5, 2025 at 2:46 PM vignesh C wrote: > > On Fri, 5 Sept 2025 at 04:01, Masahiko Sawada wrote: > > > > On Wed, Aug 20, 2025 at 4:57 AM Amit Kapila wrote: > > > > > > On Mon, Aug 18, 2025 at 3:36 PM vignesh C wrote: > > > > > > > > Thanks for the comments, the updated version has the c

Re: Allow using replication origins in SQL level parallel sessions

2025-09-05 Thread Amit Kapila
On Thu, Sep 4, 2025 at 11:32 PM Emre Hasegeli wrote: > > Replication origins is a useful feature for external replication > systems to do conflict resolution in bi-directional replication. It's > possible for the external systems to make use of this feature using > the SQL functions pg_replicatio

Re: Raw parse tree is not dumped to log

2025-09-05 Thread Chao Li
> On Sep 5, 2025, at 18:06, Tatsuo Ishii wrote: > > Hi, > > v7 patch looks good to me. BTW, how do you want to be credited in the > commit message? > > Author: Chao Li mailto:l...@highgo.com>> > Author: Chao Li mailto:li.evan.c...@gmail.com>> > > It seems your email is the latter, however yo

Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt

2025-09-05 Thread Peter Eisentraut
On 29.08.25 14:48, Álvaro Herrera wrote: On 2025-Aug-29, jian he wrote: On Fri, Aug 29, 2025 at 5:46 AM Tom Lane wrote: WFM, although I think you could shorten it to "tables, materialized views, and foreign tables". We generally expect that partitioned tables are included when saying "tabl

Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue

2025-09-05 Thread Matheus Alcantara
On Thu Sep 4, 2025 at 8:02 PM -03, Rishu Bagga wrote: > On Thu, Sep 4, 2025 at 7:14 AM Arseniy Mukhin > wrote: > >> Interesting, have you shared your patch and results somewhere? IIUC >> Tom's approach resolves this bug, because with it we have queue >> entries produced by committed transactions o

RE: issue with synchronized_standby_slots

2025-09-05 Thread Zhijie Hou (Fujitsu)
On Thursday, September 4, 2025 9:27 PM Fabrice Chapuis wrote: > With PG 17.5 and using logical replication failover slots. When trying to > change the value of synchronized_standby_slots, node2 was not running then the > error invalid value for parameter "synchronized_standby_slots": "node1,nod

Re: Inconsistent update in the MERGE command

2025-09-05 Thread Dean Rasheed
On Thu, 4 Sept 2025 at 16:03, Yugo Nagata wrote: > > > I've updated that to use tupleid in the attached v3 patch, and added a > > couple more isolation tests. In practice, however, I don't think that > > error can ever happen because this check follows table_tuple_lock() > > which has a similar te

Re: When deleting the plpgsql function, release the CachedPlan of the function

2025-09-05 Thread zengman
Attempt to clear the compilation warning, overwrite the plpgsql.out file, and update the patch. 002_cleanup_spl_funccache_v2.patch Description: Binary data

Re: Parallel Apply

2025-09-05 Thread Dilip Kumar
On Mon, Aug 11, 2025 at 10:16 AM Amit Kapila wrote: > > Hi, > > Background and Motivation > - > In high-throughput systems, where hundreds of sessions generate data > on the publisher, the subscriber's apply process often becomes a > bottleneck due to the single

Re: Raw parse tree is not dumped to log

2025-09-05 Thread Chao Li
Hi Tatsuo san, I just rebased the commit for the GUC change. On Sep 3, 2025, at 09:57, Tatsuo Ishii wrote: That's 0.3% difference, definitely noise-level. Ok, I withdraw my claim and commit the patch without unlikely(). I also removed unlikely() in v7. Best regards, -- Chao Li (Evan) HighGo S

Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters

2025-09-05 Thread Andrei Klychkov
As it solves the initial issue, it SGTM too. I applied v3, updated the docs and added some tests in attached v4. Hopefully it's OK. Please take a look Thanks Regards On Fri, Sep 5, 2025 at 9:33 AM Jim Jones wrote: > > > On 04.09.25 23:52, Tom Lane wrote: > > Note that the patch includes changin

Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue

2025-09-05 Thread Arseniy Mukhin
On Fri, Sep 5, 2025 at 1:44 PM Matheus Alcantara wrote: > > On Wed Sep 3, 2025 at 8:51 PM -03, Rishu Bagga wrote: > > On Wed, Sep 3, 2025 at 2:14 PM Matheus Alcantara > > > > wrote: > > > > > >> IIUC we don't store notifications of aborted transactions on the > > > >> queue. On PreCommit_Notify w

Re: Eager aggregation, take 3

2025-09-05 Thread Robert Haas
On Wed, Aug 6, 2025 at 3:52 AM Richard Guo wrote: > To avoid potential memory blowout risks from large partial aggregation > values, v18 avoids applying eager aggregation if any aggregate uses an > INTERNAL transition type, as this typically indicates a large internal > data structure (as in strin

Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters

2025-09-05 Thread Jim Jones
On 04.09.25 23:52, Tom Lane wrote: > Note that the patch includes changing SplitIdentifierString and its > clones to forbid zero-length quoted elements, which were formerly > allowed. Without this, we'd accept values from config files that > could not be represented in SET, which is exactly the

Re: Appetite for syntactic sugar to match result set columns to UDT fields?

2025-09-05 Thread Philip Warner
@Tom Lane Yes, a good question. I abstracted my example to the point of meaninglessness. A more concreate example: Create Type FOO( F1 Int, F2 Int, ... Fn Int) Create Function GET_SOMETHING(...) Returns SetOf FOO Language PLPGSQL ... Begin ... Return Query Sel

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

2025-09-05 Thread Ashutosh Sharma
Hi Shlok, Good to hear that you’re also interested in working on this task. On Thu, Sep 4, 2025 at 8:26 PM Shlok Kyal wrote: > Hi Ashutosh, > > I am also interested in this thread. And was working on a patch for it. > > On Wed, 3 Sept 2025 at 17:52, Ashutosh Sharma > wrote: > > > > Hi Amit, >

Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue

2025-09-05 Thread Matheus Alcantara
On Wed Sep 3, 2025 at 8:51 PM -03, Rishu Bagga wrote: > On Wed, Sep 3, 2025 at 2:14 PM Matheus Alcantara > > wrote: > > >> IIUC we don't store notifications of aborted transactions on the > >> queue. On PreCommit_Notify we add the notifications on the queue > >> and on Commit_Notify() we signal th

Re: [PATCH] Update parser README to include parse_jsontable.c

2025-09-05 Thread Michael Paquier
On Fri, Sep 05, 2025 at 06:49:42PM +0530, Karthik wrote: > This patch fixes a missing entry in the parser README. The file > parse_jsontable.c exists but wasn't documented in the README. > > The patch adds the missing line with an appropriate description. > > Please find the patch attached. That

Re: Parallel Apply

2025-09-05 Thread Amit Kapila
On Fri, Sep 5, 2025 at 5:15 PM Mihail Nikalayeu wrote: > > Hello, Amit! > > Amit Kapila : > > So, in such cases as we won't be able to detect > > transaction dependencies, it would be better to allow out-of-order > > commits optionally. > > I think it is better to enable preserve order by default

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

2025-09-05 Thread Amit Kapila
On Fri, Sep 5, 2025 at 11:39 PM Ashutosh Sharma wrote: > > On Wed, Sep 3, 2025 at 3:20 PM Ajin Cherian wrote: > > > > On Wed, Sep 3, 2025 at 6:47 PM shveta malik wrote: > > > > > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > > > Attaching v10 with the above changes. > > > >

Re: [Patch] add new parameter to pg_replication_origin_session_setup

2025-09-05 Thread Amit Kapila
On Wed, Sep 3, 2025 at 6:13 PM Doruk Yilmaz wrote: > > Dear Hayato, > > > So, your python process establishes two connections, for publisher > > (replication connection) > > and subscriber (normal connection). It receives changes from the publisher, > > constructs SQL statements from the received

Re: PgStat_HashKey padding issue when passed by reference

2025-09-05 Thread Michael Paquier
On Thu, Sep 04, 2025 at 11:50:15AM -0500, Sami Imseih wrote: > Perhaps calling this a compiler bug is not appropriate. > However, memset is in fact called when the key is created > > ``` > /* clear padding */ > memset(&key, 0, sizeof(struct PgStat_HashKey)); > ``` > > but the zeroed out paddi

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

2025-09-05 Thread Amit Kapila
On Thu, Sep 4, 2025 at 1:24 AM Masahiko Sawada wrote: > > On Tue, Sep 2, 2025 at 4:35 AM Amit Kapila wrote: > > > > On Fri, Aug 29, 2025 at 9:38 AM Masahiko Sawada > > wrote: > > > > > > I've attached the updated patch. > > > > > > > Few comments: > > Thank you for the comments! > > > =

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

2025-09-05 Thread Amit Kapila
On Sat, Sep 6, 2025 at 3:58 AM Masahiko Sawada wrote: > > On Tue, Sep 2, 2025 at 5:12 AM Shlok Kyal wrote: > > > > > > I tested the behaviour with HEAD and with Patch. And I confirmed the > > change in behaviour between HEAD and Patch > > > > Suppose we have a primary and a standby with wal_level

Re: Parallel Apply

2025-09-05 Thread Amit Kapila
On Fri, Sep 5, 2025 at 2:59 PM Dilip Kumar wrote: > > On Mon, Aug 11, 2025 at 10:16 AM Amit Kapila wrote: > > > > +1 for the idea. So I see we already have the parallel apply workers > for the large streaming transaction so I am trying to think what > additional problem we need to solve here. I

Re: Extension security improvement: Add support for extensions with an owned schema

2025-09-05 Thread Julien Rouhaud
Hi, On Tue, Sep 02, 2025 at 09:35:45AM -0400, Robert Haas wrote: > On Tue, Sep 2, 2025 at 5:02 AM Julien Rouhaud wrote: > > Requiring superuser permission seems like a big penalty, especially since > > the > > last few years have been all about *not* requiring superuser privileges. > > Note >

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

2025-09-05 Thread Ashutosh Sharma
Hi, On Wed, Sep 3, 2025 at 3:20 PM Ajin Cherian wrote: > > On Wed, Sep 3, 2025 at 6:47 PM shveta malik wrote: > > > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > Attaching v10 with the above changes. > > > > > > > The patch does not apply on HEAD. Can you please rebase? > >

Re: 回复: Fix segfault while accessing half-initialized hash table in pgstat_shmem.c

2025-09-05 Thread Michael Paquier
On Fri, Sep 05, 2025 at 09:46:55PM +0100, Mikhail Kot wrote: > Do you want me to update the patch based on your suggestion on fault > injection, or update the try/catch to the callers as discussed, or > it's good to be included in Postgres? I would prefer the approach of letting the callers deal w

Re: 回复: Fix segfault while accessing half-initialized hash table in pgstat_shmem.c

2025-09-05 Thread Michael Paquier
On Thu, Sep 04, 2025 at 03:49:19PM +0800, Rider wrote: > And, the PG_RE_THROW() within the PG_CATCH block causes a non-local jump, > immediately aborting the current execution path to handle the error at a > higher level. This guarantees that the code following PG_END_TRY is > unreachable in the er

Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible

2025-09-05 Thread Michael Paquier
On Fri, Sep 05, 2025 at 01:12:49PM -0500, Nathan Bossart wrote: > How does this look? +# We can only test security labels if both the old and new installations +# have dummy_seclabel. +my $test_seclabel = 1; +$old->start; +if (!$old->check_extension('dummy_seclabel')) +{ +

Re: Appetite for syntactic sugar to match result set columns to UDT fields?

2025-09-05 Thread Philip Warner
While you are correct that the structure will create a UDT (which is how I framed a possible solution to the larger problem in my second message), the example: Begin ... Return Query Select T1.T1F7 as F1, T2.T2F3 as F2, Tp.Fq as Fn From T1 Join T2 On...Join...Tp Wh