Re: Optimize LISTEN/NOTIFY

2025-10-27 Thread Chao Li
> On Oct 28, 2025, at 14:41, Joel Jacobson wrote: > > On Tue, Oct 28, 2025, at 02:02, Chao Li wrote: From this perspective, we need to add a new field adviancingTillPos to QueueBackendStatus. (This field was also missing from my proposed patch). >>> >>> I'm doubtful yet anoth

Re: Optimize LISTEN/NOTIFY

2025-10-27 Thread Joel Jacobson
On Tue, Oct 28, 2025, at 02:02, Chao Li wrote: >>> From this perspective, we need to add a new field >>> adviancingTillPos to QueueBackendStatus. (This field was also missing >>> from my proposed patch). >> >> I'm doubtful yet another field is worth the added complexity cost. >> >> Before incre

Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

2025-10-27 Thread jian he
On Sun, Oct 26, 2025 at 2:48 AM Jim Jones wrote: > > On 23/10/2025 00:27, Philip Alger wrote: > > It might be advantageous to show a `trigger name cannot be schema > > qualified` error to the user. Therefore, I added the check and the tests > > on v8 attached. > > > > postgres=# SELECT pg_get_trig

Re: Logical Replication of sequences

2025-10-27 Thread Amit Kapila
On Mon, Oct 27, 2025 at 5:10 PM Amit Kapila wrote: > > On Mon, Oct 27, 2025 at 12:19 PM vignesh C wrote: > > > > On Mon, 27 Oct 2025 at 10:04, Dilip Kumar wrote: > > > > > > > > > One question, I am not sure if this has been discussed before, So while > > > getting sequence information from rem

Re: Non-text mode for pg_dumpall

2025-10-27 Thread Mahendra Singh Thalor
On Thu, 16 Oct 2025 at 16:24, Mahendra Singh Thalor wrote: > > On Wed, 15 Oct 2025 at 23:05, Mahendra Singh Thalor > wrote: > > > > On Sun, 24 Aug 2025 at 22:12, Andrew Dunstan wrote: > > > > > > > > > On 2025-08-23 Sa 9:08 PM, Noah Misch wrote: > > > > > > On Wed, Jul 30, 2025 at 02:51:59PM -0

Re: Channel binding for post-quantum cryptography

2025-10-27 Thread Michael Paquier
On Sun, Oct 26, 2025 at 11:20:53AM +0100, Filip Janus wrote: > I have prepared a test case following the pattern from commit 9244c11afe23 > (RSA-PSS fix). Thanks, I'm able to reproduce your problem with the error you have, after generating the certs. + my $mldsa_cert = "ssl/server-mldsa65.crt";

Re: Enhancing Memory Context Statistics Reporting

2025-10-27 Thread Rahila Syed
Hi, PFA an updated v39 patch which is ready for review in the upcoming commitfest. > v35 works fine on my environment. > I ran the same test and haven’t encountered the crash anymore. > Thank you for testing and confirming the fix. > The addition of the following code appears to have resolved

Re: COPY WHERE clause generated/system column reference

2025-10-27 Thread jian he
On Tue, Oct 28, 2025 at 2:02 AM Kirill Reshke wrote: > > Small comment: in 0002: > > > + if (has_stored_generated) > > + ExecComputeStoredGenerated(resultRelInfo, estate, myslot, > > + CMD_INSERT); > > Should we use CMD_UTILITY here? Comment in nodes.h suggests so. Also, > ExecComputeStoredGener

Re: GNU/Hurd portability patches

2025-10-27 Thread Alexander Lakhin
Hello Michael, 25.09.2025 08:00, Alexander Lakhin wrote: I saw those issues frequently on the initial 32bit Hurd VM I started to run the buildfarm code on, before I switched it to HPET timers. Since then, I don't think I saw that particular error again, but 4 out 1000 is not a lot of course.

Re: Logical Replication of sequences

2025-10-27 Thread Peter Smith
Hi Vignesh, WIP - Some comments for patch v20251027-0003 == General. 1. When referring to synchronization workers AFAIK the convention has always been: - code/comments refer to "tablesync workers" and "sequencesync workers" - but errors/docs mostly use the long form like "table synchronizat

Trying out native UTF-8 locales on Windows

2025-10-27 Thread Thomas Munro
Here's a very short patch to experiment with the idea of using Windows' native UTF-8 support when possible, ie when using "en-US.UTF-8" in a UTF-8 database. Otherwise it continues to use the special Windows-only wchar_t conversion that allows for locales with non-matching locales, ie the reason yo

Re: List TAP test files in makefiles

