Use bsearch() instead of a manual binary search in syscache.c

2025-11-07 Thread cca5507
Hi, hackers! I make a patch for the $subject, which make the code simpler, thoughts? -- Regards, ChangAo Chen v1-0001-Use-bsearch-instead-of-a-manual-binary-search-in-.patch Description: Binary data

[PATCH] Add hints for invalid binary encoding names in encode/decode functions

2025-11-07 Thread Sugamoto Shinya
Hi, When users pass an invalid encoding name to the built-in functions `encode()` or `decode()`, PostgreSQL currently reports only: ERROR: unrecognized encoding: "xxx" This patch adds an error hint listing the valid encoding names, so users can immediately see the supported options. Exampl

[PATCH] Fix text in comment of copyto.c

2025-11-07 Thread 河田達也
Hi, This patch fixes a missed correction in a comment in vacuum.c. The word "cstate for COPY TO/FROM" was corrected to "cstate for COPY TO". No functional changes. Best regards, Tatsuya Kawata 0001-Fix-text-about-copyto-from-cstate-in-copyto.c.patch Description: Binary data

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-07 Thread Manni Wood
On Fri, Nov 7, 2025 at 10:19 PM Manni Wood wrote: > > > On Fri, Nov 7, 2025 at 6:03 PM Jim Jones > wrote: > >> >> >> On 08/11/2025 00:38, Manni Wood wrote: >> > Alas, the build https://commitfest.postgresql.org/patch/6175/ > > commitfest.postgresql.org/patch/6175/> now fails, and I cannot >> rep

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-07 Thread Manni Wood
On Fri, Nov 7, 2025 at 6:03 PM Jim Jones wrote: > > > On 08/11/2025 00:38, Manni Wood wrote: > > Alas, the build https://commitfest.postgresql.org/patch/6175/ > commitfest.postgresql.org/patch/6175/> now fails, and I cannot reproduce > > on my machine. Obviously there will be a v9... > > You for

Re: Extra blank line in StrategyGetBuffer

2025-11-07 Thread Bruce Momjian
Agreed, patch applied, thanks. --- On Tue, Nov 4, 2025 at 02:27:12PM +0530, Ashutosh Bapat wrote: > Hi Andres, > It seems that 5e89985928795f243dc287210c2aa016dfd00bfe left an extra > line in StrategyGetBetter(). Doesn't s

Re: Support allocating memory for large strings

2025-11-07 Thread Tom Lane
Maxim Zibitsker writes: > PostgreSQL's MaxAllocSize limit prevents storing individual variable-length > character strings exceeding ~1GB, causing "invalid memory alloc request size" > errors during INSERT operations on tables with large text columns. This is news to no one. We are not especial

Support allocating memory for large strings

2025-11-07 Thread Maxim Zibitsker
PostgreSQL's MaxAllocSize limit prevents storing individual variable-length character strings exceeding ~1GB, causing "invalid memory alloc request size" errors during INSERT operations on tables with large text columns. Example reproduction included in artifacts.md. This limitation also affect

Re: IO in wrong state on riscv64

2025-11-07 Thread Tom Lane
Thomas Munro writes: > On Sat, Nov 8, 2025 at 1:03 PM Tom Lane wrote: >> You're a brave man to be pushing this into the last-ever release >> of v13 with all of 12 hours remaining till code freeze. I don't >> mind so much for the newer branches, but I'm feeling nervous >> about the risk/reward ra

Re: contrib/pg_stat_tcpinfo

2025-11-07 Thread Andres Freund
Hi, On 2025-11-08 00:17:30 +0100, Tomas Vondra wrote: > On 11/7/25 11:36, Jakub Wartak wrote: > > On Mon, Nov 3, 2025 at 3:09 PM Jakub Wartak > > wrote: > >> > >> Attached is pg_stat_tcpinfo, an heavy work in progress, Linux-only > >> netstat/ss-like extension for showing detailed information abo

Re: Thoughts on a "global" client configuration?

2025-11-07 Thread Jacob Champion
On Wed, Oct 29, 2025 at 7:20 AM Peter Eisentraut wrote: > After studying this a bit more and reading your account, I'm now > coming over to the side that a libpq defaults configuration file > should be separate from the existing services file mechanism. I think I agree, for all the reasons you ci

