RE: Introduce XID age and inactive timeout based replication slot invalidation

2024-12-25 Thread Zhijie Hou (Fujitsu)
On Tuesday, December 24, 2024 8:57 PM Michail Nikolaev wrote: Hi, > Yesterday I got a strange set of test errors, probably somehow related to > that patch. It happened on changed master branch (based on > d96d1d5152f30d15678e08e75b42756101b7cab6) but I don't think my changes were > affecting i

Re: An improvement of ProcessTwoPhaseBuffer logic

2024-12-25 Thread Michael Paquier
On Thu, Dec 26, 2024 at 07:42:34AM +0900, Michael Paquier wrote: > I suspect that this can be still dangerous as-is while complicating > the code with more possible paths for the removal of the 2PC files, > because we may still build a file name from an XID, and that's what's > causing this issue..

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-25 Thread torikoshia
On 2024-12-25 00:52, Tom Lane wrote: torikoshia writes: I have attached a PoC patch that modifies EXPLAIN to include page fault information during both the planning and execution phases of a query. Surely these numbers would be too unstable to be worth anything. Thanks for your comment! H

Re: Add XMLNamespaces to XMLElement

2024-12-25 Thread Umar Hayat
Hi, +1 for the enhancement. I haven't compiled and reviewed the full patch yet, please see a few comments from my side based on static analysis. 1. Though changes are targeted for XMLNAMESPACES for XMLElement but in my opinion it will affect XMLTABLE as well because the 'xml_namespace_list' rule

Re: Proposal: add new API to stringinfo

2024-12-25 Thread Michael Paquier
On Thu, Dec 26, 2024 at 09:53:09AM +0900, Tatsuo Ishii wrote: >> Saying that, having more control over the initial >> size used for a StringInfo could provide better practices in some >> cases. This reminds me of the ALLOCSET_SMALL_* fields in memutils.h, >> hence an idea would be an initStringInf

Re: Proposal: add new API to stringinfo

2024-12-25 Thread David Rowley
On Wed, 25 Dec 2024 at 16:37, Tatsuo Ishii wrote: > Currently the StringInfo package provides StringInfo object creation > API with fixed length initial allocation size (1024 bytes). However, > if we want to allocate much smaller size of initial allocation, this > is waste of space. I think it wo

Re: Proposal: add new API to stringinfo

2024-12-25 Thread Tatsuo Ishii
> On Wed, Dec 25, 2024 at 12:37:04PM +0900, Tatsuo Ishii wrote: >> Attached is a patch to implement it. In the patch I add two new APIs. >> >> extern StringInfo makeStringInfoWithSize(int size); >> extern void initStringInfoWithSize(StringInfo str, int size); >> >> Maybe I could re-invent the whe

Re: Add trim_trailing_whitespace to editorconfig file

2024-12-25 Thread Jelte Fennema-Nio
On Mon, 7 Oct 2024 at 22:21, Jelte Fennema-Nio wrote: > Is this blocked on anything? I feel it's ready to merge at this point. > I'd really like to not have this problem with trailing whitespace in > sgml files anymore. I noticed Peter added some additional rules to .gitattributes last month. So

Re: Fix typo in comment of compute_return_type()

2024-12-25 Thread Michael Paquier
On Wed, Dec 25, 2024 at 05:44:17PM +0800, Japin Li wrote: > When I reading the implementation of CreateFunction(), I found there is a typo > in comment of compute_return_type(). Good catch. Will fix! -- Michael signature.asc Description: PGP signature

Re: An improvement of ProcessTwoPhaseBuffer logic

2024-12-25 Thread Michael Paquier
On Wed, Dec 25, 2024 at 07:18:18PM +0300, Vitaly Davydov wrote: > I tried your patch and it seems the server is started > successfully. But I've found another problem in my synthetic test - > it can not remove the file with the following message: > > LOG: database system was not properly shut dow

Re: Using Expanded Objects other than Arrays from plpgsql

2024-12-25 Thread Michel Pelletier
On Mon, Dec 23, 2024 at 8:26 AM Tom Lane wrote: > Michel Pelletier writes: > > ... > > I agree it makes sense to have more use cases before making deeper > > changes. I only work with expanded forms, but need to call wait() to > > pre-expand the object to avoid multiple expansions in functions

Connection limits/permissions, slotsync workers, etc

