Re: Improve readability by using designated initializers when possible

2024-02-26 Thread Alvaro Herrera
On 2024-Feb-27, Michael Paquier wrote: > These would cause compilation failures. Saying that, this is a very > nice cleanup, so I've fixed these and applied the patch after checking > that the one-one replacements were correct. Oh, I thought we were going to get rid of ObjectClass altogether --

Re: Synchronizing slots from primary to standby

2024-02-26 Thread Peter Smith
Here are some review comments for v99-0001 == 0. GENERAL. +#standby_slot_names = '' # streaming replication standby server slot names that + # logical walsender processes will wait for IMO the GUC name is too generic. There is nothing in this name to suggest it has anything to do with

Re: More new SQL/JSON item methods

2024-02-26 Thread Andrew Dunstan
On 2024-02-02 Fr 00:31, Jeevan Chalke wrote: On Thu, Feb 1, 2024 at 11:25 AM Kyotaro Horiguchi wrote: At Thu, 1 Feb 2024 09:22:22 +0530, Jeevan Chalke wrote in > On Thu, Feb 1, 2024 at 7:24 AM Kyotaro Horiguchi > wrote: > > > At Thu, 01 Feb 2024 10:49:57

Re: Improve readability by using designated initializers when possible

2024-02-26 Thread Michael Paquier
On Mon, Feb 26, 2024 at 05:00:13PM +0800, Japin Li wrote: > On Mon, 26 Feb 2024 at 16:41, jian he wrote: >> obvious typo errors. These would cause compilation failures. Saying that, this is a very nice cleanup, so I've fixed these and applied the patch after checking that the one-one

Re: A failure in t/001_rep_changes.pl

2024-02-26 Thread Kyotaro Horiguchi
At Fri, 23 Feb 2024 15:50:21 +0530, vignesh C wrote in > By any chance do you have the log files when this failure occurred, if > so please share it. In my understanding, within a single instance, no two proclists can simultaneously share the same waitlink member of PGPROC. On the other hand,

Re: Injection points: some tools to wait and wake

2024-02-26 Thread Andrey M. Borodin
> On 27 Feb 2024, at 04:29, Michael Paquier wrote: > > For > example, the test just posted here does not rely on that: > https://www.postgresql.org/message-id/zdyzya4yrnapw...@ip-10-97-1-34.eu-west-3.compute.internal Instead, that test is scanning logs + # Note:

Re: Improve readability by using designated initializers when possible

2024-02-26 Thread Michael Paquier
On Mon, Feb 26, 2024 at 05:00:13PM +0800, Japin Li wrote: > On Mon, 26 Feb 2024 at 16:41, jian he wrote: >> similarly, last entry, no need an extra comma? >> also other places last array entry no need extra comma. > > For last entry comma, see [1]. > > [1] >

Re: WIP Incremental JSON Parser

2024-02-26 Thread Andrew Dunstan
On 2024-02-26 Mo 19:20, Andrew Dunstan wrote: On 2024-02-26 Mo 10:10, Jacob Champion wrote: On Mon, Feb 26, 2024 at 7:08 AM Jacob Champion wrote: As a brute force example of the latter, with the attached diff I get test failures at chunk sizes 1, 2, 3, 4, 6, and 12. But this time with the

Re: Potential issue in ecpg-informix decimal converting functions

2024-02-26 Thread Michael Paquier
On Mon, Feb 26, 2024 at 12:28:51AM +0100, Daniel Gustafsson wrote: > Yeah, I think this is for HEAD only, especially given the lack of complaints > against backbranches. Daniel, are you planning to look at that? I haven't done any detailed lookup, but would be happy to do so it that helps. --

Re: cleanup patches for dshash

2024-02-26 Thread Nathan Bossart
On Mon, Feb 26, 2024 at 03:55:10PM -0600, Nathan Bossart wrote: > Committed. I noticed that I forgot to update a couple of comments. While fixing those, I discovered additional oversights that have been around since 2017. I plan to commit this shortly. -- Nathan Bossart Amazon Web Services:

The const expression evaluation routine should always return a copy