Re: IO in wrong state on riscv64

2025-11-07 Thread Thomas Munro
On Sat, Nov 8, 2025 at 1:03 PM Tom Lane wrote: > You're a brave man to be pushing this into the last-ever release > of v13 with all of 12 hours remaining till code freeze. I don't > mind so much for the newer branches, but I'm feeling nervous > about the risk/reward ratio for v13. I figured "add

Re: IO in wrong state on riscv64

2025-11-07 Thread Andres Freund
Hi, On 2025-11-07 19:03:46 -0500, Tom Lane wrote: > Thomas Munro writes: > > Alexander did some extensive testing and we stared at the codegen on a > > lot of architectures to confirm that this prevents the reordering. > > Pushed and back-patched like that. > > You're a brave man to be pushing t

Re: IO in wrong state on riscv64

2025-11-07 Thread Tom Lane
Thomas Munro writes: > Alexander did some extensive testing and we stared at the codegen on a > lot of architectures to confirm that this prevents the reordering. > Pushed and back-patched like that. You're a brave man to be pushing this into the last-ever release of v13 with all of 12 hours rema

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-07 Thread Jim Jones
On 08/11/2025 00:38, Manni Wood wrote: > Alas, the build https://commitfest.postgresql.org/patch/6175/ commitfest.postgresql.org/patch/6175/> now fails, and I cannot reproduce > on my machine. Obviously there will be a v9... You forgot the declaration for build_tablespace_ddl_string[1]: ruleu

Re: IO in wrong state on riscv64

2025-11-07 Thread Thomas Munro
On Thu, Oct 23, 2025 at 8:52 PM Thomas Munro wrote: > Oh, I think this should work better: > > #define pg_read_barrier_impl() \ > do { pg_compiler_barrier_impl(); > __atomic_thread_fence(__ATOMIC_ACQUIRE); } while (0) Alexander did some extensive testing and we stared at the codegen on a lot of a

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-07 Thread Manni Wood
On Fri, Nov 7, 2025 at 4:38 PM Manni Wood wrote: > > > On Fri, Nov 7, 2025 at 10:16 AM Jim Jones > wrote: > >> >> >> On 07/11/2025 02:27, Manni Wood wrote: >> > Attached v7 fixes problems in tests due to whitespace. >> >> >> Since get_tablespace_loc_string returns a palloc'd string, I guess you

Re: contrib/pg_stat_tcpinfo

2025-11-07 Thread Tomas Vondra
On 11/7/25 11:36, Jakub Wartak wrote: > On Mon, Nov 3, 2025 at 3:09 PM Jakub Wartak > wrote: >> >> Attached is pg_stat_tcpinfo, an heavy work in progress, Linux-only >> netstat/ss-like extension for showing detailed information about TCP >> connections based on information from the kernel itself.

Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

2025-11-07 Thread Michael Paquier
On Fri, Nov 07, 2025 at 09:48:23PM +0800, Xuneng Zhou wrote: > Now that the LSN-waiting infrastructure (3b4e53a) and WAL replay > wake-up calls (447aae1) are in place, this patch has been updated to > make use of them. > Please check. That's indeed much simpler. I'll check later what you have her

Re: Sequence Access Methods, round two

2025-11-07 Thread Michael Paquier
On Fri, Nov 07, 2025 at 05:05:55PM +0100, Andrei Lepikhov wrote: > 1. For pgEdge Snowflake, it would be really beneficial - there are not only > code copying issues, but also the Serial -> Snowflake conversion algorithm. > Additionally, for now, only an in-core sequence can be used as an 'identity

Re: Extended Statistics set/restore/clear functions.

2025-11-07 Thread Michael Paquier
On Fri, Nov 07, 2025 at 05:28:50PM -0500, Corey Huinker wrote: > I'm open to other formats, but aside from renaming the json keys (maybe > "attnums" or "keys" instead of "attributes"?), I'm not sure what really > could be done and still be JSON. I suppose we could go with a tuple format > like this

Re: Enhancing Memory Context Statistics Reporting

