Re: sync_standbys_defined read/write race on startup

2025-04-10 Thread Maksim.Melnikov
On 10.04.2025 05:25, Michael Paquier wrote: Confirmed. One thing where it would be possible to make things work is to introduce some persistency of the injection points, say these are flushed at shutdown. We could do that without touching at the backend code and only in the module injection_p

Re: Add .DS_Store to .gitignore

2025-04-10 Thread Dianjin Wang
Hi David, thanks for the tip! Best, Dianjin Wang On Thu, Apr 10, 2025 at 2:10 PM David Rowley wrote: > > On Thu, 10 Apr 2025 at 18:05, Dianjin Wang wrote: > > Here is a patch to add the `.DS_Store` to the .gitignore to ignore the > > `.DS_Store` file tracking by git when doing some development

Re: Cannot find a working 64-bit integer type on Illumos

2025-04-10 Thread Thomas Munro
On Wed, Mar 26, 2025 at 12:36 PM Tom Lane wrote: > Daniel Gustafsson writes: > >> On 26 Mar 2025, at 00:01, Tom Lane wrote: > >> How did that work before? Perhaps somebody just now added a libpq > >> dependency to pg_regress.c? > > > I believe the libpq dependency came in 66d6086cbcbfc8 which w

Re: long-standing data loss bug in initial sync of logical replication

2025-04-10 Thread Tomas Vondra
On 4/10/25 11:45, Amit Kapila wrote: > On Tue, Apr 8, 2025 at 3:40 PM Amit Kapila wrote: >> >> On Tue, Mar 18, 2025 at 3:25 PM Amit Kapila wrote: >>> >>> Sawada-San, and others involved here, do you have any suggestions on >>> this matter? >>> >> >> Seeing no responses for a long time, I am plann

Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c

2025-04-10 Thread Peter Eisentraut
On 09.04.25 16:23, Tom Lane wrote: Heikki Linnakangas writes: Inconsistency is not good either though. I'm not sure it's worth the churn, but I could get on board a patch to actually replace all HeapTupleIsValid(tuple) calls with plain "tuple != NULL" checks. Keep HeapTupleIsValid() just for co

Re: Correct documentation for protocol version

2025-04-10 Thread Dave Cramer
On Thu, 10 Apr 2025 at 09:54, Fujii Masao wrote: > > > On 2025/04/10 18:52, Dave Cramer wrote: > > Greetings, > > > > The current docs say that if a client asks for a protocol that the > backend doesn't support, it will return the newest minor version. > https://www.postgresql.org/docs/current/pr

Re: pgsql: Add function to get memory context stats for processes

2025-04-10 Thread Robert Haas
On Tue, Apr 8, 2025 at 5:10 AM Daniel Gustafsson wrote: > Add function to get memory context stats for processes Apologies if this has already been discussed, but what is the argument that it is safe to do everything in ProcessGetMemoryContextInterrupt() at an arbitrary CHECK_FOR_INTERRUPTS() cal

Re: tab complete for COPY populated materialized view TO

2025-04-10 Thread Fujii Masao
On 2025/04/09 19:24, Kirill Reshke wrote: On Wed, 9 Apr 2025 at 14:45, Fujii Masao wrote: On 2025/04/09 18:25, Kirill Reshke wrote: On Wed, 9 Apr 2025 at 13:23, jian he wrote: hi. we allow the "COPY table TO" command to copy rows from materialized views in [1]. The attached patch is t

Re: Correct documentation for protocol version

2025-04-10 Thread Fujii Masao
On 2025/04/10 23:40, Dave Cramer wrote: On Thu, 10 Apr 2025 at 09:54, Fujii Masao mailto:masao.fu...@oss.nttdata.com>> wrote: On 2025/04/10 18:52, Dave Cramer wrote: > Greetings, > > The current docs say that if a client asks for a protocol that the backend doesn't supp

Re: Capturing both IP address and hostname in the log

2025-04-10 Thread Tom Lane
[ moving to -hackers ] Adrian Klaver writes: > On 4/10/25 05:22, Tefft, Michael J wrote: >> We have set log_hostname ON and we get hostname reported – but we do not >> get IP address. We would like to capture both. >> Is there a way to capture both IP address and hostname in the log >> messages

Re: Correct documentation for protocol version

2025-04-10 Thread Jacob Champion
On Thu, Apr 10, 2025 at 7:41 AM Dave Cramer wrote: > Done in new patch attached I think this patch splices a sentence: > + not equal to the version the server supports. > message. +1 for clarifying the message description; it has vaguely bothered me for a while [1]. :) --Jaco

Re: Add missing PGDLLIMPORT markings

2025-04-10 Thread Robert Haas
On Wed, Apr 9, 2025 at 1:10 PM Andres Freund wrote: > I think eventually we ought to change the default visibility in the main > binary to hidden, just like we do for extensions. Then the windows/everything > else behavior difference vanishes and we actually get the benefit of being > more rest

Re: Correct documentation for protocol version