2024-02-26 Thread Andrei Lepikhov
IMO, the routine eval_const_expressions_mutator contains some stale code: case T_SubPlan: case T_AlternativeSubPlan: /* * Return a SubPlan unchanged --- too late to do anything with it. * * XXX should we ereport() here instead? Probably this routine * should never be invoked after

Re: Streaming I/O, vectored I/O (WIP)

2024-02-26 Thread Robert Haas
On Tue, Feb 27, 2024 at 9:25 AM Thomas Munro wrote: > Here's the 2 step version. The streaming_read.c API is unchanged, but > the bugmfr.c API now has only the following extra functions: > > bool StartReadBuffers(..., int *nblocks, ..., ReadBuffersOperation *op) >

Re: Streaming I/O, vectored I/O (WIP)

2024-02-26 Thread Thomas Munro
On Wed, Feb 7, 2024 at 11:54 PM Nazir Bilal Yavuz wrote: > 0001-Provide-vectored-variant-of-ReadBuffer: > > - Do we need to pass the hit variable to ReadBuffer_common()? I think > it can be just declared in the ReadBuffer_common() now. Right, thanks! Done, in the version I'll post shortly. >

Re: Fix incorrect PG_GETARG in pgcrypto

2024-02-26 Thread Michael Paquier
On Mon, Feb 26, 2024 at 02:47:27PM +0100, Tomas Vondra wrote: > Should this be marked as committed, or is there some remaining part? Thanks. I've missed the existence of [1]. It is now marked as committed. [1]: https://commitfest.postgresql.org/47/4822/ -- Michael signature.asc Description:

Re: Printing backtrace of postgres processes

2024-02-26 Thread Michael Paquier
On Mon, Feb 26, 2024 at 04:05:05PM +0100, Christoph Berg wrote: > I tried that now. Mind that I'm not a benchmarking expert, and there's > been quite some jitter in the results, but I think there's a clear > trend. > > Even if we regard the 1873 as an outlier, I've seen many vanilla runs > with

Re: Better error messages for %TYPE and %ROWTYPE in plpgsql

2024-02-26 Thread David G. Johnston
On Mon, Feb 26, 2024 at 6:54 PM Andy Fan wrote: > > "David G. Johnston" writes: > > > On Mon, Feb 26, 2024 at 5:46 PM Andy Fan wrote: > > > > > Per recent discussion[1], plpgsql returns fairly unhelpful "syntax > > > error" messages when a %TYPE or %ROWTYPE construct references a > > >

Re: Better error messages for %TYPE and %ROWTYPE in plpgsql

2024-02-26 Thread Andy Fan
"David G. Johnston" writes: > On Mon, Feb 26, 2024 at 5:46 PM Andy Fan wrote: > > > Per recent discussion[1], plpgsql returns fairly unhelpful "syntax > > error" messages when a %TYPE or %ROWTYPE construct references a > > nonexistent object. Here's a quick little finger exercise to try >

RE: Synchronizing slots from primary to standby

2024-02-26 Thread Zhijie Hou (Fujitsu)
On Monday, February 26, 2024 1:19 PM Amit Kapila wrote: > > On Fri, Feb 23, 2024 at 4:45 PM Bertrand Drouvot > wrote: > > > > On Fri, Feb 23, 2024 at 09:46:00AM +, Zhijie Hou (Fujitsu) wrote: > > > > > > Besides, I'd like to clarify and discuss the behavior of > > > standby_slot_names >

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2024-02-26 Thread Xing Guo
On Tue, Feb 27, 2024 at 6:38 AM Stephen Frost wrote: > > Greetings, > > * Xing Guo (higuox...@gmail.com) wrote: > > Looks that many hackers are happy with the original patch except that > > the original patch needs a simple rebase, though it has been 3 years. > > I'm not completely against the

Re: Better error messages for %TYPE and %ROWTYPE in plpgsql

2024-02-26 Thread Tom Lane
"David G. Johnston" writes: > On Mon, Feb 26, 2024 at 5:46 PM Andy Fan wrote: >> Looks this modify the error message, Well, yeah, that's sort of the point. >> I want to know how ould we treat >> error-message-compatible issue during minor / major upgrade. > There is no bug here so no

Re: Better error messages for %TYPE and %ROWTYPE in plpgsql

2024-02-26 Thread David G. Johnston
On Mon, Feb 26, 2024 at 5:46 PM Andy Fan wrote: > > Per recent discussion[1], plpgsql returns fairly unhelpful "syntax > > error" messages when a %TYPE or %ROWTYPE construct references a > > nonexistent object. Here's a quick little finger exercise to try > > to improve that. > > Looks this

Re: Better error messages for %TYPE and %ROWTYPE in plpgsql

2024-02-26 Thread Andy Fan
> Per recent discussion[1], plpgsql returns fairly unhelpful "syntax > error" messages when a %TYPE or %ROWTYPE construct references a > nonexistent object. Here's a quick little finger exercise to try > to improve that. Looks this modify the error message, I want to know how ould we treat

Re: WIP Incremental JSON Parser

2024-02-26 Thread Andrew Dunstan
On 2024-02-26 Mo 10:10, Jacob Champion wrote: On Mon, Feb 26, 2024 at 7:08 AM Jacob Champion wrote: As a brute force example of the latter, with the attached diff I get test failures at chunk sizes 1, 2, 3, 4, 6, and 12. But this time with the diff. Ouch. I'll check it out. Thanks!

Re: Injection points: some tools to wait and wake

2024-02-26 Thread Michael Paquier
On Mon, Feb 26, 2024 at 02:10:49PM +0500, Andrey M. Borodin wrote: > So that we could do something like > > ok(node_standby->await_injection_point(“CreateRestartPoint”,”checkpointer")); It would be more flexible with a full string to describe the test rather than a process name in the second

Re: [PATCH] updates to docs about HOT updates for BRIN

2024-02-26 Thread Stephen Frost
Greetings, * Elizabeth Christensen (elizabeth.christen...@crunchydata.com) wrote: > > On Feb 26, 2024, at 4:21 PM, Stephen Frost wrote: > > * Elizabeth Christensen (elizabeth.christen...@crunchydata.com) wrote: > >> I have a small documentation patch to the HOT updates page > >>

Re: Sequence Access Methods, round two

2024-02-26 Thread Michael Paquier
On Mon, Feb 26, 2024 at 09:38:06AM +0100, Matthias van de Meent wrote: > On Mon, 26 Feb 2024 at 09:11, Michael Paquier wrote: >> Thanks, I've applied these two for now. I'll reply to the rest >> tomorrow or so. > > Huh, that's surprising to me. I'd expected this to get at least a > final set of

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2024-02-26 Thread Thomas Munro
[Sorry to those who received this message twice -- the first time got bounced by the list because of a defunct email address in the CC list.] Here is a rebase of Palak's v2 patch. I didn't change anything except for the required resource manager API change, a pgindent run, and removal of a stray

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2024-02-26 Thread Stephen Frost
Greetings, * Xing Guo (higuox...@gmail.com) wrote: > Looks that many hackers are happy with the original patch except that > the original patch needs a simple rebase, though it has been 3 years. I'm not completely against the idea of adding these hooks, but I have to say that it's unfortunate to

Re: [PATCH] updates to docs about HOT updates for BRIN

2024-02-26 Thread Elizabeth Christensen
> On Feb 26, 2024, at 4:21 PM, Stephen Frost wrote: > > Greetings, > > * Elizabeth Christensen (elizabeth.christen...@crunchydata.com) wrote: >> I have a small documentation patch to the HOT updates page >> to add references >> to

Re: [PATCH] updates to docs about HOT updates for BRIN

2024-02-26 Thread Stephen Frost
Greetings, * Elizabeth Christensen (elizabeth.christen...@crunchydata.com) wrote: > I have a small documentation patch to the HOT updates page > to add references > to summary (BRIN) indexes not blocking HOT updates >

Re: cleanup patches for dshash

2024-02-26 Thread Nathan Bossart
On Fri, Feb 23, 2024 at 03:52:16PM -0600, Nathan Bossart wrote: > If there are no objections, I plan to commit these patches early next week. Committed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Add publisher and subscriber to glossary documentation.

2024-02-26 Thread Andrew Atkinson
If there's a movement towards "node" to refer to the database which has the Subscription object, then perhaps the documentation for 31.2. Subscription, Chapter 31. Logical Replication should be updated as well, since

Re: Streaming read-ready sequential scan code

2024-02-26 Thread Melanie Plageman
On Mon, Feb 19, 2024 at 6:05 PM Melanie Plageman wrote: > > On Mon, Jan 29, 2024 at 4:17 PM Melanie Plageman > wrote: > > > > There is an outstanding question about where to allocate the > > PgStreamingRead object for sequential scans > > I've written three alternative implementations of the

Re: Detoasting optionally to make Explain-Analyze less misleading

2024-02-26 Thread stepan rutz
Hi Matthias, thanks for picking it up. I still believe this is valuable to a lot of people out there. Thanks for dealing with my proposal. Matthias, Tom, Tomas everyone. Two (more or less) controversial remarks from side. 1. Actually serialization should be the default for "analyze" in explain,

Re: An improved README experience for PostgreSQL

2024-02-26 Thread Andrew Atkinson
Thanks for the feedback Nathan and Tom. Samay also suggested adding the patch. I've added a .patch with the file for consideration. On Mon, Feb 26, 2024 at 2:30 PM Tom Lane wrote: > Nathan Bossart writes: > > I think this would be nice. If the Markdown version is reasonably > readable > > as

Re: An improved README experience for PostgreSQL

2024-02-26 Thread Tom Lane
Nathan Bossart writes: > I think this would be nice. If the Markdown version is reasonably readable > as plain-text, maybe we could avoid maintaining two READMEs files, too. > But overall, +1 to modernizing the README a bit. Per past track record, we change the top-level README only once every

[PATCH] updates to docs about HOT updates for BRIN

2024-02-26 Thread Elizabeth Christensen
Hello, I have a small documentation patch to the HOT updates page to add references to summary (BRIN) indexes not blocking HOT updates

Re: Allow non-superuser to cancel superuser tasks.

2024-02-26 Thread Kirill Reshke
On Mon, 26 Feb 2024 at 20:10, Nathan Bossart wrote: > On Mon, Feb 26, 2024 at 12:38:40PM +0500, Kirill Reshke wrote: > > I see 2 possible ways to implement this. The first one is to have hool in > > pg_signal_backend, and define a hook in extension which can do the thing. > > The second one is

Re: libpq: PQfnumber overload for not null-terminated strings

2024-02-26 Thread Tom Lane
Ivan Trofimov writes: >> If you need counted strings >> for PQfnumber, wouldn't you need them for every single other >> string-based API in libpq as well? > No, not really. > Thing is, out of all the functions listed in "34.3.2. Retrieving Query > Result Information" and "34.3.3. Retrieving

Re: Better error messages for %TYPE and %ROWTYPE in plpgsql

2024-02-26 Thread Pavel Stehule
po 26. 2. 2024 v 21:02 odesílatel Tom Lane napsal: > Per recent discussion[1], plpgsql returns fairly unhelpful "syntax > error" messages when a %TYPE or %ROWTYPE construct references a > nonexistent object. Here's a quick little finger exercise to try > to improve that. > > The basic point is

Better error messages for %TYPE and %ROWTYPE in plpgsql

2024-02-26 Thread Tom Lane
Per recent discussion[1], plpgsql returns fairly unhelpful "syntax error" messages when a %TYPE or %ROWTYPE construct references a nonexistent object. Here's a quick little finger exercise to try to improve that. The basic point is that plpgsql_parse_wordtype and friends are designed to return

Re: Comments on Custom RMGRs

2024-02-26 Thread Jeff Davis
On Mon, 2024-02-26 at 23:29 +0700, Danil Anisimow wrote: > Hi, > > The checkpoint hook looks very useful, especially for extensions that > have their own storage, like pg_stat_statements. > For example, we can keep work data in shared memory and save it only > during checkpoints. > When

Re: Detoasting optionally to make Explain-Analyze less misleading

2024-02-26 Thread Matthias van de Meent
Hi, I've taken the liberty to update this patch, and register it in the commitfest app to not lose track of progress [0]. The attached v8 patch measures scratch memory allocations (with MEMORY option), total time spent in serialization (with TIMING on, measures are inclusive of unseparated

Re: libpq: PQfnumber overload for not null-terminated strings

2024-02-26 Thread Ivan Trofimov
Thanks for the quick reply. If you need counted strings for PQfnumber, wouldn't you need them for every single other string-based API in libpq as well? No, not really. Thing is, out of all the functions listed in "34.3.2. Retrieving Query Result Information" and "34.3.3. Retrieving Other

Re: Refactor SASL exchange in preparation for OAuth Bearer

2024-02-26 Thread Jacob Champion
On Fri, Feb 23, 2024 at 2:30 AM Daniel Gustafsson wrote: > > The attached two patches are smaller refactorings to the SASL exchange and > init > codepaths which are required for the OAuthbearer work [0]. Regardless of the > future of that patchset, these refactorings are nice cleanups and can

Re: An improved README experience for PostgreSQL

2024-02-26 Thread Nathan Bossart
On Mon, Feb 26, 2024 at 11:31:19AM -0600, Andrew Atkinson wrote: > Hello Hackers. We’re proposing an improved README for PostgreSQL that > includes more helpful links for prospective PostgreSQL contributors and has > a nicer presentation. > > Although development does not take place on GitHub or

RE: Popcount optimization using AVX512

2024-02-26 Thread Amonson, Paul D
Hello again, This is now a blocking issue. I can find no reason for the failing behavior of the MSVC build. All other languages build fine in CI including the Mac. Since the master branch builds, I assume I changed something critical to linking, but I can't figure out what that would be. Can

An improved README experience for PostgreSQL

2024-02-26 Thread Andrew Atkinson
Hello Hackers. We’re proposing an improved README for PostgreSQL that includes more helpful links for prospective PostgreSQL contributors and has a nicer presentation. Although development does not take place on GitHub or GitLab for PostgreSQL, many developers might view the PostgreSQL source

Re: Comments on Custom RMGRs

2024-02-26 Thread Danil Anisimow
Hi, The checkpoint hook looks very useful, especially for extensions that have their own storage, like pg_stat_statements. For example, we can keep work data in shared memory and save it only during checkpoints. When recovering, we need to read all the data from the disk and then repeat the

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2024-02-26 Thread Alvaro Herrera
On 2024-Feb-23, Dilip Kumar wrote: > 1. > + * If no process is already in the list, we're the leader; our first step > + * is to "close out the group" by resetting the list pointer from > + * ProcGlobal->clogGroupFirst (this lets other processes set up other > + * groups later); then we lock the

Re: Shared detoast Datum proposal

2024-02-26 Thread Andy Fan
Nikita Malakhov writes: > Hi, > > Tomas, we already have a working jsonb partial detoast prototype, > and currently I'm porting it to the recent master. This is really awesome! Acutally when I talked to MySQL guys, they said MySQL already did this and I admit it can resolve some different

Re: Shared detoast Datum proposal

2024-02-26 Thread Andy Fan
> On 2/26/24 14:22, Andy Fan wrote: >> >>... >> >>> Also, toasted values >>> are not always being used immediately and as a whole, i.e. jsonb values are >>> fully >>> detoasted (we're working on this right now) to extract the smallest value >>> from >>> big json, and these values are not

Re: Optimize planner memory consumption for huge arrays

2024-02-26 Thread Tom Lane
Tomas Vondra writes: > On 2/25/24 17:29, Tom Lane wrote: >> Yeah. Also: once we had such an idea, it'd be very tempting to apply >> it to other frequently-reset contexts like the executor's per-tuple >> evaluation contexts. I'm not quite prepared to argue that >> MemoryContextReset should just

Re: Running the fdw test from the terminal crashes into the core-dump

2024-02-26 Thread Alvaro Herrera
On 2024-Feb-25, Tom Lane wrote: > Alvaro Herrera writes: > > On 2024-Feb-22, Tom Lane wrote: > >> While I've not done anything about that here, I wonder if we shouldn't > >> just write "privilege on the target table" without any special markup. > > > That would work for me. > > OK. Will you

Re: Allow non-superuser to cancel superuser tasks.

2024-02-26 Thread Nathan Bossart
On Mon, Feb 26, 2024 at 12:38:40PM +0500, Kirill Reshke wrote: > I see 2 possible ways to implement this. The first one is to have hool in > pg_signal_backend, and define a hook in extension which can do the thing. > The second one is to have a predefined role. Something like a >

Re: WIP Incremental JSON Parser

2024-02-26 Thread Jacob Champion
On Mon, Feb 26, 2024 at 7:08 AM Jacob Champion wrote: > As a brute force example of the latter, with the attached diff I get > test failures at chunk sizes 1, 2, 3, 4, 6, and 12. But this time with the diff. --Jacob diff --git

Re: WIP Incremental JSON Parser

2024-02-26 Thread Jacob Champion
On Thu, Feb 22, 2024 at 3:43 PM Andrew Dunstan wrote: > > Are there plans to fill out the test suite more? Since we should be > > able to control all the initial conditions, it'd be good to get fairly > > comprehensive coverage of the new code. > > Well, it's tested (as we know) by the backup

Re: Printing backtrace of postgres processes

2024-02-26 Thread Christoph Berg
Re: Michael Paquier > Something like this can be measured with a bunch of concurrent > connections attempting connections and a very high rate, like pgbench > with an empty script and -C, for local connections. I tried that now. Mind that I'm not a benchmarking expert, and there's been quite some

Re: Shared detoast Datum proposal

2024-02-26 Thread Nikita Malakhov
Hi, Tomas, we already have a working jsonb partial detoast prototype, and currently I'm porting it to the recent master. Due to the size of the changes and very invasive nature it takes a lot of effort, but it is already done. I'm also trying to make the core patch less invasive. Actually, it is

Re: Speeding up COPY TO for uuids and arrays

2024-02-26 Thread Ranier Vilela
Em seg., 26 de fev. de 2024 às 02:28, Michael Paquier escreveu: > On Thu, Feb 22, 2024 at 04:42:37PM -0300, Ranier Vilela wrote: > > Can you share exactly script used to create a table? > > Stressing the internals of array_out() for the area of the patch is > not that difficult, as we want to

Re: Improve eviction algorithm in ReorderBuffer

2024-02-26 Thread Masahiko Sawada
On Mon, Feb 26, 2024 at 6:43 PM Tomas Vondra wrote: > > > > On 2/26/24 07:46, Masahiko Sawada wrote: > > On Sat, Feb 24, 2024 at 1:29 AM Tomas Vondra > > wrote: > >>... > >> > >> overall design > >> -- > >> > >> As for the design, I agree with the approach of using a binaryheap to >

Re: Shared detoast Datum proposal

2024-02-26 Thread Tomas Vondra
On 2/26/24 14:22, Andy Fan wrote: > >... > >> Also, toasted values >> are not always being used immediately and as a whole, i.e. jsonb values are >> fully >> detoasted (we're working on this right now) to extract the smallest value >> from >> big json, and these values are not worth keeping

Re: Fix race condition in InvalidatePossiblyObsoleteSlot()

2024-02-26 Thread Bertrand Drouvot
Hi, On Tue, Feb 20, 2024 at 04:03:53PM +, Bertrand Drouvot wrote: > Hi, > > On Tue, Feb 20, 2024 at 02:33:44PM +0900, Michael Paquier wrote: > > On Tue, Feb 20, 2024 at 08:51:17AM +0900, Michael Paquier wrote: > > > Prefixing these with "initial_" is fine, IMO. That shows the > > >

Re: RFC: Logging plan of the running query

2024-02-26 Thread Julien Rouhaud
On Mon, Feb 26, 2024 at 01:56:44PM +0530, Robert Haas wrote: > On Sun, Feb 25, 2024 at 5:00 PM Julien Rouhaud wrote: > > Yeah, trying to find a generalized solution seems like worth investing some > > time to avoid having a bunch of CHECK_FOR_XXX() calls scattered in the code > > a > > few years

Re: Shared detoast Datum proposal

2024-02-26 Thread Andy Fan
Hi, > When we store and detoast large values, say, 1Gb - that's a very likely > scenario, > we have such cases from prod systems - we would end up in using a lot of > shared > memory to keep these values alive, only to discard them later. First the feature can make sure if the original

Re: Fix incorrect PG_GETARG in pgcrypto

2024-02-26 Thread Tomas Vondra
On 2/16/24 02:35, shihao zhong wrote: > On Tue, Feb 13, 2024 at 7:08 PM Michael Paquier wrote: >> >> On Tue, Feb 13, 2024 at 05:36:36PM +0900, Michael Paquier wrote: >>> You've indeed grabbed some historical inconsistencies here. Please >>> note that your patch has reversed diffs (for example,

Re: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-02-26 Thread Amit Kapila
On Fri, Feb 23, 2024 at 10:41 PM Давыдов Виталий wrote: > > Amit Kapila wrote: > > I don't see we do anything specific for 2PC transactions to make them behave > differently than regular transactions with respect to synchronous_commit > setting. What makes you think so? Can you pin point the

Re: Synchronizing slots from primary to standby

2024-02-26 Thread Bertrand Drouvot
Hi, On Mon, Feb 26, 2024 at 05:52:40PM +0530, shveta malik wrote: > On Mon, Feb 26, 2024 at 5:18 PM Amit Kapila wrote: > > > > > > > + if (!ok) > > > > > + GUC_check_errdetail("List syntax is invalid."); > > > > > + > > > > > + /* > > > > > +* If there is a

Re: Synchronizing slots from primary to standby

2024-02-26 Thread Bertrand Drouvot
Hi, On Mon, Feb 26, 2024 at 05:18:25PM +0530, Amit Kapila wrote: > On Mon, Feb 26, 2024 at 12:59 PM Bertrand Drouvot > wrote: > > > > 10 === > > > > > > > > + if (slot->data.invalidated != RS_INVAL_NONE) > > > > + { > > > > +

Re: Add missing error codes to PANIC/FATAL error reports in xlog.c and relcache.c

2024-02-26 Thread Nazir Bilal Yavuz
Hi, On Fri, 23 Feb 2024 at 15:34, Daniel Gustafsson wrote: > > > On 23 Feb 2024, at 13:09, Nazir Bilal Yavuz wrote: > > > Does errmsg_internal() need to be used all the time when turning elogs > > into ereports? errmsg_internal()'s comment says that "This should be > > used for "can't happen"

Re: "type with xxxx does not exist" when doing ExecMemoize()

2024-02-26 Thread Andrei Lepikhov
On 26/2/2024 18:34, Richard Guo wrote: On Mon, Feb 26, 2024 at 3:54 PM Andrei Lepikhov mailto:a.lepik...@postgrespro.ru>> wrote: On 26/2/2024 12:44, Tender Wang wrote: > Make sense. I found MemoizeState already has a MemoryContext, so I used it. > I update the patch.

Re: Synchronizing slots from primary to standby

2024-02-26 Thread shveta malik
On Mon, Feb 26, 2024 at 5:18 PM Amit Kapila wrote: > > > > > + if (!ok) > > > > + GUC_check_errdetail("List syntax is invalid."); > > > > + > > > > + /* > > > > +* If there is a syntax error in the name or if the replication > > > > slots' > > > > +*

Re: Add new error_action COPY ON_ERROR "log"

2024-02-26 Thread torikoshia
On 2024-02-20 17:22, torikoshia wrote: On 2024-02-17 15:00, Bharath Rupireddy wrote: On Fri, Feb 16, 2024 at 8:17 PM torikoshia wrote: I may be wrong since I seldom do data loading tasks, but I greed with you. I also a little concerned about the case where there are many malformed data

RE: speed up a logical replica setup

2024-02-26 Thread Hayato Kuroda (Fujitsu)
Dear Euler, >> The possible solution would be >> 1) allow to run pg_createsubscriber if standby is initially stopped . >> I observed that pg_logical_createsubscriber also uses this approach. >> 2) read GUCs via SHOW command and restore them when server restarts >> >3. add a config-file option.

Re: RFC: Logging plan of the running query

2024-02-26 Thread torikoshia
On 2024-02-24 00:23, Robert Haas wrote: On Fri, Feb 23, 2024 at 7:50 PM Julien Rouhaud wrote: On Fri, Feb 23, 2024 at 10:22:32AM +0530, Robert Haas wrote: > On Thu, Feb 22, 2024 at 6:25 AM James Coleman wrote: > > This is potentially a bit of a wild idea, but I wonder if having some > > kind

Re: Synchronizing slots from primary to standby

2024-02-26 Thread Amit Kapila
On Mon, Feb 26, 2024 at 7:49 AM Zhijie Hou (Fujitsu) wrote: > > Attach the V98 patch set which addressed above comments. > Few comments: = 1. WalSndWaitForWal(XLogRecPtr loc) { int wakeEvents; + bool wait_for_standby = false; + uint32 wait_event; + List*standby_slots = NIL;

Re: Synchronizing slots from primary to standby

2024-02-26 Thread Amit Kapila
On Mon, Feb 26, 2024 at 12:59 PM Bertrand Drouvot wrote: > > On Mon, Feb 26, 2024 at 02:18:58AM +, Zhijie Hou (Fujitsu) wrote: > > On Friday, February 23, 2024 6:12 PM Bertrand Drouvot > > wrote: > > > + if (!ok) > > > + GUC_check_errdetail("List syntax is invalid."); >

Regardign RecentFlushPtr in WalSndWaitForWal()

2024-02-26 Thread shveta malik
Hi hackers, I would like to understand why we have code [1] that retrieves RecentFlushPtr in WalSndWaitForWal() outside of the loop. We utilize RecentFlushPtr later within the loop, but prior to that, we already have [2]. Wouldn't [2] alone be sufficient? Just to check the impact, I ran 'make

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2024-02-26 Thread Xing Guo
On Mon, Feb 26, 2024 at 7:27 PM Daniel Gustafsson wrote: > > > On 1 Jul 2020, at 10:36, Daniel Gustafsson wrote: > > > >> On 27 Mar 2020, at 11:22, Haozhou Wang wrote: > > > >> We rebased this patch with the newest master. > > > > This patch now fails to build according to Travis: > > > >

Re: "type with xxxx does not exist" when doing ExecMemoize()

2024-02-26 Thread Richard Guo
On Mon, Feb 26, 2024 at 3:54 PM Andrei Lepikhov wrote: > On 26/2/2024 12:44, Tender Wang wrote: > > Make sense. I found MemoizeState already has a MemoryContext, so I used > it. > > I update the patch. > This approach is better for me. In the next version of this patch, I > included a test case.

Re: Improve eviction algorithm in ReorderBuffer

2024-02-26 Thread Tomas Vondra
On 2/26/24 07:46, Masahiko Sawada wrote: > On Sat, Feb 24, 2024 at 1:29 AM Tomas Vondra > wrote: >>... >> >> overall design >> -- >> >> As for the design, I agree with the approach of using a binaryheap to >> track transactions by size. When going over the thread history, >>

Re: [PATCH] Add --syntax to postgres for SQL syntax checking

2024-02-26 Thread Josef Šimánek
po 26. 2. 2024 v 8:20 odesílatel Jelte Fennema-Nio napsal: > > On Sun, 25 Feb 2024 at 23:34, Josef Šimánek wrote: > > Exposing parser to frontend tools makes no sense to me > > Not everyone seems to agree with that, it's actually already done by > Lukas from pganalyze:

Re: Documentation: warn about two_phase when altering a subscription

2024-02-26 Thread Bertrand Drouvot
Hi, On Fri, Feb 23, 2024 at 11:50:17PM +, Tristen Raab wrote: > The following review has been posted through the commitfest application: > make installcheck-world: not tested > Implements feature: tested, passed > Spec compliant: not tested > Documentation:tested,

Re: Injection points: some tools to wait and wake

2024-02-26 Thread Andrey M. Borodin
> On 26 Feb 2024, at 08:57, Michael Paquier wrote: > > Would it be possible to have a helper function to check this: +ok( $node_standby->poll_query_until( + 'postgres', + qq[SELECT count(*) FROM pg_stat_activity + WHERE backend_type = 'checkpointer'

Re: Optimize planner memory consumption for huge arrays

2024-02-26 Thread Tomas Vondra
On 2/25/24 17:29, Tom Lane wrote: > Tomas Vondra writes: >> On 2/25/24 00:07, Tom Lane wrote: >>> ... I'm not sure if it'd be worth extending >>> the mcxt.c API to provide something like "MemoryContextResetIfBig", >>> with some internal rule that would be cheap to apply like "reset >>> if we

Re: Improve readability by using designated initializers when possible

2024-02-26 Thread Japin Li
On Mon, 26 Feb 2024 at 16:41, jian he wrote: > Hi. minor issues. > > @@ -2063,12 +2009,12 @@ find_expr_references_walker(Node *node, > CoerceViaIO *iocoerce = (CoerceViaIO *) node; > > /* since there is no exposed function, need to depend on type */ > - add_object_address(OCLASS_TYPE,

Re: Improve readability by using designated initializers when possible

2024-02-26 Thread jian he
Hi. minor issues. @@ -2063,12 +2009,12 @@ find_expr_references_walker(Node *node, CoerceViaIO *iocoerce = (CoerceViaIO *) node; /* since there is no exposed function, need to depend on type */ - add_object_address(OCLASS_TYPE, iocoerce->resulttype, 0, + add_object_address(TypeRelationId

Re: Sequence Access Methods, round two

2024-02-26 Thread Matthias van de Meent
On Mon, 26 Feb 2024 at 09:11, Michael Paquier wrote: > > On Thu, Feb 22, 2024 at 05:36:00PM +0100, Tomas Vondra wrote: > > 0002, 0003 > > > > seems fine, cosmetic changes > > Thanks, I've applied these two for now. I'll reply to the rest > tomorrow or so. Huh, that's surprising to

Re: RFC: Logging plan of the running query

2024-02-26 Thread Robert Haas
On Sun, Feb 25, 2024 at 5:00 PM Julien Rouhaud wrote: > Yeah, trying to find a generalized solution seems like worth investing some > time to avoid having a bunch of CHECK_FOR_XXX() calls scattered in the code a > few years down the road. I just don't really see how to do it. I suspect that

Re: Injection points: some tools to wait and wake

2024-02-26 Thread Bertrand Drouvot
Hi, On Mon, Feb 26, 2024 at 12:57:09PM +0900, Michael Paquier wrote: > On Thu, Feb 22, 2024 at 08:00:24AM +, Bertrand Drouvot wrote: > > +/* Maximum number of wait usable in injection points at once */ > > > > s/Maximum number of wait/Maximum number of waits/ ? > > Thanks. I've edited a

Re: RFC: Logging plan of the running query

2024-02-26 Thread Ashutosh Bapat
On Mon, Feb 26, 2024 at 1:25 PM Julien Rouhaud wrote: > > > > > > > > #define CHECK_FOR_INTERRUPTS_X(x, f, CFI_IMPL, ...) CFI_IMPL > > > > > > #define CHECK_FOR_INTERRUPTS(...) \ > > > CHECK_FOR_INTERRUPTS_X(, ##__VA_ARGS__, \ > > >

Re: Sequence Access Methods, round two

2024-02-26 Thread Michael Paquier
On Thu, Feb 22, 2024 at 05:36:00PM +0100, Tomas Vondra wrote: > 0002, 0003 > > seems fine, cosmetic changes Thanks, I've applied these two for now. I'll reply to the rest tomorrow or so. By the way, I am really wondering if the update of elm->increment in nextval_internal() should