2025-11-07 Thread Rahila Syed
Hi, I have attached a version 40 patch that has been rebased onto the latest master branch, as CFbot indicated a rebase was needed. The test module patch is unchanged. Thank you, Rahila Syed On Tue, Oct 28, 2025 at 11:06 AM Rahila Syed wrote: > Hi, > > PFA an updated v39 patch which is ready f

Re: postmaster uses more CPU in 18 beta1 with io_method=io_uring

2025-11-07 Thread Tomas Vondra
On 9/22/25 10:45, Jakub Wartak wrote: > ... > I see two paths forward: > > 1. either we make it shorter, but I do not know if a multi-sentence > error message isn't against some project's policy? Feel free to > readjust as necessary, I'm not strongly attached to the exact wording > , just to hi

Re: Missing calls to UnlockBuffers() - unify error handling?

2025-11-07 Thread Andres Freund
Hi, On 2025-11-06 10:34:58 -0500, Andres Freund wrote: > While hacking on a patch to "inline" the lock implementation of content locks > into storage/buffer/, I looked at the callers of UnlockBuffers() and compared > them to the callers of LWLockReleaseAll(). > > Somewhat disconcertingly, there a

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-07 Thread Manni Wood
On Fri, Nov 7, 2025 at 10:16 AM Jim Jones wrote: > > > On 07/11/2025 02:27, Manni Wood wrote: > > Attached v7 fixes problems in tests due to whitespace. > > > Since get_tablespace_loc_string returns a palloc'd string, I guess you > could pfree it after the if block. The same applies for spcowner,

Re: Extended Statistics set/restore/clear functions.

2025-11-07 Thread Corey Huinker
> > > Patch 0001 for ndistinct was missing a documentation update, we have > one query in perform.sgml that looks at stxdndistinct. Patch 0003 is > looking OK here as well. > Well spotted. > For dependencies, the format switches from a single json object > with key/vals like that: > "3 => 4": 1

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

2025-11-07 Thread Philip Alger
Hello Hackers, I was thinking about the patch a little more, and I think some people may want the pretty formatted option. I was going to create another patch for pg_get_triggerdef to add that functionality, like pg_get_functiondef and pg_get_viewdef. but I think it will break it since pg_get_tri

Re: Implement waiting for wal lsn replay: reloaded

2025-11-07 Thread Alexander Korotkov
On Wed, Nov 5, 2025 at 4:03 PM Xuneng Zhou wrote: > > On Wed, Nov 5, 2025 at 5:51 PM Alexander Korotkov > wrote: > > On Mon, Nov 3, 2025 at 5:13 PM Andres Freund wrote: > > > On 2025-11-03 16:06:58 +0100, Álvaro Herrera wrote: > > > > On 2025-Nov-03, Alexander Korotkov wrote: > > > > > > > > >

Re: Reorganize GUC structs

2025-11-07 Thread Álvaro Herrera
On 2025-Nov-07, Peter Eisentraut wrote: > Actually, the ", " already exists in the message catalog, so adding a > comment here might confuse the other site. This one? #: replication/logical/relation.c:245 #, c-format msgid ", \"%s\"" msgstr ", »%s«" It's different. (And warrants a comment too,

Extended test coverage and docs for SSL passphrase commands

2025-11-07 Thread Daniel Gustafsson
When I was writing tests for the SSL SNI patch [0] I realized that the current tests for ssl passphrase commands aren't fully exercising the feature, so I extended them to better understand how it works. Attached is an extended set of tests for passphrase protected keys where connection and reload

Draft back-branch release notes are up

2025-11-07 Thread Tom Lane
... at https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=7889889e4ea81e4e93a7b3e0d138f831e9dbd48b As usual, please send comments/correction by Sunday. regards, tom lane

Re: another autovacuum scheduling thread

2025-11-07 Thread Sami Imseih
> On Fri, 7 Nov 2025 at 11:21, Sami Imseih wrote: > > Also, I am thinking about another sorting strategy based on average > > autovacuum/autoanalyze time per table. The idea is to sort ascending by > > the greater of the two averages, so workers process quicker tables first > > instead of all work

Re: Optimize LISTEN/NOTIFY

