Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE

2025-12-13 Thread Pavel Stehule
Hi ne 14. 12. 2025 v 8:26 odesílatel Michael Paquier napsal: > On Wed, Oct 15, 2025 at 02:48:43AM +, Aya Iwata (Fujitsu) wrote: > > Thank you for your comments. I updated this patch to v0007. > > + * Exit the bgworker when its database is dropped, renamed, moved to a > + * different tablespa

Re: Add WALRCV_CONNECTING state to walreceiver

2025-12-13 Thread Noah Misch
On Sun, Dec 14, 2025 at 12:45:46PM +0800, Xuneng Zhou wrote: > On Fri, Dec 12, 2025 at 9:52 PM Xuneng Zhou wrote: > > On Fri, Dec 12, 2025 at 4:45 PM Xuneng Zhou wrote: > > > On Fri, Dec 12, 2025 at 1:05 PM Noah Misch wrote: > > > > Waiting for applyPtr to advance > > > > would avoid the short-l

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

2025-12-13 Thread Thomas Munro
On Sat, Dec 13, 2025 at 7:33 PM Tom Lane wrote: > > Bryan Green writes: > > I removed the useless snprintf() call that was using GetCommandLine(). > > That was left in place when I moved to GetModuleFileName(). Also, > > removed the unused 'space_pos' variable and the unneeded scope block. > > A

Re: Add WALRCV_CONNECTING state to walreceiver

2025-12-13 Thread Xuneng Zhou
Hi, On Fri, Dec 12, 2025 at 9:52 PM Xuneng Zhou wrote: > > Hi, > > On Fri, Dec 12, 2025 at 4:45 PM Xuneng Zhou wrote: > > > > Hi Noah, > > > > On Fri, Dec 12, 2025 at 1:05 PM Noah Misch wrote: > > > > > > On Fri, Dec 12, 2025 at 12:51:00PM +0800, Xuneng Zhou wrote: > > > > Bug #19093 [1] report

Re: Fix documentation from recent test_custom_stats commit

2025-12-13 Thread Michael Paquier
On Sat, Dec 13, 2025 at 07:50:16PM -0600, Sami Imseih wrote: > 31280d96a6 updated the wrong section of the documentation to > reference the new test_custom_stats module. The reference should > have been under "Custom Cumulative Statistics" section instead of > the "Injection Points" section. > >

Re: [Proposal] Adding callback support for custom statistics kinds

2025-12-13 Thread Sami Imseih
> I just remembered that we should document the new callbacks in [0] with a > brief explanation of their purpose and a reference to test_custom_stats > as an example of usage. What do you think? oh, and I also realized that the documentation was updated incorrectly when test_custom_stats was origi

Fix documentation from recent test_custom_stats commit

2025-12-13 Thread Sami Imseih
31280d96a6 updated the wrong section of the documentation to reference the new test_custom_stats module. The reference should have been under "Custom Cumulative Statistics" section instead of the "Injection Points" section. Attached is the fix. -- Sami Imseih Amazon Web Services (AWS) v1-0001-

Re: [Proposal] Adding callback support for custom statistics kinds

2025-12-13 Thread Sami Imseih
I just remembered that we should document the new callbacks in [0] with a brief explanation of their purpose and a reference to test_custom_stats as an example of usage. What do you think? [0] https://www.postgresql.org/docs/current/xfunc-c.html#XFUNC-ADDIN-CUSTOM-CUMULATIVE-STATISTICS -- Sami I

Re: Remove header lock BufferGetLSNAtomic() on architectures with 64 bit atomic operations

2025-12-13 Thread Peter Geoghegan
On Sun, Nov 23, 2025 at 6:10 PM Andreas Karlsson wrote: > Andres pointed out this possible optimization on Discord so I hacked up > a quick patch which avoids taking a lock when reading the LSN from a > page on architectures where we can be sure to not get a torn value. It > is always nice to remo

Re: Small patch to improve safety of utf8_to_unicode().

2025-12-13 Thread Chao Li
> On Dec 13, 2025, at 07:24, Jeff Davis wrote: > > Attached. > > > This patch adds a length check to utf8_to_unicode(), I think which is where “safety” comes from. Can you please add an a little bit more to the commit message instead of only saying “improve safety”. It also deleted two

Re: Making jsonb_agg() faster

2025-12-13 Thread Tom Lane
I wrote: > Alexander Lakhin writes: >> I and SQLsmith have discovered that the following query: >> select jsonb_object_agg_unique_strict(i, null) over (order by i) from >>   (select i from generate_series(1, 20) g(i)); >> triggers SIGSEGV: > Thanks for the report! It seems to be specific

Re: SQL Property Graph Queries (SQL/PGQ)

2025-12-13 Thread Peter Eisentraut
On 09.12.25 11:21, Ashutosh Bapat wrote: It looks like undirected matching -[ ]- (without arrows) doesn't work correctly. It seems to just match in one direction. I don't see any tests. Is this implemented? -[]- is called full edge any direction ::= ~[]~ is defined as full edge undirect