2024-12-25 Thread Tom Lane
In connection with the discussion at [1], I started to look at exactly which server processes ought to be subject to connection limits (datconnlimit, ACL_CONNECT, and related checks). The current situation seems to be an inconsistent mess. Looking at InitPostgres, InitializeSessionUserId, and Che

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-25 Thread Tomas Vondra
Hi, On 12/23/24 07:35, wenhui qiu wrote: > Hi Tomas  >      This is a great feature.   > + /* > + * Define (or redefine) custom GUC variables. > + */ > + DefineCustomIntVariable("stats_history.size", > + "Sets the amount of memory available for past events.", > + NULL, > + &statsHistorySizeMB, > +

Re: Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows

2024-12-25 Thread Heikki Linnakangas
On 25/12/2024 18:34, Tom Lane wrote: Heikki Linnakangas writes: Ok, committed that, thanks1 The question this patch brings to my mind is whether libpgport doesn't need the same treatment. Good point. Yes it does. I tested that by adding a dummy call to COMP_CRC32C() in a test module, and

Re: Parallel heap vacuum

2024-12-25 Thread Tomas Vondra
On 12/19/24 23:05, Masahiko Sawada wrote: > On Sat, Dec 14, 2024 at 1:24 PM Tomas Vondra wrote: >> >> On 12/13/24 00:04, Tomas Vondra wrote: >>> ... >>> >>> The main difference is here: >>> >>> >>> master / no parallel workers: >>> >>> pages: 0 removed, 221239 remain, 221239 scanned (100.00%

Re: Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows

2024-12-25 Thread Tom Lane
Heikki Linnakangas writes: > Ok, committed that, thanks1 The question this patch brings to my mind is whether libpgport doesn't need the same treatment. regards, tom lane

Re: Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows

2024-12-25 Thread Heikki Linnakangas
On 23/12/2024 14:16, Vladlen Popolitov wrote: Vladlen Popolitov писал(а) 2024-12-23 15:14:  Yes, it is also working option. I applied it and tested in the current master under Windows, it works. Attached patch changes this line in meson.build    link_with: cflag_libs, +  link_whole:

RE: AIX support

2024-12-25 Thread Srirama Kucherlapati
Hi Heikki, Thanks for your feedback. > Please generate the patches against 'master', rather than v17. We might > choose to backport this to v17 later, but let's focus on the current > development branch for now. All the changes were made on top of master(development) branch pulled from github re

Re: An improvement of ProcessTwoPhaseBuffer logic

2024-12-25 Thread Vitaly Davydov
Hi Michael, Thank you for the explanation and the patch! I'm happy, that I seem to be on the right way. On Wednesday, December 25, 2024 08:04 MSK, Michael Paquier wrote: > Vitaly, have you seen that in the wild as an effect of future 2PC files? I haven't heard about this problem in production

Re: ERROR: corrupt MVNDistinct entry

2024-12-25 Thread Andrei Lepikhov
On 25/12/2024 16:36, Richard Guo wrote: On Wed, Dec 25, 2024 at 5:14 PM Richard Guo wrote: On Wed, Dec 25, 2024 at 11:34 AM Andrei Lepikhov wrote: 2. It is ok for Vars. But what about expressions? We use equal() in distinct, MCV and dependencies modules. Do we need to remove nulls before usin

Re: adjust_limit_rows_costs algorithm

2024-12-25 Thread Heikki Linnakangas
On 24/12/2024 08:20, wenhui qiu wrote: sysbench=# explain analyze  select userid from dba_users where  username like '%%' order by userid limit 1;                                                                  QUERY PLAN

Re: Windows UTF8 system locale

2024-12-25 Thread Vladlen Popolitov
Noah Misch писал(а) 2024-12-17 02:16: On Tue, Dec 17, 2024 at 02:29:59AM +1300, Thomas Munro wrote: On Sun, Dec 15, 2024 at 3:32 PM Noah Misch wrote: > For PostgreSQL, I expect the most obvious problems will arise for rolname and > datname containing non-UTF8. For example, pg_dumpall relies on

Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements

2024-12-25 Thread Michail Nikolaev
Hello, Michael! Thank you for your comments and feedback! Yes, this patch set contains a significant amount of code, which makes it challenging to review. Some details are explained in the commit messages, but I’m doing my best to structure the patch set in a way that is as committable as possibl

Documentation update of wal_retrieve_retry_interval to mention table sync worker

2024-12-25 Thread vignesh C
Hi, Currently, we restart the table synchronization worker after the duration specified by wal_retrieve_retry_interval following the last failure. While this behavior is documented for apply workers, it is not mentioned for table synchronization workers. I believe this detail should be included in

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

2024-12-25 Thread Nazir Bilal Yavuz
Hi, Andres off-list mentioned that: 1- It is time consuming to evict all shared buffers one by one using the pg_buffercache_evict() function. 2- It would be good to have a function to mark buffers as dirty to test different scenarios. So, this patchset extends pg_buffercache with 3 functions: 1

Improve consistency checks in tbm_prepare_shared_iterate

2024-12-25 Thread Daniil Davydov
Hi, Currently, iterating through TIDBitmap contains this code (REL_16_STABLE) : *** while ((page = pagetable_iterate(tbm->pagetable, &i)) != NULL) { idx = page - ptbase->ptentry; if (page->ischunk) ptchunks->index[nchunks++] = idx; else ptpages->index[npages++] = idx; }

Re: Exists pull-up application with JoinExpr

2024-12-25 Thread Alena Rybakina
On 24.12.2024 13:25, Ranier Vilela wrote: Hi Alena. Em ter., 24 de dez. de 2024 às 01:44, Alena Rybakina escreveu: Hi, hackers! I found one pull-up that works if the inner join condition is written through the where condition, |create temp table ta (id int primary key, val

Re: Windows UTF8 system locale

2024-12-25 Thread Vladlen Popolitov
Noah Misch писал(а) 2024-12-17 02:16: I wasn't ready to believe it, but 010_dump_connstr indeed fails with GetACP()==932. We've had test coverage of this for 8+ years, so I gather few or no runs of the TAP suite on GetACP()==932 systems have ever happened. Wow. Here's how your particular ex

Re: Windows meson build

2024-12-25 Thread Vladlen Popolitov
Kohei Harikae (Fujitsu) писал(а) 2024-12-18 05:05: Hi! Hi, I apologize for this late reply. As you advised, I was able to create the ".pc" file manually and set the dependencies using pkgconf. Thank you. However, I have read the PostgreSQL Documentation and did not realize that pkgconf is r

Re: AIX support

2024-12-25 Thread Heikki Linnakangas
On 23/12/2024 17:55, Srirama Kucherlapati wrote: Hello Team, In response to our previous discussions, we have refined the code to address only the necessary adjustments focusing solely on the essential modifications for AIX compatibility. The codebase was pulled from the GitHub repository (

Re: COPY performance on Windows

2024-12-25 Thread Vladlen Popolitov
Ryohei Takahashi (Fujitsu) писал(а) 2024-12-19 16:13: Hi Thank you for your advice and testing. I think, it could be checked, if table has text fields instead of numeric - we could exclude numeric conversion and have the same input-output operations (really more IO-operation, but we need to

Fix typo in comment of compute_return_type()

2024-12-25 Thread Japin Li
Hi, hackers When I reading the implementation of CreateFunction(), I found there is a typo in comment of compute_return_type(). -- Regrads, Japin Li >From 3a1008c692a919d55a456a7fa34e07d9c93879dd Mon Sep 17 00:00:00 2001 From: Li Jianping Date: Wed, 25 Dec 2024 14:39:15 +0800 Subject: [PATCH]

Re: ERROR: corrupt MVNDistinct entry

2024-12-25 Thread Richard Guo
On Wed, Dec 25, 2024 at 5:14 PM Richard Guo wrote: > On Wed, Dec 25, 2024 at 11:34 AM Andrei Lepikhov wrote: > > 2. It is ok for Vars. But what about expressions? We use equal() in > > distinct, MCV and dependencies modules. Do we need to remove nulls > > before using extended statistics as a gen

Re: Pass ParseState as down to utility functions.

2024-12-25 Thread Michael Paquier
On Mon, Dec 16, 2024 at 05:25:45PM +0800, jian he wrote: > i've split into 3 patches, feel free to merge them in any way. > v12-0001: add error position for ATPrepAlterColumnType. For this one, why don't you do the same for undefined columns and USING with generated columns at least? This looks

Re: Recovering from detoast-related catcache invalidations

2024-12-25 Thread Heikki Linnakangas
On 24/12/2024 09:38, Michael Paquier wrote: On Tue, Dec 24, 2024 at 12:18:09AM +0200, Heikki Linnakangas wrote: My first attempt was to insert the CatCTup or CatCList entry to the catcache before starting to build it, marked with a flag to indicate that the entry isn't fully built yet. But when

RE: Logical replication timeout

2024-12-25 Thread Hayato Kuroda (Fujitsu)
Dear Marc, > Thanks again for this new patch. > > Unfortunately it does not compile (17.2 source): Right, because of the reason I posted [1]. I updated the patch which did the same approach. It could pass my CI. Could you please apply on 17.2 and test it? [1]: https://www.postgresql.org/messa

Re: ERROR: corrupt MVNDistinct entry

2024-12-25 Thread Richard Guo
On Wed, Dec 25, 2024 at 11:34 AM Andrei Lepikhov wrote: > I have a couple of notes. > 1. The nulling_relids provides us sensible information about possible > nulls inside the input. We are not using it to estimate the number of > such nulls for now. Does Your idea consist of obtaining 'clear' > st