2025-04-10 Thread Dave Cramer
On Thu, 10 Apr 2025 at 11:17, Fujii Masao wrote: > > > On 2025/04/10 23:40, Dave Cramer wrote: > > > > On Thu, 10 Apr 2025 at 09:54, Fujii Masao > wrote: > > > > > > > > On 2025/04/10 18:52, Dave Cramer wrote: > > > Greetings, > > > > > > Th

Re: Proposal: Limitations of palloc inside checkpointer

2025-04-10 Thread Xuneng Zhou
Hi, I’ve updated and rebased Maxim's patch version 4 with optimizations like ring buffer and capped max_requests proposed by Heikki. These are the summary of Changes in v5: • Replaced the linear array model in AbsorbSyncRequests() with a bounded ring buffer to avoid large memmove() operations wh

Re: as per commit 643a1a61985bef2590496, move create/open dir code to function using switch case of pg_backup_directory.c file also

2025-04-10 Thread Andrew Dunstan
On 2025-04-07 Mo 2:59 PM, Mahendra Singh Thalor wrote: On Mon, 7 Apr 2025 at 18:52, Andrew Dunstan wrote: On 2025-04-07 Mo 8:25 AM, Mahendra Singh Thalor wrote: Hi, In commit 643a1a61985bef2590496, we did some cleanup and we replaced if-else with switch case. Basically, we made a function t

Re: Correct documentation for protocol version

2025-04-10 Thread Fujii Masao
On 2025/04/11 0:49, Dave Cramer wrote: On Thu, 10 Apr 2025 at 11:17, Fujii Masao mailto:masao.fu...@oss.nttdata.com>> wrote: On 2025/04/10 23:40, Dave Cramer wrote: > > On Thu, 10 Apr 2025 at 09:54, Fujii Masao mailto:masao.fu...@oss.nttdata.com>

Re: Add pg_buffercache_evict_all() and pg_buffercache_mark_dirty[_all]() functions

2025-04-10 Thread Bertrand Drouvot
Hi, On Tue, Apr 08, 2025 at 02:40:52AM -0400, Andres Freund wrote: > I think it's ok for now. It might be worth doing a larger redesign of the > pgbuffercache docs at some point... > > > Pushed. > > > Thanks for your patches and thanks for all the reviewers getting this ready! Thanks for the

Re: Correct documentation for protocol version

2025-04-10 Thread Fujii Masao
On 2025/04/10 18:52, Dave Cramer wrote: Greetings, The current docs say that if a client asks for a protocol that the backend doesn't support, it will return the newest minor version. https://www.postgresql.org/docs/current/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-NEGOTIATEPRO

Re: PostgreSQL 18 Release Management Team & Feature Freeze

2025-04-10 Thread Nathan Bossart
On Thu, Apr 10, 2025 at 03:11:00PM +0300, Heikki Linnakangas wrote: > On 10/04/2025 14:57, Aleksander Alekseev wrote: >> Do you think that it's worth merging SLRU refactoring into PG18, or is >> it considered a feature? [1] This is arguably not the top priority and >> we could wait for another year

Add os_page_num to pg_buffercache

