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

2024-03-10 Thread Amit Kapila
On Fri, Mar 8, 2024 at 8:08 PM Bharath Rupireddy wrote: > > On Wed, Mar 6, 2024 at 4:28 PM Amit Kapila wrote: > > > > IIUC, the current conflict_reason is primarily used to determine > > logical slots on standby that got invalidated due to recovery time > > conflict. On the primary, it will also

Re: Add new error_action COPY ON_ERROR "log"

2024-03-10 Thread Michael Paquier
On Sat, Mar 09, 2024 at 12:01:49AM +0530, Bharath Rupireddy wrote: > If NOTICE per attribute and incrementing num_errors per row is > implemented, it ends up erroring out with ERROR: missing data for > column "m" for all-column-empty-row. Shall we treat this ERROR softly > too if on_error ignore

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

2024-03-10 Thread Tender Wang
David Rowley 于2024年3月11日周一 13:25写道: > On Thu, 7 Mar 2024 at 22:50, David Rowley wrote: > > > > On Thu, 7 Mar 2024 at 15:24, Tender Wang wrote: > > > > > > Andrei Lepikhov 于2024年3月6日周三 11:37写道: > > >> I think, it is a bug. Should it be fixed (and back-patched) earlier? > > > > > > Agreed.

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

2024-03-10 Thread David Rowley
On Thu, 7 Mar 2024 at 22:50, David Rowley wrote: > > On Thu, 7 Mar 2024 at 15:24, Tender Wang wrote: > > > > Andrei Lepikhov 于2024年3月6日周三 11:37写道: > >> I think, it is a bug. Should it be fixed (and back-patched) earlier? > > > > Agreed. Need David to review it as he knows this area best. > >

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

2024-03-10 Thread Andrei Lepikhov
On 7/3/2024 21:51, Alexander Korotkov wrote: Hi! On Tue, Mar 5, 2024 at 9:59 AM Andrei Lepikhov mailto:a.lepik...@postgrespro.ru>> wrote: > On 5/3/2024 12:30, Andrei Lepikhov wrote: > > On 4/3/2024 09:26, jian he wrote: > ... and the new version of the patchset is attached. I made some

RE: speed up a logical replica setup

2024-03-10 Thread Hayato Kuroda (Fujitsu)
Dear Vignesh, Thanks for updating the patch, but cfbot still got angry [1]. Note that two containers (autoconf and meson) failed at different place, so I think it is intentional one. It seems that there may be a bug related with 32-bit build. We should see and fix as soon as possible. [1]:

Re: Documentation: warn about two_phase when altering a subscription

2024-03-10 Thread Amit Kapila
On Sat, Feb 24, 2024 at 5:21 AM Tristen Raab wrote: > > I've reviewed your patch, it applies correctly and the documentation builds > without any errors. As for the content of the patch itself, I think so far > it's good but would make two modifications. I like how the patch was worded >

Re: speed up a logical replica setup

2024-03-10 Thread vignesh C
On Sat, 9 Mar 2024 at 00:56, Tomas Vondra wrote: > > > > On 3/8/24 10:44, Hayato Kuroda (Fujitsu) wrote: > > Dear Tomas, Euler, > > > > Thanks for starting to read the thread! Since I'm not an original author, > > I want to reply partially. > > > >> I decided to take a quick look on this patch

Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.

2024-03-10 Thread Anton A. Melnikov
On 11.03.2024 03:39, Alexander Korotkov wrote: Now that we distinguish stats for checkpoints and restartpoints, we need to update the docs. Please, check the patch attached. Maybe bring the pg_stat_get_checkpointer_buffers_written() description in consistent with these changes? Like that:

Re: Missing LWLock protection in pgstat_reset_replslot()

2024-03-10 Thread Michael Paquier
On Fri, Mar 08, 2024 at 07:46:26PM +0900, Michael Paquier wrote: > Sounds good to me. I've applied the patch of this thread as b36fbd9f8da1, though I did not see a huge point in backpatching as at the end this is just a consistency improvement. -- Michael signature.asc Description: PGP

Re: remaining sql/json patches