Re: Adding REPACK [concurrently]

2025-12-13 Thread Antonin Houska
Mihail Nikalayeu wrote: > On Tue, Dec 9, 2025 at 7:52 PM Antonin Houska wrote: > > Worker makes more sense to me - the initial implementation is in 0005. > > Comments for 0005, so far: Thanks! > --- > > export_initial_snapshot > > Hm, should we use ExportSnapshot instead? And ImportSnapshort

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

2025-12-13 Thread Naga Appani
Thank you, Ashutosh! On Sun, Dec 7, 2025 at 10:40 PM Ashutosh Bapat wrote: > The patch at [1] changes the function used to fetch mxid related > information. With that we will get rid of awkwardness around > non-availability of the statistics. It's better to wait for those > changes to get committ

Re: [PATCH] Add zstd compression for TOAST using extended header format

2025-12-13 Thread Dharin Shah
Hello, Apologies for the spam, updated the patch with the tests corrected. Thanks, Dharin On Sat, Dec 13, 2025 at 6:31 PM Dharin Shah wrote: > Hello PG Hackers, > > Want to submit a patch that implements zstd compression for TOAST data > using a 20-byte TOAST pointer format, directly addressin

Re: Type assertions without GCC builtins

2025-12-13 Thread Peter Eisentraut
On 19.11.25 19:44, Peter Eisentraut wrote: Yeah, I had been playing with a similar patch, which now also crashes on CI, but I'm pretty sure this worked at some point.  So maybe an upgrade or downgrade would fix it. Note however that similar to the comment I made over about stdatomic.h, we cur

Re: Import Statistics in postgres_fdw before resorting to sampling.

2025-12-13 Thread Corey Huinker
On Fri, Dec 12, 2025 at 2:45 PM Corey Huinker wrote: > CCing Jonathan Katz and Nathan Bossart as they had been sounding boards > for me when I started designing this feature. > > >> Returning in the FDW_IMPORT_STATS_OK case isn't 100% correct; if the >> foreign table is an inheritance parent, we

Re: Adding REPACK [concurrently]

2025-12-13 Thread Mihail Nikalayeu
Hello, Antonin! On Sat, Dec 13, 2025 at 7:48 PM Antonin Houska wrote: > Attached here is a new version of the patch set. Its rebased and extended one > more time: 0006 is a PoC of the "snapshot resetting" technique, as discussed > elsewhere with Mihail Nikalayeu and Matthias van de Meent. The way

Re: Adding REPACK [concurrently]

2025-12-13 Thread Mihail Nikalayeu
Once it was sent, I realized MVCC-safe fails with 007_repack_concurrently.pl with TRANSACTION ISOLATION LEVEL REPEATABLE READ uncommented. Don't know why it fails - but happy it fails :) On Sat, Dec 13, 2025 at 7:45 PM Mihail Nikalayeu wrote: > > Hello, everyone. > > Stress tests for REPACK conc

Re: Adding REPACK [concurrently]

2025-12-13 Thread Mihail Nikalayeu
Hello, everyone. Stress tests for REPACK concurrently in attachment. So far I can't break anything (except MVCC of course). A rebased version of the MVCC-safe "light" version with its own stress test is attached also. Best regards, Mikhail. From 457235c743a2dec2c1917fbdfa7f5a48d305c63e Mon Sep 1

Re: failed NUMA pages inquiry status: Operation not permitted

2025-12-13 Thread Christoph Berg
Re: Tomas Vondra > Hmmm, strange. -2 is ENOENT, which should mean this: > >-ENOENT > The page is not present. > > But what does "not present" mean in this context? And why would that be > only intermittent? Presumably this is still running in Docker, so maybe > it's another

[PATCH] Add zstd compression for TOAST using extended header format

