Re: [PING] fallocate() causes btrfs to never compress postgresql files

2025-12-14 Thread Jakub Wartak
On Mon, Dec 15, 2025 at 7:00 AM Thomas Munro wrote: > > Here's a new version with some cleanup and documentation. I tried to > pare it down to the minimum change for the back-branches, keeping > unnecessary changes for master. In the process, I also thought a bit > about how to de-confused matte

Re: Proposal: Cascade REPLICA IDENTITY changes to leaf partitions

2025-12-14 Thread Chao Li
Hi Amit, Thank you very much for the guidance. > On Dec 13, 2025, at 19:10, Amit Kapila wrote: > > 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 automati

Re: [PATCH] no table rewrite when set column type to constrained domain

2025-12-14 Thread jian he
On Tue, Aug 26, 2025 at 11:26 AM jian he wrote: > > typedef struct NewColumnValue > { > AttrNumberattnum; /* which column */ > Expr *expr;/* expression to compute */ > ExprState *exprstate; /* execution state */ > boolis_genera

Re: PRI?64 vs Visual Studio (2022)

2025-12-14 Thread Tom Lane
Thomas Munro writes: > The reason I thought about a contrived message with lots of macros is > that I'd stumbled across a partial implementation[1] in Alpine's > alternative non-GNU msgfmt program, which appears to have PRIu64 but > not PRIx64 and others. It also has some other way of encoding th

Re: [PATCH] Skip unpublishable child tables when adding parent to publication

2025-12-14 Thread Amit Kapila
On Fri, Dec 12, 2025 at 7:56 PM Arunprasad Rajkumar wrote: > > I would like to propose a patch that improves the handling of table > inheritance > hierarchies when adding tables to publications for logical replication. > > Problem: > Currently, when attempting to add a parent table to a publicati

Re: Get rid of "Section.N.N.N" on DOCs

2025-12-14 Thread Laurenz Albe
On Sun, 2025-12-14 at 14:30 -0300, Marcos Pegoraro wrote: > When reading documentation all the time we get something like > See Section 27.4.5 and Section 27.4.2 for details. > The only way to know what it is that Section is opening and reading its title. > > Wouldn't it be better if we print some

Re: pg_plan_advice

2025-12-14 Thread Ajay Pal
During further testing of the plan_advice patch's latest version, I observed that the following query is generating a no_gather plan. This specific plan structure is not being accepted by the query planner. postgres=*# set local pg_plan_advice.advice='NO_GATHER("*RESULT*")'; SET postgres=*# explai

Re: [PATCH] Allow complex data for GUC extra.

2025-12-14 Thread Bryan Green
On 12/8/2025 10:48 AM, Robert Haas wrote: > On Sat, Dec 6, 2025 at 2:08 AM Bryan Green wrote: >>> I think I'm missing something obvious here. call_string_check_hook >>> doesn't do any memory context management - it just calls the hook. > > No, it does do memory management. It has a PG_TRY()/PG_CA

Re: [PING] fallocate() causes btrfs to never compress postgresql files

2025-12-14 Thread Thomas Munro
Here's a new version with some cleanup and documentation. I tried to pare it down to the minimum change for the back-branches, keeping unnecessary changes for master. In the process, I also thought a bit about how to de-confused matters on Windows, where the function we call as ftruncate() behave

Re: Improve logical replication usability when tables lack primary keys

2025-12-14 Thread Amit Kapila
On Mon, Dec 15, 2025 at 9:06 AM Chao Li wrote: > > > On Dec 15, 2025, at 11:28, Dilip Kumar wrote: > > > > On Tue, Nov 11, 2025 at 6:11 PM Chao Li wrote: > >> > >> Hi Amit, > >> > >> Thanks for asking. > >> > >>> On Nov 11, 2025, at 19:18, Amit Kapila wrote: > >>> > >>> On Mon, Nov 10, 2025 at

Re: Fix memory leak in gist_page_items() of pageinspect

2025-12-14 Thread Chao Li
> On Dec 15, 2025, at 12:08, Michael Paquier wrote: > > (Note that the email > address you have added to the commit message of 0001 did not match > with your actual email address, perhaps you did not intend to do > that..) Hi Michael, Yes, that was intentional. [email protected] is my company

Re: Newly created replication slot may be invalidated by checkpoint

2025-12-14 Thread Amit Kapila
On Thu, Dec 11, 2025 at 12:39 PM Zhijie Hou (Fujitsu) wrote: > > > > > The other idea to fix this problem is suggested by Alexander in his > > email [1] which is to introduce a new ReplicationSlotReserveWALLock > > for this purpose. I think introducing LWLock in back branches could be > > question

Re: Fixes a typo in tablecmd

2025-12-14 Thread David Rowley
On Mon, 15 Dec 2025 at 12:26, Chao Li wrote: > ``` > /* > * If the table at either end of the constraint is partitioned, we need to > * recurse and handle every unvalidate constraint that is a child of this > * constraint. > */ > ``` > So, I believe “unvalidate” is a typo, a “d” should be appende

Re: Add WALRCV_CONNECTING state to walreceiver

2025-12-14 Thread Noah Misch
On Sun, Dec 14, 2025 at 06:17:34PM +0800, Xuneng Zhou wrote: > On Sun, Dec 14, 2025 at 4:55 PM Xuneng Zhou wrote: > > On Sun, Dec 14, 2025 at 1:14 PM Noah Misch wrote: > > > > V2 makes the transition from WALRCV_CONNECTING to STREAMING only when > > > > the first valid WAL record is processed by

Re: Fix memory leak in gist_page_items() of pageinspect

2025-12-14 Thread Michael Paquier
On Sat, Dec 13, 2025 at 10:37:40AM +0800, Chao Li wrote: > So I’ve split the fix into two commits, which I probably should have done > from the beginning. 0001 contains the index_close() fix, and 0002 contains > the StringInfo fix. While passing through, I have applied 0001. (Note that the email

Re: Improve logical replication usability when tables lack primary keys

2025-12-14 Thread Chao Li
> On Dec 15, 2025, at 11:28, Dilip Kumar wrote: > > On Tue, Nov 11, 2025 at 6:11 PM Chao Li wrote: >> >> Hi Amit, >> >> Thanks for asking. >> >>> On Nov 11, 2025, at 19:18, Amit Kapila wrote: >>> >>> On Mon, Nov 10, 2025 at 1:36 PM Chao Li wrote: * BACKGROUND This

Re: Improve logical replication usability when tables lack primary keys

2025-12-14 Thread Dilip Kumar
On Tue, Nov 11, 2025 at 6:11 PM Chao Li wrote: > > Hi Amit, > > Thanks for asking. > > > On Nov 11, 2025, at 19:18, Amit Kapila wrote: > > > > On Mon, Nov 10, 2025 at 1:36 PM Chao Li wrote: > >> > >> * BACKGROUND > >> > >> This requirement comes from several users operating large deployments, >

Re: Add support for specifying tables in pg_createsubscriber.

2025-12-14 Thread Peter Smith
On Wed, Dec 10, 2025 at 10:32 AM Euler Taveira wrote: > > On Sun, Dec 7, 2025, at 11:52 PM, Peter Smith wrote: > > > > OK. Done as suggested in v23. > > > > I took another look at this patch. I noticed that it increased the test time > in > 3 or 4s. I started writing the suggestions to this email

Re: Improve logical replication usability when tables lack primary keys

2025-12-14 Thread Chao Li
> On Nov 11, 2025, at 20:09, Euler Taveira wrote: > > On Mon, Nov 10, 2025, at 5:06 AM, Chao Li wrote: >> I evaluated a few approaches and am proposing the following: >> >> - Introduce a new GUC: `logical_replication_fallback_to_full_identity`. >> - When enabled, if a table being logically re

Re: Fixes a typo in tablecmd

2025-12-14 Thread Xuneng Zhou
Hi Chao, On Mon, Dec 15, 2025 at 7:26 AM Chao Li wrote: > > Hi Hackers, > > I noticed this while working on a patch with tablecmd: > > ``` > /* > * If the table at either end of the constraint is partitioned, we need to > * recurse and handle every unvalidate constraint that is a child of this >

Re: Proposed mid-cycle update of typedefs.list

2025-12-14 Thread Michael Paquier
On Sun, Dec 14, 2025 at 04:38:59PM -0500, Tom Lane wrote: > I'll go deal with these things shortly. Thanks for cleaning up all that! -- Michael signature.asc Description: PGP signature

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

2025-12-14 Thread Michael Paquier
On Sat, Dec 13, 2025 at 06:33:41PM -0600, Sami Imseih wrote: > 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? I'd rather keep the documentation simpler,

Re: DOCS - Clarify the publication 'publish_via_partition_root' default value.

2025-12-14 Thread Peter Smith
On Fri, Dec 12, 2025 at 12:32 PM Chao Li wrote: > > > > > On Dec 12, 2025, at 07:12, Jacob Champion > > wrote: > > > > On Thu, Dec 11, 2025 at 12:22 PM Peter Smith wrote: > >>> Why not just say clearly what the default value is? > >>> > >>> PSA: a patch to do that. > > > > LGTM. (In fact I've r

Fixes a typo in tablecmd

2025-12-14 Thread Chao Li
Hi Hackers, I noticed this while working on a patch with tablecmd: ``` /* * If the table at either end of the constraint is partitioned, we need to * recurse and handle every unvalidate constraint that is a child of this * constraint. */ ``` Here “unvalidate” looks abnormal to me but not an obvi

Re: Trying out read streams in pgvector (an extension)

2025-12-14 Thread Tomas Vondra
On 12/9/25 23:38, Peter Geoghegan wrote: > On Mon, Dec 8, 2025 at 10:47 PM Thomas Munro wrote: >> Yielding just because you've scanned N index pages/tuples/whatever is >> harder to think about. The stream shouldn't get far ahead unless it's >> recently been useful for I/O concurrency (though opti

Re: POC: make mxidoff 64 bits

2025-12-14 Thread Tom Lane
Heikki Linnakangas writes: > Ok, I have pushed this. Thanks! Coverity is unhappy about this bit: /srv/coverity/git/pgsql-git/postgresql/src/bin/pg_upgrade/multixact_read_v18.c: 282 in GetOldMultiXactIdSingleMember() 276 if (!TransactionIdIsValid(*xactptr)) 277

Re: Optimization of partial index creation for a new column

2025-12-14 Thread Tom Lane
Andres Freund writes: > On 2025-12-14 23:13:49 +0300, Александр Асафов wrote: >> I have a feature suggestion to optimize the creation of a partial >> index. In some cases, it is possible to skip a full table scan. For >> example: >> ... >> How complex would a patch with this optimization be? Will

Re: Proposed mid-cycle update of typedefs.list

2025-12-14 Thread Tom Lane
Andres Freund writes: > On 2025-12-14 14:57:48 -0500, Tom Lane wrote: >> The best theory I can come up with is that 1b105f947 et al >> used these names in palloc0_array and similar calls, and that >> somehow looks like a capturable typedef reference ... but how? > That's indeed curious. I wonder

Re: Optimization of partial index creation for a new column

2025-12-14 Thread Andres Freund
Hi, On 2025-12-14 23:13:49 +0300, Александр Асафов wrote: > I have a feature suggestion to optimize the creation of a partial > index. In some cases, it is possible to skip a full table scan. For > example: > > BEGIN; > ALTER TABLE test ADD COLUMN (newcol int); > CREATE INDEX newindex ON test(new

Re: Proposed mid-cycle update of typedefs.list

2025-12-14 Thread Andres Freund
Hi, On 2025-12-14 14:57:48 -0500, Tom Lane wrote: > I happened to notice that the buildfarm's current typedefs list > adds quite a few names that were not previously being captured, > for example > > @@ -48,10 +48,15 @@ AggPath > AggSplit > AggState > AggStatePerAgg > +AggStatePerAggData > Ag

Fixing out-of-range warnings with late-model gcc+UBSAN

2025-12-14 Thread Tom Lane
Buildfarm member thorntail was recently resurrected with a very recent gcc (Debian 15.2.0-9), and since then it's been giving these compiler warnings: In file included from ../../../../src/include/storage/bufmgr.h:21, from ../../../../src/include/access/bufmask.h:21,

Re: psql \dh: List High-Level (Root) Tables and Indexes

2025-12-14 Thread Sadeq Dousti
Hi all, Please find attached version 8 of the patch. Two changes: * Rebased on the latest master * Improved commit message Best regards, Sadeq Dousti v8-0001-psql-Listing-not-partition-tables-and-indexes.patch Description: Binary data

Optimization of partial index creation for a new column

2025-12-14 Thread Александр Асафов
Hello hackers, I have a feature suggestion to optimize the creation of a partial index. In some cases, it is possible to skip a full table scan. For example: BEGIN; ALTER TABLE test ADD COLUMN (newcol int); CREATE INDEX newindex ON test(newcol) WHERE newcol IS NOT NULL; COMMIT; In this case, the

Re: Import Statistics in postgres_fdw before resorting to sampling.

2025-12-14 Thread Corey Huinker
> > Ah, I mean the case where the foreign table is an inheritance parent > on the *local* side. In that case, the return would cause us to skip > the recursive ANALYZE (i.e., do_analyze_rel() with inh=true), leading > to no inherited stats. I agree that the case is minor, but I don't > think that

Proposed mid-cycle update of typedefs.list

2025-12-14 Thread Tom Lane
I happened to notice that the buildfarm's current typedefs list adds quite a few names that were not previously being captured, for example @@ -48,10 +48,15 @@ AggPath AggSplit AggState AggStatePerAgg +AggStatePerAggData AggStatePerGroup +AggStatePerGroupData AggStatePerHash +AggStatePerHashD

Re: Import Statistics in postgres_fdw before resorting to sampling.

2025-12-14 Thread Etsuro Fujita
On Sun, Dec 14, 2025 at 4:12 AM Corey Huinker wrote: > 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% correc

Re: Get rid of "Section.N.N.N" on DOCs

2025-12-14 Thread Isaac Morland
On Sun, 14 Dec 2025 at 12:35, David G. Johnston wrote: > On Sun, Dec 14, 2025 at 10:30 AM Marcos Pegoraro > wrote: > >> There are places where links are mixed, some of them are auto >> explanatory, some don't, like on See Also of VACUUM >> vacuumdb

Re: Get rid of "Section.N.N.N" on DOCs

2025-12-14 Thread David G. Johnston
On Sun, Dec 14, 2025 at 10:30 AM Marcos Pegoraro wrote: > There are places where links are mixed, some of them are auto explanatory, > some don't, like on See Also of VACUUM > vacuumdb , > Section 19.10.2 >

Get rid of "Section.N.N.N" on DOCs

2025-12-14 Thread Marcos Pegoraro
When reading documentation all the time we get something like See Section 27.4.5 and Section 27.4.2 for details. The only w

Re: Make copyObject work in C++

2025-12-14 Thread Jelte Fennema-Nio
On Mon Dec 8, 2025 at 9:11 AM CET, Jelte Fennema-Nio wrote: Went with defining pg_exprtype (pg_typeof already exists). Undefining typeof seemed a bit heavy-handed. Especially since I think it would be nice to backport this so C++ extensions can use copyObject directly. Rebased version of this p

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-12-14 Thread Mihail Nikalayeu
Hello, Andres! On Sun, Dec 14, 2025 at 4:19 PM Andres Freund wrote: > There are a *lot* of these right now. CI on master currently has a failure > rate of 14 failures / 50 runs on the postgres/postgres repo. All of the > failures are due to this issue from what I can tell. That means there are

Re: Proposal: Conflict log history table for Logical Replication

2025-12-14 Thread Dilip Kumar
On Fri, Dec 12, 2025 at 3:33 PM shveta malik wrote: > > > Few comments for v11: > > 1) > +#include "executor/spi.h" > +#include "replication/conflict.h" > +#include "utils/fmgroids.h" > +#include "utils/regproc.h" > > subscriptioncmds.c compiles without the above inclusions. I think we need utils

Re: [Proposal] Adding Log File Capability to pg_createsubscriber

2025-12-14 Thread Gyan Sreejith
I have included the patch file after making the changes to the SGML docs. Thanks for your help, Gyan Sreejith On Thu, Dec 11, 2025 at 8:33 PM Gyan Sreejith wrote: > Thanks for the feedback, Peter. > > I am currently working on the SGML docs update, and will promptly get back > with an update. >

Re: [PATCH] Add pg_lfind8_nonzero()

2025-12-14 Thread Andres Freund
Hi, On 2025-12-14 21:33:00 +0800, cca5507 wrote: > Hi hackers, > > I'd like to add pg_lfind8_nonzero() to optimize some code like this: > > ``` > for (i = 0; i < numberOfAttributes; i++) > { > if (isnull[i]) > { > hasnull = true; >

Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

2025-12-14 Thread Andres Freund
Hi, On 2025-12-11 22:36:55 +0100, Álvaro Herrera wrote: > I just saw a failure in CI for an unrelated patch, There are a *lot* of these right now. CI on master currently has a failure rate of 14 failures / 50 runs on the postgres/postgres repo. All of the failures are due to this issue from what

Don't use the deprecated and insecure PQcancel in our frontend tools anymore

2025-12-14 Thread Jelte Fennema-Nio
A bunch of frontend tools, including psql, still used PQcancel to send cancel requests to the server. That function is insecure, because it does not use encryption to send the cancel request. This starts using the new cancellation APIs (introduced in 61461a300) for all these frontend tools. These

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-12-14 Thread Alexander Korotkov
On Sun, Dec 14, 2025 at 4:06 PM zengman wrote: > > Looks great! Thanks for your hard work – that’s all I’ve noticed for now. Pushed, thank you! -- Regards, Alexander Korotkov Supabase

Re: access numeric data in module

2025-12-14 Thread Ed Behn
Good morning- I'm wondering what the status of this patch is. ( https://commitfest.postgresql.org/patch/5623/) I am, of course, eager to be able to move forward with work on my side that requires it and would love to see it approved. If there are still any concerns, please let me know and I

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-12-14 Thread zengman
Looks great! Thanks for your hard work ?C that??s all I??ve noticed for now. Regards, Man Zeng

Re: Proposal to allow setting cursor options on Portals

2025-12-14 Thread Jelte Fennema-Nio
On Sun, 14 Dec 2025 at 14:49, Dave Cramer wrote: > Here I was thinking that binary was the one that did make sense. The pgjdbc > driver would like the results back in binary, I believe others would as well. I agree drivers would like binary results back, but it's unclear to me how CURSOR_OPT_BIN

Re: Proposal to allow setting cursor options on Portals

2025-12-14 Thread Dave Cramer
On Sun, 14 Dec 2025 at 08:42, Jelte Fennema-Nio wrote: > On Sun, 14 Dec 2025 at 13:31, Dave Cramer wrote: > >> Exactly. Don't you want to make sure that clients in the ecosystem are > >> able to use this _before_ we rev the version again, and again? We > >> don't ever get these numbers back. > >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-12-14 Thread Alexander Korotkov
Hi Man, On Sun, Dec 14, 2025 at 2:51 PM zengman wrote: > I just noticed two relatively large commits. I recall that not long ago we > started attempting to adopt `palloc_object` and `palloc_array` in many places, > yet in these two commits, some sections have used the new approach while > other

Re: Proposal to allow setting cursor options on Portals

2025-12-14 Thread Jelte Fennema-Nio
On Sun, 14 Dec 2025 at 13:31, Dave Cramer wrote: >> Exactly. Don't you want to make sure that clients in the ecosystem are >> able to use this _before_ we rev the version again, and again? We >> don't ever get these numbers back. > > Well there are 97 of them. 1 per year is a long time. I don't t

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-12-14 Thread Alexander Korotkov
Hi Man, On Sun, Dec 14, 2025 at 2:51 PM zengman wrote: > I just noticed two relatively large commits. I recall that not long ago we > started attempting to adopt `palloc_object` and `palloc_array` in many places, > yet in these two commits, some sections have used the new approach while > other

[PATCH] Add pg_lfind8_nonzero()

2025-12-14 Thread cca5507
Hi hackers, I'd like to add pg_lfind8_nonzero() to optimize some code like this: ``` for (i = 0; i < numberOfAttributes; i++) { if (isnull[i]) { hasnull = true; break; } } ```

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-12-14 Thread zengman
Hi everyone, I just noticed two relatively large commits. I recall that not long ago we started attempting to adopt `palloc_object` and `palloc_array` in many places, yet in these two commits, some sections have used the new approach while others have not. Perhaps we could standardize the codi

Re: Proposal to allow setting cursor options on Portals

2025-12-14 Thread Dave Cramer
On Thu, 11 Dec 2025 at 14:21, Jacob Champion < [email protected]> wrote: > [I considered splitting this off into a new thread, but I think Dave > has to wait for it to be resolved before much can happen with the > patch. Sorry Dave.] > No worries, I expected discussion. > > On Wed,

Re: Proposal to allow setting cursor options on Portals

2025-12-14 Thread Dave Cramer
On Wed, 10 Dec 2025 at 12:41, Jacob Champion < [email protected]> wrote: > On Mon, Dec 8, 2025 at 1:43 PM Jelte Fennema-Nio > wrote: > > 1. We still have fairly limited experience with protocol options, so > > afaik not everyone agrees what we should use a version bump for vs a > >

Re: Make PGOAUTHCAFILE in libpq-oauth work out of debug mode

2025-12-14 Thread Jonathan Gonzalez V.
Hi! > > I'm not sure if we have prior art for expressing bitflags in Postgres > envvars, other than maybe PGREQUIREAUTH. A comma-separated list would > be easy to do. We could name these things according to whether > they're > unsafe or not, like > >     PGOAUTHDEBUG=UNSAFE-http,UNSAFE-trace,p

Re: Make PGOAUTHCAFILE in libpq-oauth work out of debug mode

2025-12-14 Thread Jonathan Gonzalez V.
Hi! Sorry for the delayed answer! > > Okay, that's good to know. But I'm still missing how the end user (a > human) trusts that magic CA within the browser or device they use to > finish the actual flow? More than the end user "trusting" a "magic" CA, it's about what company will tell you to us

Re: Proposal: Conflict log history table for Logical Replication

2025-12-14 Thread Dilip Kumar
On Fri, Dec 12, 2025 at 3:04 PM Amit Kapila wrote: > > On Thu, Dec 11, 2025 at 7:49 PM Dilip Kumar wrote: > > > > I was considering the interdependence between the subscription and the > > conflict log table (CLT). IMHO, it would be logical to establish the > > subscription as dependent on the CL

Re: Add WALRCV_CONNECTING state to walreceiver

2025-12-14 Thread Xuneng Zhou
Hi, On Sun, Dec 14, 2025 at 4:55 PM Xuneng Zhou wrote: > > Hi, > > On Sun, Dec 14, 2025 at 1:14 PM Noah Misch wrote: > > > > 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

Re: Add WALRCV_CONNECTING state to walreceiver

2025-12-14 Thread Xuneng Zhou
Hi, On Sun, Dec 14, 2025 at 1:14 PM Noah Misch wrote: > > 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: > > >