2024-03-10 Thread jian he
On Sun, Mar 10, 2024 at 10:57 PM jian he wrote: > > one more issue. Hi one more documentation issue. after applied V42, 0001 to 0003, there are 11 appearance of `FORMAT JSON` in functions-json.html still not a single place explained what it is for. json_query ( context_item, path_expression [

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-03-10 Thread John Naylor
On Thu, Mar 7, 2024 at 10:35 PM Masahiko Sawada wrote: > > I've attached the remaining patches for CI. I've made some minor > changes in separate patches and drafted the commit message for > tidstore patch. > > While reviewing the tidstore code, I thought that it would be more > appropriate to

Re: Confine vacuum skip logic to lazy_scan_skip

2024-03-10 Thread Thomas Munro
On Mon, Mar 11, 2024 at 5:31 AM Melanie Plageman wrote: > On Wed, Mar 6, 2024 at 6:47 PM Melanie Plageman > wrote: > > Performance results: > > > > The TL;DR of my performance results is that streaming read vacuum is > > faster. However there is an issue with the interaction of the streaming > >

Re: Reducing the log spam

2024-03-10 Thread Laurenz Albe
On Sat, 2024-03-09 at 14:03 +0100, Laurenz Albe wrote: > Here is a patch that implements this. And here is patch v2 that fixes a bug and passes the regression tests. Yours, Laurenz Albe From 6c72ea7d0aa1df569a4e53f54fcb1a11542ac0ef Mon Sep 17 00:00:00 2001 From: Laurenz Albe Date: Mon, 11 Mar

Re: Stack overflow issue

2024-03-10 Thread Alexander Korotkov
On Thu, Mar 7, 2024 at 11:07 AM Alexander Korotkov wrote: > On Thu, Mar 7, 2024 at 9:53 AM Egor Chindyaskin wrote: > > > > > 6 march 2024 г., at 19:17, Alexander Korotkov > > > wrote: > > > > > > The revised set of remaining patches is attached. > > > > > > 0001 Turn tail recursion into

Re: Fix log_line_prefix to display the transaction id (%x) for statements not in a transaction block

2024-03-10 Thread Quan Zongliang
On 2024/3/4 15:48, jian he wrote: Maybe we can tolerate LOG, first output the query plan then statement. It is more appropriate to let the extension solve its own problems. Of course, this change is not easy to implement. Due to the way XID is assigned, there seems to be no good solution

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-03-10 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Mon, 11 Mar 2024 08:00:00 +0800, jian he wrote: > Hi, here are my cents: > Currently in v17, we have 3 extra functions within DoCopyTo > CopyToStart, one time, start, doing some preliminary work. >

Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.

2024-03-10 Thread Alexander Korotkov
On Sat, Mar 9, 2024 at 4:38 PM Magnus Hagander wrote: > Per the docs, the sync_time, write_time and buffers_written only apply > to checkpoints, not restartpoints. Is this correct? AFAICT from a > quick look at the code they include both checkpoints and restartpoints > in which case I think the

Re: Add checkpoint/redo LSNs to recovery errors.

2024-03-10 Thread Michael Paquier
On Sun, Mar 10, 2024 at 04:58:19PM +1300, David Steele wrote: > No doubt there are many other recovery log messages that could be improved, > but I'd rather not bog down the patch. Fair argument, and these additions are useful when taken independently. I've applied your suggestions for now. --

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-03-10 Thread jian he
On Fri, Mar 8, 2024 at 8:23 AM Sutou Kouhei wrote: > > > This shows that the v17 approach doesn't affect the current > text/csv/binary implementations. (The v17 approach just adds > 2 new structs, Copy{From,To}Rountine, without changing the > current text/csv/binary implementations.) > > Can we

Re: Vectored I/O in bulk_write.c

2024-03-10 Thread Thomas Munro
Here also is a first attempt at improving the memory allocation and memory layout. I wonder if bulk logging should trigger larger WAL writes in the "Have to write it ourselves" case in AdvanceXLInsertBuffer(), since writing 8kB of WAL at a time seems like an unnecessarily degraded level of

Re: Hooking into ExplainOneQuery() complicated by missing standard_ExplainOneQuery

2024-03-10 Thread Michael Paquier
On Thu, Mar 07, 2024 at 07:45:01AM +0900, Michael Paquier wrote: > That's nice. You would be able to shave quite a bit of code. If > there are no objections, I propose to apply the change of this thread > to have this standard explain wrapper at the beginning of next week. > If others have any

Re: Adding OLD/NEW support to RETURNING

2024-03-10 Thread jian he
On Sat, Mar 9, 2024 at 3:53 AM Dean Rasheed wrote: > > > Attached is a new patch, now with docs (no other code changes). > Hi, some issues I found, while playing around with support-returning-old-new-v2.patch doc/src/sgml/ref/update.sgml: [ RETURNING [ WITH ( { OLD | NEW } AS output_alias

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-03-10 Thread Michael Paquier
On Mon, Feb 26, 2024 at 04:29:44PM +0900, Etsuro Fujita wrote: > Will do. (I was thinking you would get busy from now on.) Fujita-san, have you been able to look at this thread? -- Michael signature.asc Description: PGP signature

Re: psql: add \create_function command

2024-03-10 Thread Steve Chavez
> Maybe we could go with :{+...} or the like? > or maybe :{{ ... }} Tab completion didn't work for :{?} and I noted that the same problem would arise for :{+ or :{{ (and tab completion would be more important here). So I fixed that on:

Re: Invalid query generated by postgres_fdw with UNION ALL and ORDER BY

2024-03-10 Thread David Rowley
On Fri, 8 Mar 2024 at 23:14, Richard Guo wrote: > I've looked at this patch a bit. I once wondered why we don't check > pathkey->pk_eclass->ec_has_const with EC_MUST_BE_REDUNDANT to see if the > pathkey is not needed. Then I realized that a child member would not be > marked as constant even if

Re: Failures in constraints regression test, "read only 0 of 8192 bytes"

2024-03-10 Thread Thomas Munro
On Mon, Mar 11, 2024 at 9:59 AM Thomas Munro wrote: > On Mon, Mar 11, 2024 at 9:30 AM Heikki Linnakangas wrote: > > Hmm, I'm not sure if we need even smgrreleaseall() here anymore. It's > > not required for correctness AFAICS. We don't do it in single-rel > > invalidation in

Re: Failures in constraints regression test, "read only 0 of 8192 bytes"

2024-03-10 Thread Thomas Munro
On Mon, Mar 11, 2024 at 9:30 AM Heikki Linnakangas wrote: > Barring objections, I'll commit the attached. +1 I guess the comment for smgrreleaseall() could also be updated. It mentions only PROCSIGNAL_BARRIER_SMGRRELEASE, but I think sinval overflow (InvalidateSystemCaches()) should also be

Re: Failures in constraints regression test, "read only 0 of 8192 bytes"

2024-03-10 Thread Heikki Linnakangas
On 10/03/2024 11:20, Heikki Linnakangas wrote: On 10/03/2024 08:23, Thomas Munro wrote: On Sun, Mar 10, 2024 at 6:48 PM Thomas Munro wrote: I won't be surprised if the answer is: if you're holding a reference, you have to get a pin (referring to bulk_write.c). Ahhh, on second thoughts, I

Re: Statistics Import and Export

2024-03-10 Thread Corey Huinker
On Sun, Mar 10, 2024 at 11:57 AM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Fri, Mar 8, 2024 at 12:06 PM Corey Huinker > wrote: > > > > Anyway, here's v7. Eagerly awaiting feedback. > > Thanks for working on this. It looks useful to have the ability to > restore the

Re: pg_dump include/exclude fails to error

2024-03-10 Thread Magnus Hagander
On Sun, Mar 10, 2024 at 4:51 PM Pavel Stehule wrote: > > Hi > > ne 10. 3. 2024 v 15:23 odesílatel Magnus Hagander > napsal: >> >> When including tables with the new pg_dump functionality, it fails to >> error out if a table is missing, but only if more than one table is >> specified. >> >>

Re: Confine vacuum skip logic to lazy_scan_skip

2024-03-10 Thread Melanie Plageman
On Wed, Mar 6, 2024 at 6:47 PM Melanie Plageman wrote: > > Performance results: > > The TL;DR of my performance results is that streaming read vacuum is > faster. However there is an issue with the interaction of the streaming > read code and the vacuum buffer access strategy which must be

Re: UUID v7

2024-03-10 Thread Andrey M. Borodin
> On 10 Mar 2024, at 17:59, Andrey M. Borodin wrote: > > I tried to "make docs", but it gives me gazilion of errors... Is there an > easy way to see resulting HTML? Oops, CFbot expectedly found a problem... Sorry for the noise, this version, I hope, will pass all the tests. Thanks! Best

Re: Statistics Import and Export

2024-03-10 Thread Bharath Rupireddy
On Fri, Mar 8, 2024 at 12:06 PM Corey Huinker wrote: > > Anyway, here's v7. Eagerly awaiting feedback. Thanks for working on this. It looks useful to have the ability to restore the stats after upgrade and restore. But, the exported stats are valid only until the next ANALYZE is run on the

Re: pg_dump include/exclude fails to error

2024-03-10 Thread Pavel Stehule
Hi ne 10. 3. 2024 v 15:23 odesílatel Magnus Hagander napsal: > When including tables with the new pg_dump functionality, it fails to > error out if a table is missing, but only if more than one table is > specified. > > E.g., if table foo exist, but not bar: > > pg_dump --table bar > pg_dump:

Re: remaining sql/json patches

2024-03-10 Thread jian he
one more issue. + case JSON_VALUE_OP: + /* Always omit quotes from scalar strings. */ + jsexpr->omit_quotes = (func->quotes == JS_QUOTES_OMIT); + + /* JSON_VALUE returns text by default. */ + if (!OidIsValid(jsexpr->returning->typid)) + { + jsexpr->returning->typid = TEXTOID; +

Re: pg_dump include/exclude fails to error

2024-03-10 Thread Daniel Gustafsson
> On 10 Mar 2024, at 15:22, Magnus Hagander wrote: > Not having looked into the code, but it looks to me like some variable > isn't properly reset, or perhaps there is a check for existence rather > than count? Thanks for the report, I'll have a look later today when back. -- Daniel Gustafsson

Re: [DOC] Add detail regarding resource consumption wrt max_connections

2024-03-10 Thread Michael Banck
Hi, On Sun, Mar 10, 2024 at 09:58:25AM -0400, Robert Treat wrote: > On Fri, Mar 8, 2024 at 10:47 AM Michael Banck wrote: > > On Fri, Jan 12, 2024 at 10:14:38PM +, Cary Huang wrote: > > > I think it is good to warn the user about the increased allocation of > > > memory for certain parameters

pg_dump include/exclude fails to error

2024-03-10 Thread Magnus Hagander
When including tables with the new pg_dump functionality, it fails to error out if a table is missing, but only if more than one table is specified. E.g., if table foo exist, but not bar: pg_dump --table bar pg_dump: error: no matching tables were found with file "myfilter" containing just

Re: [DOC] Add detail regarding resource consumption wrt max_connections

2024-03-10 Thread Robert Treat
On Fri, Mar 8, 2024 at 10:47 AM Michael Banck wrote: > > Hi, > > On Fri, Jan 12, 2024 at 10:14:38PM +, Cary Huang wrote: > > I think it is good to warn the user about the increased allocation of > > memory for certain parameters so that they do not abuse it by setting > > it to a huge number

Re: UUID v7

2024-03-10 Thread Andrey M. Borodin
Hi Peter, thank you for so thoughtful review. > On 6 Mar 2024, at 12:13, Peter Eisentraut wrote: > > I have various comments on this patch: > > > - doc/src/sgml/func.sgml > > The documentation of the new functions should be broken up a bit. > It's all one paragraph now. At least make it

Re: Failures in constraints regression test, "read only 0 of 8192 bytes"

2024-03-10 Thread Heikki Linnakangas
Thanks for diagnosing this! On 10/03/2024 08:23, Thomas Munro wrote: On Sun, Mar 10, 2024 at 6:48 PM Thomas Munro wrote: I won't be surprised if the answer is: if you're holding a reference, you have to get a pin (referring to bulk_write.c). Ahhh, on second thoughts, I take that back, I

Re: Combine headerscheck and cpluspluscheck scripts

2024-03-10 Thread Peter Eisentraut
On 07.03.24 08:30, Michael Paquier wrote: On Thu, Mar 07, 2024 at 01:37:36PM +1300, Thomas Munro wrote: +1 Looking at the patch, nice cleanup. Committed, thanks.