2025-04-10 Thread Bertrand Drouvot
Hi hackers, I was doing some more tests around ba2a3c2302f (pg_buffercache_numa) and thought that seeing how buffers are spread across multiple OS pages (if that's the case) thanks to the os_page_num field is good information to have. The thing that I think is annoying is that to get this informa

Re: speedup COPY TO for partitioned table.

2025-04-10 Thread Kirill Reshke
On Thu, 10 Apr 2025 at 07:45, jian he wrote: > > hi. > > rebase and simplify regress tests. HI! You used CREATE TABLE PARTITION OF syntax for the second level of partitioning scheme, but not for the first level. Is there any reason? Also about column names. how about +CREATE TABLE pp (year int,

Re: n_ins_since_vacuum stats for aborted transactions

2025-04-10 Thread Sami Imseih
I created an entry for the July CF https://commitfest.postgresql.org/patch/5691/ ... and I realized I forgot to include David's code comment patch yesterday, Reattaching both patches. -- Sami Imseih Amazon Web Services (AWS) v1-0001-Add-code-comment-for-ins_since_vacuum.patch Description: Bina

Re: Improve a few appendStringInfo calls new to v18

2025-04-10 Thread Nathan Bossart
On Thu, Apr 10, 2025 at 11:24:36AM +0300, Heikki Linnakangas wrote: > On 10/04/2025 06:51, David Rowley wrote: >> Any objections to doing this soonish? Or in a few weeks? > > Sure, let's do it. Why would we wait? +1. You did something similar for v17 (commit 8461424), and it seems like an entire

Re: Add os_page_num to pg_buffercache

2025-04-10 Thread Nathan Bossart
On Thu, Apr 10, 2025 at 03:35:24PM +0200, Tomas Vondra wrote: > This seems like a good idea in principle, but at this point it has to > wait for PG19. Please add it to the July commitfest. +1. From a glance, this seems to fall in the "new feature" bucket and should likely wait for v19. -- natha

Re: Add missing PGDLLIMPORT markings

2025-04-10 Thread Tom Lane
Robert Haas writes: > The issue we're going to run into is that a lot of extension authors > like to call things that the core developers probably think they > shouldn't. If we lock it down, we'll either be breaking a bunch of > extensions that are doing sneaky things that somebody has managed to

Re: Capturing both IP address and hostname in the log

2025-04-10 Thread David G. Johnston
On Thu, Apr 10, 2025 at 9:00 AM Tom Lane wrote: > [ moving to -hackers ] > > Adrian Klaver writes: > > On 4/10/25 05:22, Tefft, Michael J wrote: > >> We have set log_hostname ON and we get hostname reported – but we do > not > >> get IP address. We would like to capture both. > >> Is there a way

Re: sync_standbys_defined read/write race on startup

2025-04-10 Thread Michael Paquier
On Thu, Apr 10, 2025 at 10:12:34AM +0300, Maksim.Melnikov wrote: > but I am afraid we are loosing this. > >if (WalSndCtl->sync_standbys_status & SYNC_STANDBY_INIT) >{ > if ((WalSndCtl->sync_standbys_status & SYNC_STANDBY_DEFINED) == 0 || > lsn <= WalSndCtl->lsn[mode]) >

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-04-10 Thread Amit Kapila
On Thu, Apr 10, 2025 at 5:22 AM Peter Smith wrote: > > OK. Here is a single patch which combines previous patches 0001 and 0003. > Pushed. -- With Regards, Amit Kapila.

Re: long-standing data loss bug in initial sync of logical replication

2025-04-10 Thread Amit Kapila
On Tue, Apr 8, 2025 at 3:40 PM Amit Kapila wrote: > > On Tue, Mar 18, 2025 at 3:25 PM Amit Kapila wrote: > > > > Sawada-San, and others involved here, do you have any suggestions on > > this matter? > > > > Seeing no responses for a long time, I am planning to push the fix > till 14 tomorrow unle

Re: wrong comments in rewriteTargetListIU

2025-04-10 Thread Amit Langote
Hi, On Thu, Apr 10, 2025 at 5:58 PM jian he wrote: > > hi. > > in function, rewriteTargetListIU > we have: > > for (attrno = 1; attrno <= numattrs; attrno++) > { > /* > * Can only insert DEFAULT into generated columns, regardless of > * any OVERRIDING clauses

Re: sync_standbys_defined read/write race on startup

2025-04-10 Thread Maksim.Melnikov
On 10.04.2025 12:15, Michael Paquier wrote: Hmm, yeah. Instead of last, it would be better to put it in second place perhaps, for clarity? That would be the same at the end, but we would be slightly more consistent with the past logic regarding the ordering. Does that look OK to you? Yes, f

Re: [PoC] Reducing planning time when tables have many partitions

2025-04-10 Thread Amit Langote
On Thu, Apr 10, 2025 at 2:35 PM David Rowley wrote: > On Thu, 10 Apr 2025 at 16:57, Amit Langote wrote: > > > > On Thu, Apr 10, 2025 at 12:03 PM David Rowley wrote: > > > -Most operations on EquivalenceClasses should ignore child members. > > > +Most operations on EquivalenceClasses needn't look

Re: Memoize ANTI and SEMI JOIN inner

2025-04-10 Thread Richard Guo
On Wed, Apr 9, 2025 at 6:18 PM David Rowley wrote: > On Wed, 9 Apr 2025 at 18:48, Richard Guo wrote: > > Perhaps we could spend some planner cycles proving inner_unique for > > anti joins, so that Memoize nodes can be considered for them? > Worth a try. It should be pretty easy to enable, as far

Re: Feature Recommendations for Logical Subscriptions

2025-04-10 Thread YeXiu
For example: Assume database db1 has a user table with columns c1, c2, c3, ..., c10, telphone, and content (where telphone is a sensitive data field, and content is of type text). 1.We need to synchronize the user table to the BI department, but they should not have access to the telphone colu

Re: Skipping schema changes in publication

2025-04-10 Thread Amit Kapila
On Tue, Jan 9, 2024 at 12:02 PM vignesh C wrote: > > As I did not see much interest from others, I'm withdrawing this patch > for now. But if there is any interest others in future, I would be > more than happy to work on this feature. > Just FYI, I noticed a use case for this patch in email [1].

Re: Feature Recommendations for Logical Subscriptions

2025-04-10 Thread Amit Kapila
On Thu, Apr 10, 2025 at 10:12 AM YeXiu <1518981...@qq.com> wrote: > > For example: > Assume database db1 has a user table with columns c1, c2, c3, ..., c10, > telphone, and content (where telphone is a sensitive data field, and > content is of type text). > > 1.We need to synchronize the user tabl

Re: Large expressions in indexes can't be stored (non-TOASTable)

2025-04-10 Thread Euler Taveira
On Wed, Apr 9, 2025, at 4:05 PM, Nathan Bossart wrote: > On Wed, Apr 09, 2025 at 01:20:29PM +0900, Michael Paquier wrote: > > I guess that's the consensus, then. No objections to the removal here. > > That would look like the attached. There are still a couple of other known > TOAST snapshot iss

Re: PostgreSQL 18 Release Management Team & Feature Freeze

2025-04-10 Thread Heikki Linnakangas
On 10/04/2025 14:57, Aleksander Alekseev wrote: Let me be the first author this year who asks to squeeze his patch in after feature freeze :D :-) Do you think that it's worth merging SLRU refactoring into PG18, or is it considered a feature? [1] This is arguably not the top priority and we co

Re: PostgreSQL 18 Release Management Team & Feature Freeze

2025-04-10 Thread Aleksander Alekseev
Hi, > We are pleased to announce the Release Management Team (RMT) (cc'd) for > the PostgreSQL 18 release: > > - Tomas Vondra > - Nathan Bossart > - Heikki Linnakangas > > You can find information about the responsibilities of the RMT here: > https://wiki.postgresql.org/wiki/Release_Management_Tea

Re: Some problems regarding the self-join elimination code

2025-04-10 Thread Alexander Korotkov
On Wed, Apr 9, 2025 at 10:39 AM Andrei Lepikhov wrote: > On 4/9/25 04:05, Richard Guo wrote: > > On Tue, Apr 8, 2025 at 11:12 PM Dean Rasheed > > wrote: > >> On Tue, 8 Apr 2025 at 12:31, Andrei Lepikhov wrote: > >> Perhaps the way to do it is to make ChangeVarNodesExtended() take a > >> callbac

Re: PostgreSQL 18 Release Management Team & Feature Freeze

2025-04-10 Thread Heikki Linnakangas
On 10/04/2025 14:57, Aleksander Alekseev wrote: Let me be the first author this year who asks to squeeze his patch in after feature freeze :D On that note, I spoke with Matthias off-list, and he pointed out this patch: https://www.postgresql.org/message-id/CAEze2Wh9JjLKdN3dHPF%3DNejzf%3D9fDfcY

Re: PostgreSQL 18 Release Management Team & Feature Freeze

2025-04-10 Thread Aleksander Alekseev
Hi, > > Do you think that it's worth merging SLRU refactoring into PG18, or is > > it considered a feature? [1] This is arguably not the top priority and > > we could wait for another year but merging it now doesn't seem to be > > too much of a burden either. > > > > [1]: https://commitfest.postgr

Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c

2025-04-10 Thread Peter Eisentraut
On 09.04.25 14:26, Heikki Linnakangas wrote: It's a matter of taste, but personally I find 'if (tuple != NULL)' more clear than 'if (HeapTupleIsValid(tuple))'. The presence of a macro suggests that there might be other kinds of invalid tuples than a NULL pointer, which just adds mental load.

Re: Some problems regarding the self-join elimination code

2025-04-10 Thread Andrei Lepikhov
On 4/10/25 13:36, Alexander Korotkov wrote: On Wed, Apr 9, 2025 at 10:39 AM Andrei Lepikhov wrote: It seems we are coming to the conclusion that join removal optimisation may do something out of ChangeVarNodes resposibility. Before further complicating of this function code I would like to know

The varnullingrels bitmapset is not only about outer joins

2025-04-10 Thread Andrei Lepikhov
Hi, designing things upon fresh master I found that varnullingrels contains numbers that is out of the outer joins index range. Anywhere in documentation I see that this field contains outer join relids. But after the 247dea8 it simply isn't true. So, I propose at least to change comments (see

Re: 64 bit numbers vs format strings

2025-04-10 Thread Thomas Munro
On Sun, Mar 30, 2025 at 6:24 AM Peter Eisentraut wrote: > I have committed v2-0001, omitting the parts that I had flagged in my > review. I have also committed v2-0002. From my perspective, this can > conclude this thread. Thank you! Fingers crossed that the translation updates go as smoothly

Re: Improve a few appendStringInfo calls new to v18

2025-04-10 Thread Heikki Linnakangas
On 10/04/2025 06:51, David Rowley wrote: Looks like v18 has grown a few appendStringInfo misusages, e.g. using appendStringInfo() when no formatting is needed or just using format "%s" instead of using appendStringInfoString(). I've attached a couple of patches. The 0001 is just my method for fi

Re: bug in stored generated column over domain with constraints.

2025-04-10 Thread jian he
hi. new patch attached. rewriteTargetListIU, expand_insert_targetlist these two places can make a null Const TargetEntry for the generated column in an INSERT operation. but since this problem only occurs in INSERT, so i placed the logic within expand_insert_targetlist would be appropriate? The

Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c

2025-04-10 Thread Tender Wang
Michael Paquier 于2025年4月10日周四 10:53写道: > On Wed, Apr 09, 2025 at 05:43:24PM +0300, Heikki Linnakangas wrote: > > Agreed. I use both, depending on which mood I'm in. > > Same here, extended to OidIsValid(), HeapTupleIsValid(), XLogRecPtr, > etc., and I tend to prefer such macros, except if consist

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-04-10 Thread James Hunter
On Wed, Apr 9, 2025 at 11:00 PM Thomas Munro wrote: > > On Wed, Apr 9, 2025 at 1:46 PM James Hunter wrote: > > On Mon, Apr 7, 2025 at 7:34 PM Thomas Munro wrote: > > > On Thu, Feb 13, 2025 at 1:40 PM Melanie Plageman > > > wrote: > > > > Thomas mentioned this to me off-list, and I think he's ri

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Hannu Krosing
This is what the opening comment in pg_upgrade says I think we do preserve role oids /* * To simplify the upgrade process, we force certain system values to be * identical between old and new clusters: * * We control all assignments of pg_class.oid (and relfilenode) so toast * oids are the s

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Wolfgang Walther
Jacob Champion: It allows packagers to ship the OAuth library separately, so end users that don't want the additional exposure don't have to install it at all. Ah, this came in after I sent my other mail, with this foot-note: > Currently, the two build systems don't handle the "please build on

Re: [PATCH] clarify palloc comment on quote_literal_cstr

2025-04-10 Thread Michael Paquier
On Tue, Apr 08, 2025 at 01:26:59AM -0400, Tom Lane wrote: > +1. When I saw the patch I was mainly afraid that pgindent would > make a hash of it. Yes. I was actually surprised to see that it did not mess up with the code generated. -- Michael signature.asc Description: PGP signature

merge file_exists_in_directory and _fileExistsInDirectory functions and move into common file dumputils.c

2025-04-10 Thread Mahendra Singh Thalor
Hi, We have file_exists_in_directory function in pg_restore.c and same code we are using in _fileExistsInDirectory function in pg_backup_archiver.c also. Here, I am attaching a patch to move these duplicate functions into dumputils.c file -- Thanks and Regards Mahendra Singh Thalor EnterpriseDB:

Re: as per commit 643a1a61985bef2590496, move create/open dir code to function using switch case of pg_backup_directory.c file also

2025-04-10 Thread Mahendra Singh Thalor
On Thu, 10 Apr 2025 at 21:48, Andrew Dunstan wrote: > > > On 2025-04-07 Mo 2:59 PM, Mahendra Singh Thalor wrote: > > On Mon, 7 Apr 2025 at 18:52, Andrew Dunstan wrote: > >> > >> On 2025-04-07 Mo 8:25 AM, Mahendra Singh Thalor wrote: > >>> Hi, > >>> In commit 643a1a61985bef2590496, we did some cle

Re: psql suggestion "select " offers nothing, can we get functions like "\df "

2025-04-10 Thread Kirill Reshke
On Fri, 4 Apr 2025, 16:41 Kirill Reshke, wrote: > On Thu, 3 Apr 2025 at 20:07, Kirk Wolak wrote: > > Worse, "select pg_stat_st" has no clue. I was looking for ... > _reset > > > > It's not that difficult to add, I am suggesting that we use the same > logic as \df at that point? > > Is not s

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-04-10 Thread Bertrand Drouvot
Hi, On Tue, Apr 08, 2025 at 03:27:41PM +0900, Michael Paquier wrote: > On Tue, Apr 08, 2025 at 06:19:02AM +, Bertrand Drouvot wrote: > > - A new injection_points_wakeup_detach() function that is holding the > > spinlock > > during the whole duration to ensure that no process can wait in betwe

Re: Enhancing Memory Context Statistics Reporting

2025-04-10 Thread Daniel Gustafsson
On 8 Apr 2025, at 07:40, Rahila Syed wrote:  > Renamed both to use MemoryContextReporting* namespace, which leaves > MemoryContextReportingBackendState at an unwieldly long name.  I'm running out > of ideas on how to improve and it does make purpose quite explicit at least. How about MemoryConte

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Daniel Gustafsson
> On 8 Apr 2025, at 17:04, Jacob Champion > wrote: > > On Tue, Apr 8, 2025 at 7:32 AM Bruce Momjian wrote: >> Uh, where are we on the inclusion of curl in our build? Maybe it was >> explained but I have not seen it. > > The above is discussing a patch to split this into its own loadable > mod

Re: Remove unnecessary static type qualifiers

2025-04-10 Thread Junwang Zhao
On Tue, Apr 8, 2025 at 4:29 PM Japin Li wrote: > > > Hi, all > > When I read the libpq source code, I found unnecessary static type qualifiers > in PQsetClientEncoding(). > > diff --git a/src/interfaces/libpq/fe-connect.c > b/src/interfaces/libpq/fe-connect.c > index 0258d9ace3c..300ddfffd55 1006

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Mahendra Singh Thalor
On Sat, 5 Apr 2025 at 01:41, Andrew Dunstan wrote: > > > On 2025-04-04 Fr 5:12 AM, Mahendra Singh Thalor wrote: > > On Fri, 4 Apr 2025 at 13:52, Mahendra Singh Thalor wrote: > > On Fri, 4 Apr 2025 at 01:17, Andrew Dunstan wrote: > > On 2025-04-01 Tu 1:59 AM, Mahendra Singh Thalor wrote: > > On M

Re: Add os_page_num to pg_buffercache

2025-04-10 Thread Tomas Vondra
On 4/10/25 15:17, Bertrand Drouvot wrote: > Hi hackers, > > I was doing some more tests around ba2a3c2302f (pg_buffercache_numa) and > thought that seeing how buffers are spread across multiple OS pages (if that's > the case) thanks to the os_page_num field is good information to have. > > The

Re: Add os_page_num to pg_buffercache

2025-04-10 Thread Bertrand Drouvot
Hi, On Thu, Apr 10, 2025 at 09:58:18AM -0500, Nathan Bossart wrote: > On Thu, Apr 10, 2025 at 03:35:24PM +0200, Tomas Vondra wrote: > > This seems like a good idea in principle, but at this point it has to > > wait for PG19. Please add it to the July commitfest. > > +1. From a glance, this seems

Re: speedup COPY TO for partitioned table.

2025-04-10 Thread jian he
On Thu, Apr 10, 2025 at 4:25 PM Kirill Reshke wrote: > > On Thu, 10 Apr 2025 at 07:45, jian he wrote: > > > > hi. > > > > rebase and simplify regress tests. > > HI! > You used CREATE TABLE PARTITION OF syntax for the second level of > partitioning scheme, but not for the first level. Is there any

Correct documentation for protocol version

2025-04-10 Thread Dave Cramer
Greetings, The current docs say that if a client asks for a protocol that the backend doesn't support, it will return the newest minor version. https://www.postgresql.org/docs/current/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-NEGOTIATEPROTOCOLVERSION However that isn't what it return

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Nathan Bossart
On Tue, Apr 08, 2025 at 01:07:09PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> I do think it's worth considering going back to copying >> pg_largobject_metadata's files for upgrades from v16 and newer. > > (If we do this) I don't see why we'd need to stop at v16. I'm > envisioning that we

Re: Some problems regarding the self-join elimination code

2025-04-10 Thread Andrei Lepikhov
On 4/9/25 04:05, Richard Guo wrote: On Tue, Apr 8, 2025 at 11:12 PM Dean Rasheed wrote: On Tue, 8 Apr 2025 at 12:31, Andrei Lepikhov wrote: Perhaps the way to do it is to make ChangeVarNodesExtended() take a callback function to be invoked for each node visited. The callback (which would then

Re: pg16 && GSSAPI && Heimdal/Macos

2025-04-10 Thread Nico Williams
On Wed, Dec 06, 2023 at 06:54:22PM -0500, kov...@omniscient.com wrote: > I wanted to follow up on the decision to blow off Apple's built-in > GSSAPI. Years back, for reasons I never found, Apple switched from MIT > to Heimdal and have been maintaining their own version of it. I'm not > clear how

Silence resource leaks alerts

2025-04-10 Thread Ranier Vilela
Hi. Per Coverity. Coverity has some alerts about resource leaks. I think that is good silence. While it is arguable that this is a false warning, there is a benefit in moving the initialization of the string buffer, silencing the warnings that are presented in this case. 1. pg_overexplain.c 2.

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Tom Lane
Hannu Krosing writes: > I think we do preserve role oids Oh ... I'd been looking for mentions of "role" in pg_upgrade_support.c, but what I should have looked for was "pg_authid". So yeah, we do preserve role OIDs, and maybe that's enough to make this workable, at least with source versions that

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Andrew Dunstan
On 2025-04-10 Th 2:38 PM, Ranier Vilela wrote: Thanks. I have pushed these now with a few further small tweaks. Sorry if it is not the right place. Coverity has another resource leak alert. trivial patch attached. Thanks for checking. Pushed. cheers andrew -- Andrew Dunstan ED

Re: An incorrect check in get_memoize_path

2025-04-10 Thread Andrei Lepikhov
On 4/7/25 09:50, Richard Guo wrote: Consider the join to t3. It is a unique join, and not all of its restriction clauses are parameterized. Despite this, the check still passes. At least, this code looks more simple to understand, more 'armored' and worth to change. At the same time I think te

Re: Improve documentation regarding custom settings, placeholders, and the administrative functions

2025-04-10 Thread David G. Johnston
On Fri, Apr 4, 2025 at 5:19 AM Heikki Linnakangas wrote: > On 19/10/2024 23:11, David G. Johnston wrote: > > diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml > > index 934ef5e469..4478d0aa91 100644 > > --- a/doc/src/sgml/config.sgml > > +++ b/doc/src/sgml/config.sgml > > @@ -23,7

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-04-10 Thread Mahendra Singh Thalor
On Mon, 7 Apr 2025 at 02:40, Andrew Dunstan wrote: > > > On 2025-04-06 Su 1:51 PM, Tom Lane wrote: > > =?utf-8?Q?=C3=81lvaro?= Herrera writes: > >> On 2025-Apr-06, Tom Lane wrote: > >>> If we can cite the SQL standard then it's an entirely defensible > >>> restriction. > >> We can. It says (in 5

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Ranier Vilela
Hi. Em sex., 4 de abr. de 2025 às 17:11, Andrew Dunstan escreveu: > > On 2025-04-04 Fr 5:12 AM, Mahendra Singh Thalor wrote: > > On Fri, 4 Apr 2025 at 13:52, Mahendra Singh Thalor > wrote: > > On Fri, 4 Apr 2025 at 01:17, Andrew Dunstan > wrote: > > On 2025-04-01 Tu 1:59 AM, Mahendra Singh

Re: Add connection active, idle time to pg_stat_activity

2025-04-10 Thread Robert Haas
Hi, For the most part this patch looks like it's in pretty good shape to me, although I am less sold on the desirability of it than it sounds like most people are. I do think it can be useful, and it seems to mostly piggyback on existing time measurements, so it should be pretty cheap. But I'm jus

catcache search while BUFFER_LOCK_EXCLUSIVE on catalog

2025-04-10 Thread Noah Misch
Given the severity of the (never released) bug that commit 0bada39 fixed, I felt I owed improvements to our ability to detect the next bug like it. The attached patch adds pertinent assertions. For obstacles to the original bug detection, see Appendix 1. One of the exceptions this patch allows i

Re: tab complete for COPY populated materialized view TO

2025-04-10 Thread Kirill Reshke
On Thu, 10 Apr 2025 at 20:07, Fujii Masao wrote: > > > > On 2025/04/09 19:24, Kirill Reshke wrote: > > On Wed, 9 Apr 2025 at 14:45, Fujii Masao > > wrote: > >> > >> > >> > >> On 2025/04/09 18:25, Kirill Reshke wrote: > >>> On Wed, 9 Apr 2025 at 13:23, jian he wrote: > > hi. > > >

Re: [PoC] Reducing planning time when tables have many partitions

2025-04-10 Thread Yuya Watari
Hello David, On Tue, Apr 8, 2025 at 3:31 PM David Rowley wrote: > > I've pushed the patch now. Thanks for all the reviews of my adjustments. Thank you very much for pushing the patch! I also wish to extend my deepest thanks to everyone who has contributed to reviewing and improving this patch.

Re: Restrict publishing of partitioned table with a foreign table as partition

2025-04-10 Thread Álvaro Herrera
Here's the additional changes I made here before giving up on this. I think it needs some additional rethinking, not going to happen for 18. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "The Gord often wonders why people threaten never to come back after they'v

Re: Enhancing Memory Context Statistics Reporting

2025-04-10 Thread Rahila Syed
> > > > That's not an argument against moving it to BaseInit() though, as that's > called before procsignal is even initialized and before signals are > unmasked. > Yes, OK. > I don't really understand why DSA_DEFAULT_INIT_SEGMENT_SIZE is > > > > something that makes sense to use here? > > > > >

Re: tab complete for COPY populated materialized view TO

2025-04-10 Thread David G. Johnston
On Thursday, April 10, 2025, Kirill Reshke wrote: > On Thu, 10 Apr 2025 at 20:07, Fujii Masao > wrote: > > > > > > > > On 2025/04/09 19:24, Kirill Reshke wrote: > > > On Wed, 9 Apr 2025 at 14:45, Fujii Masao > wrote: > > >> > > >> > > >> > > >> On 2025/04/09 18:25, Kirill Reshke wrote: > > >>>

Re: tab complete for COPY populated materialized view TO

2025-04-10 Thread Kirill Reshke
On Fri, 11 Apr 2025 at 00:33, David G. Johnston wrote: > > They are supported for the From variant; valid completions need only satisfy > one of to/from, not both. > Thank you. If so, then WFM, and I don't have any more objections. -- Best regards, Kirill Reshke

Re: Feature Recommendations for Logical Subscriptions

2025-04-10 Thread Peter Smith
Hi, FYI, the Column List documentation [1] says -- However, do not rely on this feature for security: a malicious subscriber is able to obtain data from columns that are not specifically published. If security is a consideration, protections can be applied at the publisher side. -- IIRC,

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Andrew Dunstan
On 2025-04-10 Th 5:45 PM, Ranier Vilela wrote: Em qui., 10 de abr. de 2025 às 15:58, Andrew Dunstan escreveu: On 2025-04-10 Th 2:38 PM, Ranier Vilela wrote: Thanks. I have pushed these now with a few further small tweaks. Sorry if it is not the right place. Coverit

Re: n_ins_since_vacuum stats for aborted transactions

2025-04-10 Thread David Rowley
On Fri, 11 Apr 2025 at 02:01, Sami Imseih wrote: > I created an entry for the July CF > https://commitfest.postgresql.org/patch/5691/ > > ... and I realized I forgot to include David's code comment patch yesterday, > Reattaching both patches. I've pushed the code comment patch. For the docs patc

Re: stats.sql fails during installcheck on mac

2025-04-10 Thread Sami Imseih
> Hmm, that's a little nasty, because it's not showing up in the > buildfarm. It appears from a little testing that the issue only > manifests if you have fsync = on, which we generally don't on > buildfarm animals. right, "make check" does not encounter this because it runs with fsync=off, as I

Re: Streaming relation data out of order

2025-04-10 Thread Thomas Munro
On Thu, Apr 10, 2025 at 7:35 AM Andres Freund wrote: > 1) Increase distance by * 2 + read_size on a miss > >This would help us to increase with distance = 1, where * 2 only increases >distance by 1, just as -1 obviously reduces it by 1. > >It'd also somewhat address the over-weighing o

Re: sync_standbys_defined read/write race on startup

2025-04-10 Thread Michael Paquier
On Thu, Apr 10, 2025 at 12:55:54PM +0300, Maksim.Melnikov wrote: > On 10.04.2025 12:15, Michael Paquier wrote: >> Hmm, yeah. Instead of last, it would be better to put it in second >> place perhaps, for clarity? That would be the same at the end, but we >> would be slightly more consistent with t

Re: pg16 && GSSAPI && Heimdal/Macos

2025-04-10 Thread Todd M. Kover
> "Todd M. Kover" writes: > > 2) some option that makes the code path for gss_store_cred_into optional > > (what would you want to call it?) > > If we do this, I see no need to call it anything. Just make configure > probe for whether the selected GSS library has gss_store_cred_into. patch

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Jacob Champion
On Wed, Apr 9, 2025 at 4:42 PM Jelte Fennema-Nio wrote: > I think your suggestion of not using any .so files would best there (from w > user perspective). I'd be quite surprised if a static build still resulted in > me having to manage shared library files anyway. Done this way in v5. I had pla

Re: n_ins_since_vacuum stats for aborted transactions

2025-04-10 Thread David G. Johnston
On Thu, Apr 10, 2025 at 5:38 PM Sami Imseih wrote: > > On Fri, 11 Apr 2025 at 02:01, Sami Imseih wrote: > > > I created an entry for the July CF > > > https://commitfest.postgresql.org/patch/5691/ > > > > > > ... and I realized I forgot to include David's code comment patch > yesterday, > > > Re

Re: Add connection active, idle time to pg_stat_activity

2025-04-10 Thread Richard Guo
On Fri, Apr 11, 2025 at 3:47 AM Robert Haas wrote: > I'd probably write the increments as ++ rather than += 1 but I'm not > sure if everyone would agree. I'm a fan of ++ as well, so I agree. Thanks Richard

Re: MergeJoin beats HashJoin in the case of multiple hash clauses

2025-04-10 Thread Andres Freund
Hi, On 2025-04-11 00:47:19 +0200, Matthias van de Meent wrote: > On Fri, 11 Apr 2025 at 00:27, Andres Freund wrote: > > > > Hi, > > > > On 2025-03-09 14:13:52 +0200, Alexander Korotkov wrote: > > > I've revised commit message, comments, formatting etc. > > > I'm going to push this if no objection

Re: Feature Recommendations for Logical Subscriptions

2025-04-10 Thread Amit Kapila
On Fri, Apr 11, 2025 at 3:40 AM Peter Smith wrote: > > FYI, the Column List documentation [1] says > -- > However, do not rely on this feature for security: a malicious > subscriber is able to obtain data from columns that are not > specifically published. If security is a consideration, prote

Re: stats.sql fails during installcheck on mac

2025-04-10 Thread Michael Paquier
On Thu, Apr 10, 2025 at 06:45:36PM -0500, Sami Imseih wrote: > IIUC, this is only an issue for wal syncing Yes, good catch. I have missed this effect of issue_xlog_fsync(), which has two callers. The first one in XLogWrite() never happens if wal_sync_method is open_sync or open_datasync. The se

Re: Proposal: Filter irrelevant change before reassemble transactions during logical decoding

2025-04-10 Thread Peter Smith
Hi Ajin, Some review comments for patch v16-0002. == doc/src/sgml/logicaldecoding.sgml 1. + To indicate that decoding can be skipped for the given change + change_type, return true; + false otherwise. /change change_type/change_type/ (don't need to say "change" twice) =

Re: Fundamental scheduling bug in parallel restore of partitioned tables

2025-04-10 Thread Tom Lane
I wrote: > I think that the most intellectually rigorous solution is to > generate dummy TABLE DATA objects for partitioned tables, which > don't actually contain data but merely carry dependencies on > each of the child tables' TABLE DATA objects. Here's a draft patch for this. It seems to fix t

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-04-10 Thread Richard Guo
On Fri, Apr 11, 2025 at 4:45 AM Robert Haas wrote: > OK. Maybe I shouldn't be worrying about the table_open() / > table_close() here, because I see that you are right that > has_subclass() is nearby, which admittedly does not involve opening > the relation, but it does involve fetching from the sy

Re: Draft for basic NUMA observability

2025-04-10 Thread Jakub Wartak
On Mon, Apr 7, 2025 at 9:51 PM Tomas Vondra wrote: > > So it looks like that the new way to iterate on the buffers that has been > > introduced > > in v26/v27 has some issue? > > > > Yeah, the calculations of the end pointers were wrong - we need to round > up (using TYPEALIGN()) when calculatin

  1   2   >