2025-11-07 Thread Joel Jacobson
On Thu, Nov 6, 2025, at 09:33, Joel Jacobson wrote: > On Thu, Nov 6, 2025, at 00:21, Chao Li wrote: >> That’s what we don’t know. We now lack a performance test for >> evaluating how “direct advancement” efficiently helps if it only >> handles sleeping listeners. So what I was suggesting is that

Re: [PATCH] Add pg_get_role_ddl() functions for role recreation

2025-11-07 Thread Mario González Troncoso
On Fri, 7 Nov 2025 at 02:43, li carol wrote: > > Hello Bryan, > > I reviewed your patch and found one potential issue, please check it. > In pg_get_role_ddl_internal, the variable rolname is assigned from > NameStr(roleform->rolname) (line 588), which means it points directly into > the tuple re

Re: Issue with logical replication slot during switchover

2025-11-07 Thread Fabrice Chapuis
Hi, Here is the new version of the patch Regards, Fabrice On Tue, Nov 4, 2025 at 4:13 PM Fabrice Chapuis wrote: > I propose to modify > > get_local_synced_slots() => to get the local logical slots (the name of > the function must be renamed) > and > local_sync_slot_required() => to get also t

Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain

2025-11-07 Thread Bryan Green
On 11/6/2025 8:42 AM, Bryan Green wrote: > On 11/6/2025 7:43 AM, Thomas Munro wrote: >> On Sat, Nov 1, 2025 at 6:16 AM Bryan Green wrote: >>> Hello, >> >> Catching up with all your emails, and I must say it's great to see >> some solid investigation of PostgreSQL-on-Windows problems. There are >>

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-07 Thread Bertrand Drouvot
Hi, On Fri, Nov 07, 2025 at 03:03:03PM +, Bertrand Drouvot wrote: > Hi, > > On Fri, Nov 07, 2025 at 02:37:32PM +0100, Álvaro Herrera wrote: > > On 2025-Nov-07, Bertrand Drouvot wrote: > > > > > Agree, will modify the .cocci scripts that way. > > > > I just noticed that we missed this ... ma

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-07 Thread Dagfinn Ilmari Mannsåker
Peter Eisentraut writes: > On 07.11.25 16:03, Bertrand Drouvot wrote: > >> +#define pg_attribute_deprecated(msg) [[deprecated(msg)]] >> +#elif defined(__GNUC__) || defined(__clang__) > > The __clang__ part is not needed, because clang defines __GNUC__ also. Or, to avoid having to know this, how

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-07 Thread Bertrand Drouvot
Hi, On Fri, Nov 07, 2025 at 05:05:11PM +0100, Peter Eisentraut wrote: > On 07.11.25 16:03, Bertrand Drouvot wrote: > > +/* > > + * Mark a declaration as deprecated with a custom message. The compiler > > will > > + * emit a warning when the deprecated entity is used. > > + */ > > +#if defined(__S

Re: Decouple C++ support in Meson's PGXS from LLVM enablement

2025-11-07 Thread Tristan Partin
On Fri Nov 7, 2025 at 9:39 AM CST, Peter Eisentraut wrote: > On 28.09.25 23:16, Tristan Partin wrote: >>> Attached is a patch which decouples C++ support in PGXS from LLVM for >>> a Meson-compiled Postgres. >>> >>> [0]: https://github.com/duckdb/pg_duckdb >> >> With PGConf NYC around the corner, I

Re: AIX support

2025-11-07 Thread Peter Eisentraut
On 15.10.25 17:58, Srirama Kucherlapati wrote: Hi Andres and team, Please find attached the patch addressing Meson build changes for AIX. We tried to build using below meson ## meson -v 1.6.1 For the following files, the shared_module() function requires specifying the appropriate symbol

Re: Decouple C++ support in Meson's PGXS from LLVM enablement

2025-11-07 Thread Jelte Fennema-Nio
On Fri, 7 Nov 2025 at 16:39, Peter Eisentraut wrote: > The AC_PROG_CXX macro sets CXX to g++ if no C++ compiler is found. Then > a PGXS user would at least get an error message about g++ not found and > they can fix it by installing it. Maybe we should do that under Meson too. I think that soun

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-07 Thread Jim Jones
On 07/11/2025 02:27, Manni Wood wrote: > Attached v7 fixes problems in tests due to whitespace. Since get_tablespace_loc_string returns a palloc'd string, I guess you could pfree it after the if block. The same applies for spcowner, since you're calling GetUserNameFromId() with noerr = false.