2025-12-13 Thread Dharin Shah
Hello PG Hackers, Want to submit a patch that implements zstd compression for TOAST data using a 20-byte TOAST pointer format, directly addressing the concerns raised in prior discussions [1

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-12-13 Thread Mihail Nikalayeu
Hello, Álvaro! On Fri, Dec 12, 2025 at 11:17 AM Álvaro Herrera wrote: > Another idea might be to rewrite these tests using BackgroundPsql under > the TAP infrastructure. That's quite a bit more tedious to write, but > we can be more precise on detecting whether some particular error > message w

Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-13 Thread Nathan Bossart
On Sat, Dec 13, 2025 at 08:21:58AM -0600, Sami Imseih wrote: > I was just using an Assert in v6 to test the pointer value, which is > not what we want for testing. Better to have a error with proper logging. > I fixed that in v7. LGTM at a glance. I didn't see a cfest entry for this one. Can you

Re: Fix out-of-date comment on makeRangeConstructors

2025-12-13 Thread Peter Eisentraut
On 05.12.25 03:26, Chao Li wrote: On Dec 5, 2025, at 06:34, Paul A Jungwirth wrote: I noticed that makeRangeConstructors (in commands/typecmds.c) says: We actually define 4 functions, with 0 through 3 arguments. But that hasn't been true since 2011 (df73584431). We only have 2-arg and 3-arg

Re: Making jsonb_agg() faster

2025-12-13 Thread Tom Lane
Alexander Lakhin writes: > I and SQLsmith have discovered that the following query: > select jsonb_object_agg_unique_strict(i, null) over (order by i) from >   (select i from generate_series(1, 20) g(i)); > triggers SIGSEGV: Thanks for the report! It seems to be specific to use as a wi

Re: Clarify temporal FK comments

2025-12-13 Thread Peter Eisentraut
On 05.12.25 00:11, Paul A Jungwirth wrote: In RI_ConstraintInfo, a couple new fields say they are operators for anyrange, but technically they could be for anymultirange instead. Here is a patch to fix that. (It's too bad that pgindent wants to break the lines here.) committed

Re: Proposal: Add a callback data parameter to GetNamedDSMSegment

2025-12-13 Thread Sami Imseih
> This is better than what I had earlier where I was testing that a string > was passed correctly. See v6. I was just using an Assert in v6 to test the pointer value, which is not what we want for testing. Better to have a error with proper logging. I fixed that in v7. -- Sami Imseih Amazon Web S

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

2025-12-13 Thread Peter Eisentraut
On 20.11.25 18:19, Melanie Plageman wrote: + prstate->deadoffsets = (OffsetNumber *) presult->deadoffsets; In your patch v22-0001-Split-heap_page_prune_and_freeze-into-helpers.patch, the assignment above casts away the const qualification of the function argument presult: +static voi

Re: Support named (destination) portals in extended proto for psql meta commands.

2025-12-13 Thread Sami Imseih
Hi, Thanks for raising this! > I am a big fan of psql extended proto meta commands feature [0], and I > frequently use these psql commands for testing purposes while > developing [1] & [2]. +1 > Recently I had to support and test some more named portals (cursor) > use-cases for [1]. And I faced

[PATCH] Expose global backup status and last backup start LSN

2025-12-13 Thread Sujan
Hi Developers, I am submitting a patch that introduces a new function, XLogBackupStatus(XLogRecPtr *lastBackupStart), to the core PostgreSQL codebase. This function allows extensions to reliably determine if a base backup is currently in progress (across all sessions), and to retrieve the LSN

Re: Proposal: Cascade REPLICA IDENTITY changes to leaf partitions

2025-12-13 Thread Amit Kapila
On Fri, Dec 12, 2025 at 9:28 AM Chao Li wrote: > > Hi Amit, > > Thanks for pointing out that my assumption of “RI of parent is not used” is > not always true. > > I agree that automatic-cascade will introduce a lot of complexities. To > ensure the backward-compatibility, how about to extend the

Re: Making jsonb_agg() faster

2025-12-13 Thread Alexander Lakhin
Hello Tom, 07.12.2025 18:58, Tom Lane wrote: That’s even better than resolving my comment. Cool, done like that then. I and SQLsmith have discovered that the following query: select jsonb_object_agg_unique_strict(i, null) over (order by i) from   (select i from generate_series(1, 20)

Re: Support named (destination) portals in extended proto for psql meta commands.

2025-12-13 Thread Jelte Fennema-Nio
On Sat, 13 Dec 2025 at 09:56, Kirill Reshke wrote: > And I faced a problem, that there is no way to test > extended query bind commands for non-empty destination portal. So, I > propose to add a psql meta command just for that purpose. Something > like \bind_cursor CURSOR_NAME STMT_NAME [params..]

Re: Remaining dependency on setlocale()

2025-12-13 Thread Chao Li
> On Dec 13, 2025, at 04:11, Jeff Davis wrote: > > I believe v12 0001-0005 are about ready for commit, and 0003 should be > backported. I quickly went through 0001-0005, and got a few nitpicks: 1 - 0001 ``` + int match_mblen pg_attribute_unused(); ``` Why this vari

Re: [PATCH] Better Performance for PostgreSQL with large INSERTs

2025-12-13 Thread Philipp Marek
Hi Jakub, Can you please how have you verified it is giving you that some perf. increase? ... where insert.sql was: echo "CREATE TEMPORARY TABLE IF NOT EXISTS file_storage (data BYTEA STORAGE EXTERNAL) ON COMMIT PRESERVE ROWS;" > insert.sql echo "INSERT INTO file_storage(data) VALUES (

Support named (destination) portals in extended proto for psql meta commands.

2025-12-13 Thread Kirill Reshke
I am a big fan of psql extended proto meta commands feature [0], and I frequently use these psql commands for testing purposes while developing [1] & [2]. Recently I had to support and test some more named portals (cursor) use-cases for [1]. And I faced a problem, that there is no way to test exten