2025-10-27 Thread Michael Paquier
On Fri, Oct 24, 2025 at 10:49:53AM -0500, Nathan Bossart wrote: > On Sat, Aug 23, 2025 at 10:17:59AM -0400, Tom Lane wrote: >> This proposed fix adds more manual maintenance effort, and I really >> doubt that it will do much to solve the ostensible problem that >> people forget to update the meson.

Re: AIO writes vs hint bits vs checksums

2025-10-27 Thread Michael Paquier
On Mon, Oct 27, 2025 at 02:48:43PM +0300, Maxim Orlov wrote: > I think there is one thing that could be improved here. The isolation > test index-killtuples (377b7ab1452) adds a new dependency: > contrib/btree_gin. contrib/btree_gist. This must be taken into > account in the makefile. Also mention

Re: Making pg_rewind faster

2025-10-27 Thread Michael Paquier
On Thu, Oct 23, 2025 at 08:40:14AM -0400, Robert Haas wrote: > While I'm not against cross-checking against the control file, this > sounds like an imaginary scenario to me. That is, it would only happen > if somebody maliciously modified the contents of the data directory by > hand with the expres

Re: Bug in pg_stat_statements

2025-10-27 Thread Michael Paquier
On Mon, Oct 27, 2025 at 02:34:50PM -0500, Sami Imseih wrote: > The excellent question raised earlier is whether the fix should be > applied in pg_stat_statements.c or queryjumblefuncs.c. To me, this > suggests that pg_stat_statements, as an extension, is dealing with code > it should not be respons

Re: Docs and tests for RLS policies applied by command type

2025-10-27 Thread jian he
On Mon, Oct 27, 2025 at 7:26 PM Dean Rasheed wrote: > > Updated patch attached. > hi. TABLE, Policies Applied by Command Type MERGE related change looks very similar to standalone INSERT/UPDATE/DELETE. overall v3-0001 looks good to me. while reading the doc, this description in UPDATE section:

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

2025-10-27 Thread shveta malik
On Mon, Oct 27, 2025 at 11:56 PM Masahiko Sawada wrote: > > On Mon, Oct 27, 2025 at 8:08 AM shveta malik wrote: > > > > On Mon, Oct 27, 2025 at 6:12 PM Amit Kapila wrote: > > > > > > On Sat, Oct 25, 2025 at 4:06 AM Masahiko Sawada > > > wrote: > > > > > > > > On Fri, Oct 24, 2025 at 4:48 AM Am

Re: minor error message enhance: print RLS policy name when only one permissive policy exists

2025-10-27 Thread Chao Li
> On Oct 28, 2025, at 10:01, jian he wrote: > > hi. > > The attached patch did what the $subject says. > demo: > > begin; > create role alice login; > grant all on schema public to alice; > drop table if exists tts; > create table tts(a int); > grant insert on tts to alice; > ALTER TABLE tts

Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

2025-10-27 Thread Chao Li
Hi Philip, Thanks for the patch. I just reviewed it and got a few comments: > On Oct 23, 2025, at 06:27, Philip Alger wrote: > > 1 ``` + /* Parse the trigger name to handle quoted identifiers */ + nameList = textToQualifiedNameList(trgName); + if (list_length(nameList) != 1)

Re: C11: should we use char32_t for unicode code points?

2025-10-27 Thread Thomas Munro
On Mon, Oct 27, 2025 at 8:43 AM Jeff Davis wrote: > What would be the problem if it were larger than 32 bits? Hmm, OK fair question, I can't think of any, I was just working through the standard and thinking myopically about the exact definition, but I think it's actually already covered by other

minor error message enhance: print RLS policy name when only one permissive policy exists

2025-10-27 Thread jian he
hi. The attached patch did what the $subject says. demo: begin; create role alice login; grant all on schema public to alice; drop table if exists tts; create table tts(a int); grant insert on tts to alice; ALTER TABLE tts ENABLE ROW LEVEL SECURITY; CREATE POLICY p1 ON tts FOR ALL USING (a = 1 or

Re: Logical Replication of sequences

2025-10-27 Thread Chao Li
> On Oct 27, 2025, at 17:11, Chao Li wrote: > > The changes in 0001 are straightforward, looks good. I haven’t reviewed 0004 > yet. Comments for 0004: 1 - config.sgml ``` -In logical replication, this parameter also limits how often a failing -replication apply worker or ta

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-10-27 Thread Mihail Nikalayeu
Hello, Noah! Thanks for the attention! On Mon, Oct 27, 2025 at 7:06 PM Noah Misch wrote: > Yes, I'm happy to push a patch documenting it. Would you like to propose the > specific doc patch? I regret lacking the bandwidth to review the fix patches. Of course! First version in attachment, wait

Re: Feature: psql - display current search_path in prompt