Re: CI: Add task that runs pgindent

2025-11-07 Thread Tom Lane
Andres Freund writes: > Why does this need to be a separate task, instead of being folded into the > CompilerWarnings task or such? Increasing the peak numbers of CPUs cfbot needs > is unfortunately somewhat annoying, as I've been fighting w/ GCP to increase > the quotas much higher than what they

Re: Sequence Access Methods, round two

2025-11-07 Thread Andrei Lepikhov
On 7/11/2025 07:12, Michael Paquier wrote: On Thu, Oct 30, 2025 at 04:44:23PM +0900, Michael Paquier wrote: Rebased due to conflicts with 76acf4b722fa. Rebased as v24 as GUCs need to be in alphabetical order. Thanks for your efforts! I haven't dived into the code yet; I just want to add some

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-07 Thread Peter Eisentraut
On 07.11.25 16:03, Bertrand Drouvot wrote: +/* + * Mark a declaration as deprecated with a custom message. The compiler will + * emit a warning when the deprecated entity is used. + */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L || \ +defined(__cplusplus) && __cplusplus >= 20140

Re: Some efforts to get rid of "long" in our codebase

2025-11-07 Thread Tom Lane
Peter Eisentraut writes: > I do suggest some kind of comment, that we're using size_t as a > convenient proxy for the most suitable chunk/step size for the platform, > not to actually measure a size. Yeah. There's not actually anything wrong with using "long" here, except that we believe that

Re: POC: make mxidoff 64 bits

2025-11-07 Thread Maxim Orlov
I noticed one minor issue after I had already sent the previous letter. --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -1034,7 +1034,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset) if (nextOffset + nmembers < nextOffset) erepo

Re: Some efforts to get rid of "long" in our codebase

2025-11-07 Thread Peter Eisentraut
On 06.11.25 21:06, David Rowley wrote: On Fri, 7 Nov 2025 at 07:33, Peter Eisentraut wrote: On 06.11.25 12:46, David Rowley wrote: 0002: MemSet / MemSetAligned macros. It's probably about time someone made these disappear, but that's likely for another thread with more research than I'd like

Re: Reorganize GUC structs

