Re: memory leak in pgoutput

2024-11-17 Thread Michael Paquier
On Mon, Nov 18, 2024 at 07:00:57AM +, by Yang wrote: > By the way, this issue is introduced in 52e4f0cd472d39d. Therefore, we may > need > to backport the patch to v15. Yes. Note that nothing can happen on stable branches for a few days as a release is planned for this week. See here: https

Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY

2024-11-17 Thread Shlok Kyal
Thanks for providing the comments. On Sat, 16 Nov 2024 at 17:29, vignesh C wrote: > > On Sat, 16 Nov 2024 at 00:10, Shlok Kyal wrote: > > > > Thanks for providing the comments. I have fixed all the comments and > > attached the updated patch. > > Few comments: > 1) The replident_has_valid_gen_co

Re: memory leak in pgoutput

2024-11-17 Thread by Yang
> Here, after freeing the tupledesc, the ExecDropSingleTupleTableSlot will still > access the freed tupledesc->tdrefcount which is an illegal memory access. Yes, I overlooked that. > I think we can do something like below instead: > > + TupleDesc desc = > entry->old_s

Re: [PATCH] New predefined role pg_manage_extensions

2024-11-17 Thread Kirill Reshke
On Mon, 18 Nov 2024 at 11:26, Kirill Reshke wrote: > > On Fri, 1 Nov 2024 at 02:47, Michael Banck wrote: > > > > Hi, > > > > Even though there has not been a lot of discussion on this, here is a > > rebased patch. I have also added it to the upcoming commitfest. > > > Hi! > > > + pg_manage

Re: [PATCH] New predefined role pg_manage_extensions

2024-11-17 Thread Kirill Reshke
On Fri, 1 Nov 2024 at 02:47, Michael Banck wrote: > > Hi, > > Even though there has not been a lot of discussion on this, here is a > rebased patch. I have also added it to the upcoming commitfest. Hi! > + pg_manage_extensions allows creating, removing or > + updating extensions, e

Re: Update Unicode data to Unicode 16.0.0

2024-11-17 Thread Michael Paquier
On Mon, Nov 11, 2024 at 07:27:53AM +0100, Peter Eisentraut wrote: > Here is the patch to update the Unicode data to version 16.0.0. > > Normally, this would have been routine, but a few months ago there was some > debate about how this should be handled. [0] AFAICT, the consensus was to > go ahea

Re: Tweak some codes format in gist.c

2024-11-17 Thread Tender Wang
Michael Paquier 于2024年11月18日周一 12:50写道: > On Fri, Nov 15, 2024 at 02:56:57PM +0500, Andrey M. Borodin wrote: > > I’d suggest to combine such changes with some real code modification > > done nearby. There’s plenty of GiST patches on commitfest. > > We do a lot of cosmetic fixes like this one, and

Re: Tweak some codes format in gist.c

2024-11-17 Thread Michael Paquier
On Fri, Nov 15, 2024 at 02:56:57PM +0500, Andrey M. Borodin wrote: > I’d suggest to combine such changes with some real code modification > done nearby. There’s plenty of GiST patches on commitfest. We do a lot of cosmetic fixes like this one, and sometimes we also have the argument that these sho

Re: EphemeralNamedRelation and materialized view

2024-11-17 Thread Michael Paquier
On Fri, Nov 15, 2024 at 05:36:47PM +0900, Yugo NAGATA wrote: > I agree that raising an internal error is not enough. I attached a updated > patch that outputs a message saying that an ENR can't be used in a matview. Hmm.. To get a better idea of the scope you are foreseeing here, should this incl

Re: memory leak in pgoutput

2024-11-17 Thread Michael Paquier
On Mon, Nov 18, 2024 at 02:53:52AM +, Zhijie Hou (Fujitsu) wrote: > But I think there is an issue in the attached patch: > > + FreeTupleDesc(entry->old_slot->tts_tupleDescriptor); > ExecDropSingleTupleTableSlot(entry->old_slot); > > Here, after freein

Re: Support LIKE with nondeterministic collations