2025-10-27 Thread Chao Li
> On Oct 28, 2025, at 04:29, Nathan Bossart wrote: > > Here is what I have staged for commit. I ended up simplifying the patch a > bit. In particular, I thought better of the question mark business. It > looks like we ordinarily just skip values that can't be found, and an empty > search_pa

Re: Optimize LISTEN/NOTIFY

2025-10-27 Thread Chao Li
> On Oct 27, 2025, at 14:18, Joel Jacobson wrote: > > On Mon, Oct 27, 2025, at 02:27, Chao Li wrote: >>> On Oct 27, 2025, at 07:24, Joel Jacobson wrote: >>> >>> Write-up of changes since v20: >>> >>> Two new fields have been added to QueueBackendStatus: >>> + QueuePosition advisoryPos; /* s

Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments

2025-10-27 Thread Chao Li
> On Oct 27, 2025, at 20:13, Aleksander Alekseev > wrote: > > Hi Nathan, > >>> Personally I don't have a strong opinion on this. We can easily add an >>> exception for "/* ---" and "/* ===" comments if somebody believes this >>> is a problem. I choose not to add such an exception just yet on

Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments

2025-10-27 Thread Chao Li
> On Oct 28, 2025, at 07:35, Michael Paquier wrote: > > On Mon, Oct 27, 2025 at 09:55:38AM -0500, Nathan Bossart wrote: >> /* >> * DISABLE_LEADER_PARTICIPATION disables the leader's participation in >> * parallel index builds. This may be useful as a debugging aid. >> -#undef DISABLE_LEADER

Re: display hot standby state in psql prompt

2025-10-27 Thread Fujii Masao
On Tue, Oct 28, 2025 at 6:00 AM Nathan Bossart wrote: > > On Mon, Oct 27, 2025 at 09:17:03PM +0100, Jim Jones wrote: > > On 27/10/2025 17:23, Nathan Bossart wrote: > >> This was briefly mentioned upthread, but I'm a little concerned that this > >> doesn't respond to commands like SET TRANSACTION R

Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments

2025-10-27 Thread Michael Paquier
On Mon, Oct 27, 2025 at 09:55:38AM -0500, Nathan Bossart wrote: > /* > * DISABLE_LEADER_PARTICIPATION disables the leader's participation in > * parallel index builds. This may be useful as a debugging aid. > -#undef DISABLE_LEADER_PARTICIPATION > + *#undef DISABLE_LEADER_PARTICIPATION > */

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

2025-10-27 Thread Michael Paquier
On Fri, Oct 24, 2025 at 12:34:56PM +0100, Mircea Cadariu wrote: > So far so good! Yes, the buildfarm has not been complaining. > About the main issue, seems to me the consensus is that dropping unnamed > portals more aggressively is the way to go? At the cost of one extra hash table lookup, that

Re: Remove specific \r\n code in TAP for Windows

2025-10-27 Thread Michael Paquier
On Mon, Oct 27, 2025 at 08:33:57AM -0700, Jacob Champion wrote: > Ah, sorry, I put part of my first attempt at it over in [1]. But I > realize that's not very visible, nor does it address > 003_ldap_connection_param_lookup. Ahh, so you did post something. I have missed that > I'm carrying a lo

Re: another autovacuum scheduling thread