2025-11-07 Thread Peter Eisentraut
On 07.11.25 10:38, Álvaro Herrera wrote: On 2025-Nov-07, Peter Eisentraut wrote: @@ -3135,14 +3135,14 @@ parse_and_validate_value(const struct config_generic *record, char *hintmsg; hintmsg = config_enum_get_options(conf, -

Re: Decouple C++ support in Meson's PGXS from LLVM enablement

2025-11-07 Thread Peter Eisentraut
On 28.09.25 23:16, Tristan Partin wrote: Attached is a patch which decouples C++ support in PGXS from LLVM for a Meson-compiled Postgres. [0]: https://github.com/duckdb/pg_duckdb With PGConf NYC around the corner, I thought I would rebase the original patch. Please find v2 attached, which appl

Re: CI: Add task that runs pgindent

2025-11-07 Thread Andres Freund
Hi, On 2025-10-21 14:19:29 +0200, Jelte Fennema-Nio wrote: > +# Check that code follows formatting standards > +task: > + name: FormattingCheck Why does this need to be a separate task, instead of being folded into the CompilerWarnings task or such? Increasing the peak numbers of CPUs cfbot need

Multixid SLRU truncation bugs at wraparound

2025-11-07 Thread Heikki Linnakangas
While working on the reported pg_upgrade failure at multixid wraparound [1], I bumped into another bug related to multixid wraparound. If you run vacuum freeze, and it advances oldestMultiXactId, and nextMulti has just wrapped around to 0, you get this in the log: LOG: MultiXact member wrapa

Re: Incorrect checksum in control file with pg_rewind test

2025-11-07 Thread Maksim.Melnikov
Hi, just to clarify, it isn't pg_rewind related issue and can fire spontaneously. I don't have any strong scenario how to reproduce it, tests sometimes fired on our local CI, but as you can see on thread [1], where the same issue for frontends was discussed, it is very hard to reproduce and the

Re: Reorganize GUC structs

2025-11-07 Thread Tom Lane
Peter Eisentraut writes: > Here are a few more small patches to fix related things I found > afterwards or in passing. Looks sane, except that the comparator could do with an extra "const" if there's enough room on the line: +const struct config_generic *ca = *(const struct config_generic *

Re: LTO aggressively optimizing out function despite explicit calls in logical decoding

2025-11-07 Thread Andres Freund
Hi, On 2025-11-06 11:39:03 +0400, Arkady Skvorcov wrote: > I'm working on a logical decoding improvement and running into a persistent > build issue where LTO (-flto=thin) is optimizing out my LogicalWaitForWal > function, even though there are explicit calls to it. > > The situation: > > Functi

Re: Xlogprefetcher: Use atomic add for increment counter

2025-11-07 Thread Ranier Vilela
Em sex., 7 de nov. de 2025 às 11:59, Andres Freund escreveu: > On 2025-11-07 11:52:37 -0300, Ranier Vilela wrote: > > Em sex., 7 de nov. de 2025 às 11:41, Andres Freund > > escreveu: > > > On 2025-11-07 11:28:06 -0300, Ranier Vilela wrote: > > > > Use pg_atomic_fetch_add_u64 to replace pg_atomic

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-07 Thread Bertrand Drouvot
Hi, On Fri, Nov 07, 2025 at 02:37:32PM +0100, Álvaro Herrera wrote: > On 2025-Nov-07, Bertrand Drouvot wrote: > > > Agree, will modify the .cocci scripts that way. > > I just noticed that we missed this ... maybe you want to include it also? > > - MyProc->waitLSN = 0; > + MyProc->waitLS

Re: Xlogprefetcher: Use atomic add for increment counter

2025-11-07 Thread Andres Freund
On 2025-11-07 11:52:37 -0300, Ranier Vilela wrote: > Em sex., 7 de nov. de 2025 às 11:41, Andres Freund > escreveu: > > On 2025-11-07 11:28:06 -0300, Ranier Vilela wrote: > > > Use pg_atomic_fetch_add_u64 to replace pg_atomic_read_u64 and > > > pg_atomic_write_u64 calls. > > > > > > This simplifie

Re: Xlogprefetcher: Use atomic add for increment counter

2025-11-07 Thread Ranier Vilela
Em sex., 7 de nov. de 2025 às 11:41, Andres Freund escreveu: > Hi, > > On 2025-11-07 11:28:06 -0300, Ranier Vilela wrote: > > Use pg_atomic_fetch_add_u64 to replace pg_atomic_read_u64 and > > pg_atomic_write_u64 calls. > > > > This simplifies the logic and this increases the likelihood that the >

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

2025-11-07 Thread Marcos Pegoraro
Em sex., 7 de nov. de 2025 às 11:27, Akshay Joshi < [email protected]> escreveu: > I don’t think we need that statement. Could you please elaborate on where > exactly it needs to be added? > well, these pg_get_..._ddl() functions will be cool for compare/clone schemas in a multi tenan

Re: Logical Replication of sequences

2025-11-07 Thread vignesh C
On Fri, 7 Nov 2025 at 14:54, shveta malik wrote: > > On Fri, Nov 7, 2025 at 10:58 AM vignesh C wrote: > > > > > > Thanks for pushing the patch, here is a rebased version of the > > remaining patches. > > > > Please find a few comments on doc patch: > > 1) > +them. To verify this, compare the

Re: Xlogprefetcher: Use atomic add for increment counter

2025-11-07 Thread Andres Freund
Hi, On 2025-11-07 11:28:06 -0300, Ranier Vilela wrote: > Use pg_atomic_fetch_add_u64 to replace pg_atomic_read_u64 and > pg_atomic_write_u64 calls. > > This simplifies the logic and this increases the likelihood that the > operation will be successful. How does it do so? As the assertions indica

Xlogprefetcher: Use atomic add for increment counter

2025-11-07 Thread Ranier Vilela
Hi. Use pg_atomic_fetch_add_u64 to replace pg_atomic_read_u64 and pg_atomic_write_u64 calls. This simplifies the logic and this increases the likelihood that the operation will be successful. patch attached. best regards, Ranier Vilela use-atomic-add-for-increment-counter.patch Description: B

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

2025-11-07 Thread Akshay Joshi
On Fri, Nov 7, 2025 at 6:45 PM Marcos Pegoraro wrote: > Em sex., 7 de nov. de 2025 às 09:21, Akshay Joshi < > [email protected]> escreveu: > >> Attached is the v7 patch, which is ready for review. >> >>> For this functionality to be complete, the >

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

2025-11-07 Thread Álvaro Herrera
One thing I noticed while testing this is that asyncQueueAddEntries() fills the end of a page with a dummy entry, when the next notify doesn't fit. However, this dummy entry contains a very valid TransactionId, which the new freezing code will try to look up and freeze. I think this is somewhat b

Minor refactor of the code in ExecScanExtended()

2025-11-07 Thread cca5507
Hi, The current code:   if (!qual && !projInfo)   { ResetExprContext(econtext); return ExecScanFetch(node, epqstate, accessMtd, recheckMtd);   }   ResetExprContext(econtext); The following format might be simpler:   ResetExprContext(econtext);

Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

2025-11-07 Thread Xuneng Zhou
Hi, On Wed, Oct 15, 2025 at 4:43 PM Xuneng Zhou wrote: > > Hi, > > On Wed, Oct 15, 2025 at 8:31 AM Xuneng Zhou wrote: > > > > Hi, > > > > On Sat, Oct 11, 2025 at 11:02 AM Xuneng Zhou wrote: > > > > > > Hi, > > > > > > The following is the split patch set. There are certain limitations to > > >

Re: Consistently use the XLogRecPtrIsInvalid() macro

2025-11-07 Thread Álvaro Herrera
On 2025-Nov-07, Bertrand Drouvot wrote: > Agree, will modify the .cocci scripts that way. I just noticed that we missed this ... maybe you want to include it also? diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index a0c79958fd5..1f11c8646f5 100644 --- a/src/

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

2025-11-07 Thread Marcos Pegoraro
Em sex., 7 de nov. de 2025 às 09:21, Akshay Joshi < [email protected]> escreveu: > Attached is the v7 patch, which is ready for review. > >> >>> >>> For this functionality to be complete, the ALTER TABLE ... ENABLE ROW LEVEL SECURITY statement needs to be add

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

2025-11-07 Thread Akshay Joshi
Hi Hackers, Make the pretty flag a default parameter by adding CREATE OR REPLACE FUNCTION in system_functions.sql. Attached is the v7 patch, which is ready for review. On Mon, Nov 3, 2025 at 5:17 PM Akshay Joshi wrote: > Hi Hackers, > > Added a new #define GET_DDL_PRETTY_FLAGS because the exist

Re: [PATCH] Add pg_get_subscription_ddl() function

2025-11-07 Thread Álvaro Herrera
On 2025-Nov-07, Vaibhav Dalvi wrote: > On Thu, Nov 6, 2025 at 9:18 PM Álvaro Herrera wrote: > > > Hello Vaibhav, > > > > I wonder why is Subscription->publications a list of String rather than > > a list of C strings. That's something you'd see in a Node structure, > > but Subscription is not a

Re: Extend injection_points_attach() to accept a user-defined function

2025-11-07 Thread Rahila Syed
Hi, Thank you for your review. > > + if (injection_point_local) > + { > + condition.type = INJ_CONDITION_PID; > + condition.pid = MyProcPid; > + } > > Hmm. Is there a point in registering a condition that's linked to > the shared library injection_po

Re: Logical Replication of sequences

2025-11-07 Thread Amit Kapila
On Fri, Nov 7, 2025 at 10:58 AM vignesh C wrote: > > Thanks for pushing the patch, here is a rebased version of the > remaining patches. > Pushed after reverting change related to converting fixed offset to a counter based scheme for view columns. We use the same method (fixed column numbers) in

Re: [PATCH] Add pg_get_subscription_ddl() function

2025-11-07 Thread Vaibhav Dalvi
Hi Alvaro, Thanks for your input. On Thu, Nov 6, 2025 at 9:18 PM Álvaro Herrera wrote: > Hello Vaibhav, > > I wonder why is Subscription->publications a list of String rather than > a list of C strings. That's something you'd see in a Node structure, > but Subscription is not a node, so this s

Re: contrib/pg_stat_tcpinfo

2025-11-07 Thread Jakub Wartak
On Mon, Nov 3, 2025 at 3:09 PM Jakub Wartak wrote: > > Attached is pg_stat_tcpinfo, an heavy work in progress, Linux-only > netstat/ss-like extension for showing detailed information about TCP > connections based on information from the kernel itself. [..] > Some early feedback about direction in

Re: Add tab completion support for WAIT FOR command

2025-11-07 Thread Xuneng Zhou
Hi, On Mon, Sep 29, 2025 at 2:42 PM Xuneng Zhou wrote: > > Hi, > > On Mon, Sep 29, 2025 at 2:37 PM Xuneng Zhou wrote: > > > > Hi hackers, > > > > Thread [1] proposed the WAIT FOR command. This thread presents a > > follow-up patch adding tab completion support, per Jian’s idea. > > > > [1] Imple

Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement

2025-11-07 Thread Álvaro Herrera
On 2025-Nov-05, Nishant Sharma wrote: > Thanks Álvaro for the review comments on v4! > > PFA, v5 patch set. I have included all your review comments. Great, thanks. I think adding the get_tablespace_location_string function in ruleutils.c makes little sense -- I would say it belongs in src/back

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

2025-11-07 Thread Arseniy Mukhin
On Fri, Nov 7, 2025 at 11:10 AM Heikki Linnakangas wrote: > > On 06/11/2025 17:13, Arseniy Mukhin wrote: > > Let's say we have the queue: > > > > (tail ... pos1 ... bad_entry_pos ... head) > > > > bad_entry_pos - position of the entry where TransactionIdDidCommit fails. > > > > We have the listene

Re: Reorganize GUC structs

2025-11-07 Thread Álvaro Herrera
On 2025-Nov-07, Peter Eisentraut wrote: > @@ -3135,14 +3135,14 @@ parse_and_validate_value(const struct config_generic > *record, > char *hintmsg; > > hintmsg = config_enum_get_options(conf, > -

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

2025-11-07 Thread Fujii Masao
On Fri, Nov 7, 2025 at 9:07 AM Chao Li wrote: > If you put this explanation to the inline comment, things would get clearer. > But based on this explanation, I just got the other doubt. When a pipeline is > aborted, res is NULL, but we still stay in the for loop, PQClear(res) will do > nothing,

Re: Logical Replication of sequences

2025-11-07 Thread shveta malik
On Fri, Nov 7, 2025 at 10:58 AM vignesh C wrote: > > > Thanks for pushing the patch, here is a rebased version of the > remaining patches. > Please find a few comments on doc patch: 1) +them. To verify this, compare the +pg_subscription_rel.srsublsn +on the subscriber with the page_l

LTO aggressively optimizing out function despite explicit calls in logical decoding

2025-11-07 Thread Arkady Skvorcov
Hi contributors, I'm working on a logical decoding improvement and running into a persistent build issue where LTO (-flto=thin) is optimizing out my LogicalWaitForWal function, even though there are explicit calls to it. The situation: Function LogicalWaitForWal() is defined in src/backend/repli

Re: Reorganize GUC structs

2025-11-07 Thread Peter Eisentraut
On 03.11.25 12:16, Peter Eisentraut wrote: The remaining patches to sort the list alphabetically have also been pushed. Here are a few more small patches to fix related things I found afterwards or in passing. The first one straightens out how the qsort comparison function for GUC records w

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

2025-11-07 Thread Heikki Linnakangas
On 06/11/2025 17:13, Arseniy Mukhin wrote: Let's say we have the queue: (tail ... pos1 ... bad_entry_pos ... head) bad_entry_pos - position of the entry where TransactionIdDidCommit fails. We have the listener L1 with pos = pos1. It means every new listener should process the queue from pos1 (

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

2025-11-07 Thread Frédéric Yhuel
On 11/5/25 6:44 AM, Michael Paquier wrote: After looking again at the thread, I have decided to credit all three of you as authors of this patch. Frederic has spent what I guess is a lot of time on analyzing this, and then both Sami and Mircea have followed up. This way, nobody should be jea