2024-11-17 Thread jian he
On Fri, Nov 15, 2024 at 11:42 PM Peter Eisentraut wrote: > > On 15.11.24 05:26, jian he wrote: > > /* > > * Now build a substring of the text and try to match it against > > * the subpattern. t is the start of the text, t1 is one past the > > * last byte. We start with a zero-length string. > >

Re: define pg_structiszero(addr, s, r)

2024-11-17 Thread Michael Paquier
On Fri, Nov 15, 2024 at 02:43:32PM +, Bertrand Drouvot wrote: > Thinking about it, actually, "[sizeof(size_t) * 8, inf)" (note the ')' at the > end) > might be the proper notation from a mathematical point of view. v13 relied on a notation I've always used in maths, as infinity cannot be incl

RE: memory leak in pgoutput

2024-11-17 Thread Zhijie Hou (Fujitsu)
On Saturday, November 16, 2024 4:37 PM by Yang wrote: > I recently noticed a unusually large memory consumption in pgoutput where > "RelationSyncCache" is maintaining approximately 3 GB of memory while > handling 15,000 tables. > > Upon investigating the cause, I found that "tts_tupleDescriptor

Re: Set query_id for query contained in utility statement

2024-11-17 Thread Michael Paquier
On Sat, Nov 16, 2024 at 09:43:12PM +0100, Alvaro Herrera wrote: > I just noticed that this commit broke pgaudit pretty thoroughly. I'm > not sure if this means pgaudit needs changes, or this commit needs to be > reconsidered in some way; at this point I'm just raising the alarm. > > (FWIW there a

Re: Extract numeric filed in JSONB more effectively

2024-11-17 Thread Andy Fan
Hi Dmitry, >> On Thu, Sep 12, 2024 at 03:03:18AM GMT, Andy Fan wrote: >> >> > I imagined you'd the patch should create a SupportRequestSimplify >> > support function for jsonb_numeric() that checks if the input >> > expression is an OpExpr with funcid of jsonb_object_field(). All you >> > do th

Reduce TupleHashEntryData struct size by half

2024-11-17 Thread Jeff Davis
TupleHashEntryData is the size of a hash bucket, and it's currently 24 bytes. The size of the structure is important for HashAgg and other callers that can build up large hashtables of small tuples. Waste in this structure is even worse when the hash table is sparse, because the space is consumed

Re: POC, WIP: OR-clause support for indexes

2024-11-17 Thread Alexander Korotkov
On Fri, Nov 15, 2024 at 3:27 PM Alexander Korotkov wrote: > On Mon, Oct 28, 2024 at 6:55 PM Alena Rybakina > wrote: > > I may be wrong, but the original idea was to double-check the result with > > the original expression. > > > > But I'm willing to agree with you. I think we should add transfor

Re: optimize file transfer in pg_upgrade

2024-11-17 Thread Greg Sabino Mullane
On Wed, Nov 6, 2024 at 5:07 PM Nathan Bossart wrote: > Therefore, it can be much faster to instead move the entire data directory > from the old cluster > to the new cluster and to then swap the catalog relation files. > Thank you for breaking this up so clearly into separate commits. I think it

Re: UUID v7

2024-11-17 Thread Andrey M. Borodin
> On 17 Nov 2024, at 00:06, Andrey M. Borodin wrote: > > v31 There was a problem with MingWG build. I've considered all options and decided to include all necessary stuff into instr_time.h. So much fuss for these 2 bits about nanoseconds :) Best regards, Andrey Borodin. v32-0001-Implemen

deadlock-soft isolation test is failing on newest Fedora

2024-11-17 Thread Alexander Lakhin
Hello hackers, I'd like to bring your attention to an interesting failure produced by caiman twice: [1] and [2]. As far as I can see, this animal runs on Fedora and gets OS updates on a daily basis. At the moment of the first failure it had kernel: 6.12.0-0.rc6.20241108git906bd684e4b1.55.fc42.x8

Re: RISC-V animals sporadically produce weird memory-related failures

2024-11-17 Thread Tom Turelinckx
Hello Alexander, On Thu, Aug 22, 2024, at 11:00 AM, Alexander Lakhin wrote: > Dear copperhead, boomslang owner, could you consider upgrading OS on > these animals to rule out effects of OS anomalies that might be fixed > already? If it's not an option, couldn't you perform stress testing of > thes

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-11-17 Thread Andres Freund
Hi, On 2024-10-01 15:00:00 +0300, Alexander Lakhin wrote: > Hello Tom and Jelte, > > 31.08.2024 07:04, Alexander Lakhin wrote: > > I've tested your fix with the modification I proposed upthread: > > idle_session_timeout_enabled = false; > > } > > +if (rand() % 10 == 0) pg_us

Re: define pg_structiszero(addr, s, r)

2024-11-17 Thread Ranier Vilela
Em sex., 15 de nov. de 2024 às 11:43, Bertrand Drouvot < bertranddrouvot...@gmail.com> escreveu: > Hi, > > On Fri, Nov 15, 2024 at 09:54:33AM -0300, Ranier Vilela wrote: > > There is a tiny typo with V13. > > + /* "len" in the [sizeof(size_t) * 8, inf] range */ > > I think "[sizeof(size_t) * 8, in