2025-10-27 Thread David Rowley
On Tue, 28 Oct 2025 at 11:35, Sami Imseih wrote: > We discuss the threshold calculations in the documentation, and users > can write scripts to monitor which tables are eligible. However, there > is nothing that indicates which table autovacuum will work on next (I > have been asked that question

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-10-27 Thread Dmitry Koval
Hi Alexander! 1. > The second CommandCounterIncrement() is needed to make the renamed > relation visible within our transaction. Why do we need the first >one? I see tests pass without it. It's strange. If I comment the first "CommandCounterIncrement();", in block -

Re: another autovacuum scheduling thread

2025-10-27 Thread David Rowley
The patch is starting to look good. Here's a review of v5: 1. I think the following code at the bottom of relation_needs_vacanalyze() can be deleted. You've added the check to ensure *doanalyze never gets set to true for pg_statistic. /* ANALYZE refuses to work with pg_statistic */ if (relid == S

Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions

2025-10-27 Thread Sergey Prokhorenko
On Sat, Oct 25, 2025 at 11:07 AM Andrey Borodin wrote: > > > > > On 25 Oct 2025, at 04:31, Masahiko Sawada wrote: > > > > Or providing > > 'uuid_encode(uuid, format text) -> text' and 'uuid_decode(text, format > > text) -> uuid' might make sense too, but I'm not sure. > > I like the idea, s

Re: another autovacuum scheduling thread

2025-10-27 Thread Sami Imseih
> > I wrote a sql that returns the tables and scores, which I found was > > useful when I was testing this out, so having the actually rules spelled out > > in docs will actually be super useful. > > Can you elaborate on how it would be useful? I'd be open to adding a short > note that autovacuum

Re: another autovacuum scheduling thread

2025-10-27 Thread Nathan Bossart
On Mon, Oct 27, 2025 at 12:47:15PM -0500, Sami Imseih wrote: > 1/ Should we add documentation explaining this prioritization behavior in [0]? > > I wrote a sql that returns the tables and scores, which I found was > useful when I was testing this out, so having the actually rules spelled out > in

Re: apply_scanjoin_target_to_paths and partitionwise join

2025-10-27 Thread Robert Haas
On Thu, Jan 2, 2025 at 3:58 PM Tom Lane wrote: > I am wondering if the problem is not that the plan is slower, it's > that for some reason the planner took a lot longer to create it. > It's very plausible that partitionwise planning takes longer, and > maybe we have some corner cases where the tim

Re: display hot standby state in psql prompt

2025-10-27 Thread Nathan Bossart
On Mon, Oct 27, 2025 at 09:17:03PM +0100, Jim Jones wrote: > On 27/10/2025 17:23, Nathan Bossart wrote: >> This was briefly mentioned upthread, but I'm a little concerned that this >> doesn't respond to commands like SET TRANSACTION READ ONLY. I wonder if we >> should mark transaction_read_only as

Re: Optimizing ResouceOwner to speed up COPY

2025-10-27 Thread Tomas Vondra
On 10/27/25 16:14, Tomas Vondra wrote: > On 10/21/25 16:43, Tomas Vondra wrote: >> ... >> >> The results seem fairly stable, and the overall trend is clear. It'd be >> great if there were no regressions, but considering how narrow is this >> microbenchmark (and considering the benefits for practica

Re: Feature: psql - display current search_path in prompt

2025-10-27 Thread Nathan Bossart
Here is what I have staged for commit. I ended up simplifying the patch a bit. In particular, I thought better of the question mark business. It looks like we ordinarily just skip values that can't be found, and an empty search_path will appear as "" (two double-quotes), so you can still disting

Re: display hot standby state in psql prompt

2025-10-27 Thread Jim Jones
On 27/10/2025 17:23, Nathan Bossart wrote: > This was briefly mentioned upthread, but I'm a little concerned that this > doesn't respond to commands like SET TRANSACTION READ ONLY. I wonder if we > should mark transaction_read_only as GUC_REPORT and use that instead. FWIW > I see that we marke

Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)

2025-10-27 Thread Euler Taveira
On Mon, Oct 27, 2025, at 2:58 PM, Bryan Green wrote: > Thanks for even glancing at this. I did not add any regression > tests because the output goes to the server log and not the client. > Since Michael said WIN32-specific tests and mentioned log pattern, he is referring to TAP tests. You c

Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions

2025-10-27 Thread Masahiko Sawada
On Sat, Oct 25, 2025 at 11:07 AM Andrey Borodin wrote: > > > > > On 25 Oct 2025, at 04:31, Masahiko Sawada wrote: > > > > Or providing > > 'uuid_encode(uuid, format text) -> text' and 'uuid_decode(text, format > > text) -> uuid' might make sense too, but I'm not sure. > > I like the idea, so I dr

Re: NLS: use gettext() to translate system error messages

2025-10-27 Thread Jeff Davis
On Mon, 2025-10-27 at 15:10 +0200, Álvaro Herrera wrote: > Hmm, interesting idea.  I think the most difficult part is obtaining > the > source strings: we need to run your errno_translation.c program on > _all_ > platforms, I have attached .po files for the standard set of errnos (those recognized

Re: Bug in pg_stat_statements

2025-10-27 Thread Sami Imseih
Thanks for reviewing! >Not so sure about the > refactoring in the second patch -- generate_normalized_query is being > used only in one place, in pg_stat_statements, moving it out somewhere > else without having other clients seems to be questionable to me. The excellent question raised earlier i

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

2025-10-27 Thread Masahiko Sawada
On Sun, Oct 26, 2025 at 11:49 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Sawada-san, > > > > Why can't we avoid counting invalid slots? I think this needs more > > > comments. BTW, shouldn't this patch consider changing > > > effective_wal_level when the last logical slot is invalidated? > > > Ide

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

2025-10-27 Thread Masahiko Sawada
On Sun, Oct 26, 2025 at 7:14 PM Peter Smith wrote: > > Hi Sawada-San, > > Some review comments for v22-0002: > > == > doc/src/sgml/logicaldecoding.sgml > > 1. > consistency. Conversely, when the last logical replication slot is > dropped > - from a system with wal_level set to > rep

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

2025-10-27 Thread Masahiko Sawada
On Sun, Oct 26, 2025 at 5:54 PM Peter Smith wrote: > > Hi Sawada. > > A couple of comments for v22-0001. > > == > > 1. > + /* > + * We don't need this warning message when wal_level >= 'replica' since > + * logical decoding is automatically enabled up on a logical slot > + * creation. > + */ >

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

2025-10-27 Thread Masahiko Sawada
On Mon, Oct 27, 2025 at 8:08 AM shveta malik wrote: > > On Mon, Oct 27, 2025 at 6:12 PM Amit Kapila wrote: > > > > On Sat, Oct 25, 2025 at 4:06 AM Masahiko Sawada > > wrote: > > > > > > On Fri, Oct 24, 2025 at 4:48 AM Amit Kapila > > > wrote: > > > > > > > > 5. > > > > +bool > > > > +CheckLog

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-10-27 Thread Noah Misch
On Mon, Oct 20, 2025 at 09:27:00PM +0200, Mihail Nikalayeu wrote: > Some tests of stabilization, discussed in [0]. > > Also, an issue known for more then 1.5year... Should we at least document it? Yes, I'm happy to push a patch documenting it. Would you like to propose the specific doc patch? I

Re: COPY WHERE clause generated/system column reference

2025-10-27 Thread Kirill Reshke
On Mon, 27 Oct 2025 at 13:21, jian he wrote: > > hi. > > CREATE TABLE gtest0 (a int, b int GENERATED ALWAYS AS (a + 1) VIRTUAL); > copy gtest0 from stdin where (b <> 1); > 0 > \. > > ERROR: unexpected virtual generated column reference > CONTEXT: COPY gtest0, line 1: "0" > > We need to apply exp

Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)

2025-10-27 Thread Bryan Green
On 10/20/2025 3:40 AM, Michael Paquier wrote: On Mon, Oct 20, 2025 at 10:10:25AM +0200, Jakub Wartak wrote: Cool, thanks for working on this. Win32 is a bit alien to me, but I've got access to win32 so I've played with the patch a little bit. With simple: SET backtrace_functions = 'typenameType'

Re: another autovacuum scheduling thread

2025-10-27 Thread Sami Imseih
I spent some time looking at this, and I am not sure how much this will move the goalpost, since most of the time the bottleneck for autovacuum is the limited number of workers and large tables that take a long time to process. That said, this is a good change for the simple reason that it is bett

Re: Batching in executor

2025-10-27 Thread Peter Geoghegan
On Mon, Sep 29, 2025 at 7:01 AM Tomas Vondra wrote: > While looking at the patch, I couldn't help but think about the index > prefetching stuff that I work on. It also introduces the concept of a > "batch", for passing data between an index AM and the executor. It's > interesting how different the

Re: Question about InvalidatePossiblyObsoleteSlot()

2025-10-27 Thread Masahiko Sawada
On Thu, Oct 23, 2025 at 3:07 AM Bertrand Drouvot wrote: > > Hi, > > On Wed, Oct 22, 2025 at 02:18:33PM +0530, Amit Kapila wrote: > > On Mon, Oct 20, 2025 at 11:41 AM Bertrand Drouvot > > wrote: > > > > > > Yeah so 818fefd8fd4 is well suited for tests consistency but in some rare > > > cases > >

RE: Newly created replication slot may be invalidated by checkpoint

2025-10-27 Thread Vitaly Davydov
Dear Hayato, On Tuesday, October 07, 2025 14:53 MSK, "Hayato Kuroda (Fujitsu)" wrote: > > Yes, I > > propose > > to ensure that the protection happens when we assign restart_lsn. It seems > > to be > > wrong that we invalidate slots by its restart_lsn but protect the wal for > > slots using XL

Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement

2025-10-27 Thread Mark Wong
Hi everyone, On Thu, Oct 16, 2025 at 01:47:53PM +0530, Akshay Joshi wrote: > > > On Wed, Oct 15, 2025 at 10:55 PM Álvaro Herrera wrote: > > Hello, > > I have reviewed this patch before and provided a number of comments that > have been addressed by Akshay (so I encourage you to li

Re: Batching in executor

2025-10-27 Thread Tomas Vondra
On 10/27/25 08:24, Amit Langote wrote: > Hi Tomas, > > On Mon, Sep 29, 2025 at 8:01 PM Tomas Vondra wrote: >> >> Hi Amit, >> >> Thanks for the patch. I took a look over the weekend, and done a couple >> experiments / benchmarks, so let me share some initial feedback (or >> rather a bunch of quest

Re: display hot standby state in psql prompt

2025-10-27 Thread Nathan Bossart
On Mon, Oct 27, 2025 at 09:08:17AM +0100, Jim Jones wrote: > +Displays the session's read-only status as > read-only > +if the server is in hot standby > (in_hot_standby is > +on) or the default transaction mode is > read-only > +(default_transacti

Re: display hot standby state in psql prompt

2025-10-27 Thread Nathan Bossart
On Fri, Oct 24, 2025 at 08:43:20PM +0530, Srinath Reddy Sadipiralla wrote: > On Fri, Oct 24, 2025 at 8:36 PM Greg Sabino Mullane > wrote: >> read-only >> read/write > > +1 Alright, I seem to have been outvoted, then. -- nathan

Re: another autovacuum scheduling thread

2025-10-27 Thread Nathan Bossart
On Sun, Oct 26, 2025 at 02:25:48PM +1300, David Rowley wrote: > Thanks. I've just had a look at it. A few comments and questions. Thanks. > 1) The subtraction here looks back to front: > > + xid_age = TransactionIdIsNormal(relfrozenxid) ? relfrozenxid - recentXid : > 0; > + mxid_age = MultiXact

Re: POC: make mxidoff 64 bits

2025-10-27 Thread Maxim Orlov
Here is a new patch set @ 10b5bb3bffaee8 As previously stated, the patch set implements the concept of saving the "difference" between page offsets in order to save disc space. The second significant change was that I decided to modify the pg_upgrade portion as suggested by Heikki above. At the

Re: Use merge-based matching for MCVs in eqjoinsel

2025-10-27 Thread David Geier
Hi Ilia! On 10.09.2025 15:56, Ilia Evdokimov wrote: > > LGTM. Yes, I'll test this patch. > > > > Unfortunately, the JOB benchmark does not contain semi join nodes. > However, TPC-DS does. I'll look for the queries with slowest planner > times there and check them. > > I'll need some time to c

Re: Remove specific \r\n code in TAP for Windows

2025-10-27 Thread Jacob Champion
On Thu, Oct 23, 2025 at 11:51 PM Michael Paquier wrote: > $subject has been mentioned by Jacob (in CC.) on Discord, and it does > not seem like somebody took the time to propose a patch. Ah, sorry, I put part of my first attempt at it over in [1]. But I realize that's not very visible, nor does i

Отв.: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions

2025-10-27 Thread Sergey Prokhorenko
Hi Sergey, > It seems that bytea is your personal interest, since you continue to impose > your bytea when a better solution has already been found with uuid_encode() > and uuid_decode(). In the previous messages Masahiko Sawada wrote: > Or providing > 'uuid_encode(uuid, format text) -> text

Re: Optimizing ResouceOwner to speed up COPY

2025-10-27 Thread Tomas Vondra
On 10/21/25 16:43, Tomas Vondra wrote: > ... > > The results seem fairly stable, and the overall trend is clear. It'd be > great if there were no regressions, but considering how narrow is this > microbenchmark (and considering the benefits for practical COPY runs), > I'd say it's probably OK. >

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

2025-10-27 Thread shveta malik
On Mon, Oct 27, 2025 at 6:12 PM Amit Kapila wrote: > > On Sat, Oct 25, 2025 at 4:06 AM Masahiko Sawada wrote: > > > > On Fri, Oct 24, 2025 at 4:48 AM Amit Kapila wrote: > > > > > > 5. > > > +bool > > > +CheckLogicalSlotExists(void) > > > { > > > … > > > + /* NB: counting invalidated slots */ > >

Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments

2025-10-27 Thread Nathan Bossart
On Mon, Oct 27, 2025 at 03:13:33PM +0300, Aleksander Alekseev wrote: > OK, here is the corrected patch v5. Thanks. I had to run pgindent twice before it stopped making changes, but the results look pretty good to me. However, I still noticed a few oddities. --- a/contrib/seg/seg.c +++ b/contrib

Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions

2025-10-27 Thread Aleksander Alekseev
Hi Sergey, > It seems that bytea is your personal interest, since you continue to impose > your bytea when a better solution has already been found with uuid_encode() > and uuid_decode(). In the previous messages Masahiko Sawada wrote: > Or providing > 'uuid_encode(uuid, format text) -> text'

Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions

2025-10-27 Thread Sergey Prokhorenko
Hi, > > Or providing > > 'uuid_encode(uuid, format text) -> text' and 'uuid_decode(text, format > > text) -> uuid' might make sense too, but I'm not sure. > > I like the idea, so I drafted a prototype for discussion. > Though I do not see what else methods should be provided along with added > one

Re: Unnecessary delay in streaming replication due to replay lag

2025-10-27 Thread Fujii Masao
On Thu, Sep 11, 2025 at 5:51 PM sunil s wrote: > > Hello Hackers, > > PFA rebased patch due to the code changes done in upstream commit > 63599896545c7869f7dd28cd593e8b548983d613. > > The current status of the patch registered in Commit Fest is "Ready for > Committer". +streamed WAL. Su

Re: NLS: use gettext() to translate system error messages

2025-10-27 Thread Álvaro Herrera
On 2025-Oct-23, Jeff Davis wrote: > The attached patch changes "%m" replacements to use gettext for > translation. That makes the overall translations more consistent, > equally available on all platforms, and not dependent on LC_CTYPE > (because gettext allows the encoding for gettext can be set

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

2025-10-27 Thread Amit Kapila
On Sat, Oct 25, 2025 at 4:06 AM Masahiko Sawada wrote: > > On Fri, Oct 24, 2025 at 4:48 AM Amit Kapila wrote: > > > > 5. > > +bool > > +CheckLogicalSlotExists(void) > > { > > … > > + /* NB: counting invalidated slots */ > > + > > + if (SlotIsLogical(s)) > > > > Why can't we avoid counting invalid

Re: Resetting recovery target parameters in pg_createsubscriber

2025-10-27 Thread Alena Vinter
Hi everyone, Michael, thank you for outlining your alternative approach. After rethinking the current patch state with a clearer vision, I realized that simply truncating the postgresql.auto.conf file is sufficient. All modifications made by pg_createsubscriber in this file are append-only, so tru

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-10-27 Thread Alexander Korotkov
On Mon, Sep 22, 2025 at 11:12 PM Dmitry Koval wrote: > Hi, Jiah He! > > 1. > >duplicated CommandCounterIncrement call? > > Probably this duplication is necessary to rename partition correctly ... > The second CommandCounterIncrement() is needed to make the renamed relation visible within our tr

Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments

2025-10-27 Thread Aleksander Alekseev
Hi Nathan, > > Personally I don't have a strong opinion on this. We can easily add an > > exception for "/* ---" and "/* ===" comments if somebody believes this > > is a problem. I choose not to add such an exception just yet only > > because I don't like unnecessary exceptions :) > > +1 for addin

Re: AIO writes vs hint bits vs checksums

2025-10-27 Thread Maxim Orlov
On Wed, 13 Aug 2025 at 22:38, Andres Freund wrote: > > Pushed the test with these changes. I think there is one thing that could be improved here. The isolation test index-killtuples (377b7ab1452) adds a new dependency: contrib/btree_gin. contrib/btree_gist. This must be taken into account in t

Re: Logical Replication of sequences

2025-10-27 Thread Amit Kapila
On Mon, Oct 27, 2025 at 12:19 PM vignesh C wrote: > > On Mon, 27 Oct 2025 at 10:04, Dilip Kumar wrote: > > > > On Mon, Oct 27, 2025 at 8:23 AM Zhijie Hou (Fujitsu) > > wrote: > >> > >> On Friday, October 24, 2025 11:22 PM vignesh C wrote: > >> > > >> > On Thu, 23 Oct 2025 at 16:47, Amit Kapila

Re: Docs and tests for RLS policies applied by command type

2025-10-27 Thread Dean Rasheed
On Mon, 27 Oct 2025 at 05:03, jian he wrote: > > v2-0001 looks good to me. Thanks. I've pushed that one. > > A recent commit reminded me that COPY ... TO also applies RLS SELECT > > policies (and so does TABLE, though I doubt many people use that), so > > I think it's worth testing and documenti

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

2025-10-27 Thread shveta malik
On Mon, Oct 27, 2025 at 6:24 AM Peter Smith wrote: > > Hi Sawada. > > A couple of comments for v22-0001. > > == > > 1. > + /* > + * We don't need this warning message when wal_level >= 'replica' since > + * logical decoding is automatically enabled up on a logical slot > + * creation. > + */ >

Re: Report bytes and transactions actually sent downtream

2025-10-27 Thread shveta malik
Few comments: 1) pgoutput_truncate: if (nrelids > 0) { OutputPluginPrepareWrite(ctx, true); logicalrep_write_truncate(ctx->out, xid, nrelids, relids, change->data.truncate.cascade, change->data.truncate.restart_seqs); OutputPluginWrite(ctx, true); } + else + ctx->stats->filteredBytes +=

Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions

2025-10-27 Thread Aleksander Alekseev
Hi, > > Or providing > > 'uuid_encode(uuid, format text) -> text' and 'uuid_decode(text, format > > text) -> uuid' might make sense too, but I'm not sure. > > I like the idea, so I drafted a prototype for discussion. > Though I do not see what else methods should be provided along with added > on

Re: Report bytes and transactions actually sent downtream

2025-10-27 Thread shveta malik
On Fri, Oct 3, 2025 at 12:22 PM Ashutosh Bapat wrote: > > > Here's patchset addressing two issues: > > Issue 1: A plugin supports stats in version X. It stopped supporting > the stats in version X + 1. It again started supporting stats in > version X + 2. Plugin stats will be accumulated when it w

Re: [PATCH] Little refactoring of portalcmds.c

2025-10-27 Thread wenhui qiu
Hi Aleksander Alekseev > The proposed patch places some repetitive code in a helper function. > The value of this change is arguably not that high but it makes the > code a bit neater IMO. I agree with your suggestion to refactor the duplicated code into a function. Thanks On Mon, Oct 27, 2025 a

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

2025-10-27 Thread Japin Li
Hi, Ajin Thanks for updating the patch. On Mon, 27 Oct 2025 at 18:47, Ajin Cherian wrote: > On Fri, Oct 24, 2025 at 8:29 PM shveta malik wrote: >> >> On Wed, Oct 22, 2025 at 10:25 AM Ajin Cherian wrote: >> > >> > >> > I've modified the comments to reflect the new changes. >> > >> > attaching

Re: Remove Item type

2025-10-27 Thread Peter Eisentraut
On 24.10.25 17:32, Nathan Bossart wrote: On Mon, Sep 29, 2025 at 12:20:00PM +0200, Peter Eisentraut wrote: So I'm proposing to remove the Item type, replace it with void * in function prototypes, and remove all the casts. The general idea seems reasonable to me, but I'm a little concerned that

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

2025-10-27 Thread Fujii Masao
On Tue, Oct 21, 2025 at 9:58 AM Fujii Masao wrote: > I agree that connection failures should prevent further processing even with > --continue-on-error, and pgbench should focus on handling that first. > However, the patch doesn't seem to handle cases where the connection is > terminated by an adm

Re: Logical Replication of sequences

2025-10-27 Thread Chao Li
> On Oct 24, 2025, at 23:22, vignesh C wrote: > > Regards, > Vignesh > The changes in 0001 are straightforward, looks good. I haven’t reviewed 0004 yet. Got a few comments for 0002 and 0003. 1 - 0002 ``` * We are only interested in the leader apply worker or table sync worker. + * For ap

Re: Logical Replication of sequences

2025-10-27 Thread shveta malik
On Sat, Oct 25, 2025 at 12:16 PM Amit Kapila wrote: > > On Fri, Oct 24, 2025 at 11:43 AM shveta malik wrote: > > > > 5) > > For the race condition where the worker is going to access the seq > > locally and meanwhile it is altered; now the worker correctly reports > > this. But it reports this as

Re: Logical Replication of sequences

2025-10-27 Thread shveta malik
On Mon, Oct 27, 2025 at 8:23 AM Zhijie Hou (Fujitsu) wrote: > > On Friday, October 24, 2025 11:22 PM vignesh C wrote: > > > > On Thu, 23 Oct 2025 at 16:47, Amit Kapila wrote: > > > > > > On Thu, Oct 23, 2025 at 11:45 AM vignesh C wrote: > > > > > > > > The attached patch has the changes for the

COPY WHERE clause generated/system column reference

2025-10-27 Thread jian he
hi. CREATE TABLE gtest0 (a int, b int GENERATED ALWAYS AS (a + 1) VIRTUAL); copy gtest0 from stdin where (b <> 1); 0 \. ERROR: unexpected virtual generated column reference CONTEXT: COPY gtest0, line 1: "0" We need to apply expand_generated_columns_in_expr to the whereClause in DoCopy. However

Re: display hot standby state in psql prompt

2025-10-27 Thread Jim Jones
On 27/10/2025 04:32, Fujii Masao wrote: > I think the "hs &&" and "ro &&" checks are no longer needed, > since we've already confirmed they're not NULL at that point. Right. Checks removed. > Also, should "unknown" be marked for translation, as in the \conninfo code? > I'm not sure whether show

Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)

2025-10-27 Thread Jakub Wartak
On Wed, Oct 22, 2025 at 3:09 AM Bryan Green wrote: Hi Bryan, [..] > Yes. We should call cleanup at the backend shutdown, as initialize is > called once. I have put together a new patch (for better patch naming) > and added the cleanup code. I've played a little time with this and this looks go

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

2025-10-27 Thread Ajin Cherian
On Fri, Oct 24, 2025 at 8:29 PM shveta malik wrote: > > On Wed, Oct 22, 2025 at 10:25 AM Ajin Cherian wrote: > > > > > > I've modified the comments to reflect the new changes. > > > > attaching patch v18 with the above changes. > > > > Thanks for the patch. The test is still not clear. Can we ple

Re: Batching in executor

2025-10-27 Thread Amit Langote
Hi Tomas, On Mon, Sep 29, 2025 at 8:01 PM Tomas Vondra wrote: > > Hi Amit, > > Thanks for the patch. I took a look over the weekend, and done a couple > experiments / benchmarks, so let me share some initial feedback (or > rather a bunch of questions I came up with). Thank you for reviewing the