Re: Separate HEAP WAL replay logic into its own file

2024-07-29 Thread Li, Yong
> I think that this proposal is reasonable but we need to get > attention from a committer to move forward this proposal. > > > Thanks, > — > kou Thank you Kou for your review. I will move the CF to the next phase and see what happens. Regards, Yong

Re: Restart pg_usleep when interrupted

2024-07-29 Thread Bertrand Drouvot
Hi, On Mon, Jul 29, 2024 at 06:15:49PM -0500, Sami Imseih wrote: > > On Jul 26, 2024, at 3:27 AM, Bertrand Drouvot > > wrote: > > 3 === > > > > I gave more thoughts and I think it can be simplified a bit to reduce the > > number of operations in the while loop. > > > > What about relying on a

Re: psql: Add leakproof field to \dAo+ meta-command results

2024-07-29 Thread Yugo NAGATA
Hi, On Tue, 30 Jul 2024 01:36:55 +0200 Erik Wienhold wrote: > On 2024-07-01 15:08 +0200, Yugo NAGATA wrote: > > I would like to propose to add a new field to psql's \dAo+ meta-command > > to show whether the underlying function of an operator is leak-proof. > > +1 for making that info easily ac

Re: Flush pgstats file during checkpoints

2024-07-29 Thread Michael Paquier
On Mon, Jul 29, 2024 at 04:46:17AM +, Bertrand Drouvot wrote: > Thanks! 0001 attached is > v4-0001-Revert-Test-that-vacuum-removes-tuples-older-than.patch > so I guess you did not attached the right one. I did attach the right set of patches, please ignore 0001 entirely: the patch series is m

Re: 040_pg_createsubscriber.pl is slow and unstable (was Re: speed up a logical replica setup)

2024-07-29 Thread Amit Kapila
On Tue, Jul 30, 2024 at 11:28 AM Ashutosh Bapat wrote: > > On Tue, Jul 30, 2024 at 9:25 AM Amit Kapila wrote: > > > > On Tue, Jul 30, 2024 at 1:48 AM Tom Lane wrote: > > > > > > Robert Haas writes: > > > > On Sun, Jun 30, 2024 at 2:40 PM Tom Lane wrote: > > > >> ... However, I added a new open

Re: 040_pg_createsubscriber.pl is slow and unstable (was Re: speed up a logical replica setup)

2024-07-29 Thread Ashutosh Bapat
On Tue, Jul 30, 2024 at 9:25 AM Amit Kapila wrote: > > On Tue, Jul 30, 2024 at 1:48 AM Tom Lane wrote: > > > > Robert Haas writes: > > > On Sun, Jun 30, 2024 at 2:40 PM Tom Lane wrote: > > >> ... However, I added a new open item about how the > > >> 040_pg_createsubscriber.pl test is slow and s

Re: Separate HEAP WAL replay logic into its own file

2024-07-29 Thread Sutou Kouhei
Hi, In <599e67d2-2929-4858-b8bc-f9c4ae889...@ebay.com> "Re: Separate HEAP WAL replay logic into its own file" on Fri, 26 Jul 2024 07:56:12 +, "Li, Yong" wrote: >> 1. Could you create your patch by "git format-patch -vN master" >> or something? If you create your patch by "git format-p

Re: COPY FROM crash

2024-07-29 Thread Kirill Reshke
Hi! On Tue, 30 Jul 2024 at 08:52, Zhang Mingli wrote: > > Hi, all > > I got a crash when copy partition tables with mass data in Cloudberry > DB[0](based on Postgres14.4, Greenplum 7). > > I have a test on Postgres and it has the similar issue(different places but > same function). Just to be

Re: COPY FROM crash

2024-07-29 Thread David Rowley
On Tue, 30 Jul 2024 at 15:52, Zhang Mingli wrote: > I have a test on Postgres and it has the similar issue(different places but > same function). > > However it’s a little hard to reproduce because it happened when inserting > next tuple after a previous copy multi insert buffer is flushed. > >

Re: speed up a logical replica setup

2024-07-29 Thread Amit Kapila
On Tue, Jul 30, 2024 at 9:26 AM Hayato Kuroda (Fujitsu) wrote: > > > Hayato already mentioned one of the solution in a previous email [2]. > > AFAICS we can use any solution that creates a WAL record. I tested the > > following options: > > Yes, my point was that we should add an arbitrary record

Re: Incremental View Maintenance, take 2

2024-07-29 Thread Yugo NAGATA
Hi, On Tue, 30 Jul 2024 03:32:19 +0500 Kirill Reshke wrote: > On Sat, 27 Jul 2024 at 13:26, Kirill Reshke wrote: > > > > Hi! > > Cloudberry DB (Greenplum fork) uses IMMV feature for AQUMV (auto query > > use matview) feature, so i got interested in how it is implemented. Thank you so much for

Re: pgsql: Add more SQL/JSON constructor functions

2024-07-29 Thread Amit Langote
Hi, On Fri, Jul 26, 2024 at 11:19 PM jian he wrote: > On Fri, Jul 26, 2024 at 4:53 PM Amit Langote wrote: > > > > > > Pushed 0003-0005 ahead of 0001-0002. Will try to push them over the > > weekend. Rebased for now. Pushed them now. > { > ... > /* > * For expression nodes that suppo

Re: 040_pg_createsubscriber.pl is slow and unstable (was Re: speed up a logical replica setup)

2024-07-29 Thread Amit Kapila
On Tue, Jul 30, 2024 at 9:56 AM Tom Lane wrote: > > Amit Kapila writes: > > On Tue, Jul 30, 2024 at 1:48 AM Tom Lane wrote: > >> If the problem can be correctly described as "pg_createsubscriber > >> takes 10 seconds or so to detect end-of-stream", > > > The problem can be defined as: "pg_create

Re: 040_pg_createsubscriber.pl is slow and unstable (was Re: speed up a logical replica setup)

2024-07-29 Thread Tom Lane
Amit Kapila writes: > On Tue, Jul 30, 2024 at 1:48 AM Tom Lane wrote: >> If the problem can be correctly described as "pg_createsubscriber >> takes 10 seconds or so to detect end-of-stream", > The problem can be defined as: "pg_createsubscriber waits for an > additional (new) WAL record to be ge

Re: Conflict Detection and Resolution

2024-07-29 Thread shveta malik
On Fri, Jul 26, 2024 at 9:50 AM Ajin Cherian wrote: >> > Please find v7 patch-set, the changes are: > Thanks Ajin for working on this. Please find few comments: 1) parse_subscription_conflict_resolvers(): Here we loop in this function to find the given conflict type in the supported list and err

RE: speed up a logical replica setup

2024-07-29 Thread Hayato Kuroda (Fujitsu)
Dear Euler, > Hayato already mentioned one of the solution in a previous email [2]. > AFAICS we can use any solution that creates a WAL record. I tested the > following options: Yes, my point was that we should add an arbitrary record after the recovery_target_lsn. > (a) temporary replication s

Re: 040_pg_createsubscriber.pl is slow and unstable (was Re: speed up a logical replica setup)

2024-07-29 Thread Amit Kapila
On Tue, Jul 30, 2024 at 1:48 AM Tom Lane wrote: > > Robert Haas writes: > > On Sun, Jun 30, 2024 at 2:40 PM Tom Lane wrote: > >> ... However, I added a new open item about how the > >> 040_pg_createsubscriber.pl test is slow and still unstable. > > > But that said, I see no commits in the commit

COPY FROM crash

2024-07-29 Thread Zhang Mingli
Hi, all I got a crash when copy partition tables with mass data in Cloudberry DB[0](based on Postgres14.4, Greenplum 7). I have a test on Postgres and it has the similar issue(different places but same function). However it’s a little hard to reproduce because it happened when inserting next

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

2024-07-29 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Sun, 28 Jul 2024 22:49:47 +0800, Junwang Zhao wrote: > Thanks for updating the patches, I applied them and test > in my local machine, I did not use tmpfs in my test, I guess > if I run the tests enough rou

Re: Remove last traces of HPPA support

2024-07-29 Thread Thomas Munro
On Tue, Jul 30, 2024 at 11:16 AM Heikki Linnakangas wrote: > On 30/07/2024 00:50, Thomas Munro wrote: > > On Wed, Jul 3, 2024 at 8:09 PM Tom Lane wrote: > >> Thomas Munro writes: > > OK, part on ice for now. Here's an update of the rest, > > this time also removing the barrier fallbacks as dis

Re: speed up a logical replica setup

2024-07-29 Thread Euler Taveira
On Mon, Jul 29, 2024, at 6:11 PM, Euler Taveira wrote: > The options are: > > (a) temporary replication slot: requires an additional replication slot. > small payload. it is extremely slow in comparison with the other > options. > (b) logical message: can be consumed by logical replication when/if

Re: psql: Add leakproof field to \dAo+ meta-command results

2024-07-29 Thread Erik Wienhold
On 2024-07-01 15:08 +0200, Yugo NAGATA wrote: > I would like to propose to add a new field to psql's \dAo+ meta-command > to show whether the underlying function of an operator is leak-proof. +1 for making that info easily accessible. > This idea is inspired from [1] that claims some indexes uses

Re: Remove last traces of HPPA support

2024-07-29 Thread Heikki Linnakangas
On 30/07/2024 00:50, Thomas Munro wrote: On Wed, Jul 3, 2024 at 8:09 PM Tom Lane wrote: Thomas Munro writes: Here are some experimental patches to try out some ideas mentioned upthread, that are approximately unlocked by that cleanup. FWIW, I'm good with getting rid of --disable-spinlocks a

Re: Restart pg_usleep when interrupted

2024-07-29 Thread Sami Imseih
> On Jul 26, 2024, at 3:27 AM, Bertrand Drouvot > wrote: > > Hi, > > On Thu, Jul 25, 2024 at 05:27:15PM -0500, Sami Imseih wrote: >> I am attaching v3 of the patch which addresses the comments made >> earlier by Bertrand about the comment in the patch [1]. > > Thanks! > > Looking at it: >

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-07-29 Thread Jacob Champion
On Mon, Jul 29, 2024 at 1:51 PM Daniel Gustafsson wrote: > Together with a colleage we found the Azure provider use "verification_url" > rather than xxx_uri. Yeah, I think that's originally a Google-ism. (As far as I can tell they helped author the spec for this and then didn't follow it. :/ ) I

Re: Use pgBufferUsage for block reporting in analyze

2024-07-29 Thread Masahiko Sawada
Hi, On Mon, Jul 29, 2024 at 12:12 AM Anthonin Bonnefoy wrote: > > On Sat, Jul 27, 2024 at 12:35 AM Masahiko Sawada > wrote: > > An alternative idea would > > be to pass StringInfo to AcquireSampleRowsFunc() so that callback can > > write its messages there. This is somewhat similar to what we d

Re: Incremental View Maintenance, take 2

2024-07-29 Thread Kirill Reshke
On Sat, 27 Jul 2024 at 13:26, Kirill Reshke wrote: > > Hi! > Cloudberry DB (Greenplum fork) uses IMMV feature for AQUMV (auto query > use matview) feature, so i got interested in how it is implemented. > > On Thu, 11 Jul 2024 at 09:24, Yugo NAGATA wrote: > > > > I updated the patch to bump up the

Re: Optimize mul_var() for var1ndigits >= 8

2024-07-29 Thread Tom Lane
Dean Rasheed writes: > On Mon, 29 Jul 2024 at 21:39, Joel Jacobson wrote: >> I think it's non-obvious if the separate code paths for 32-bit and 64-bit, >> using `#if SIZEOF_DATUM < 8`, to get *fast* 32-bit support, outweighs >> the benefits of simpler code. > Looking at that other thread that yo

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-07-29 Thread Jacob Champion
On Mon, Jul 29, 2024 at 5:02 AM Peter Eisentraut wrote: > We should take the check for exit() calls from libpq and expand it to > cover the other libraries as well. Maybe there are other problems like > this? Seems reasonable, yeah. > But under what circumstances does "the linker doesn't strip

Re: ecdh support causes unnecessary roundtrips

2024-07-29 Thread Daniel Gustafsson
> On 17 Jun 2024, at 19:56, Andres Freund wrote: > On 2024-06-17 19:51:45 +0200, Daniel Gustafsson wrote: >> Changing the default of the ecdh GUC would perhaps be doable? > > I was wondering whether we could change the default so that it accepts both > x25519 and secp256r1. Unfortunately that se

Speeding up ruleutils' name de-duplication code, redux

2024-07-29 Thread Tom Lane
When deparsing queries or expressions, ruleutils.c has to generate unique names for RTEs and columns of RTEs. (Often, they're unique already, but this isn't reliably true.) The original logic for that involved just strcmp'ing a proposed name against all the ones already assigned, which obviously

Re: Optimize mul_var() for var1ndigits >= 8

2024-07-29 Thread Dean Rasheed
On Mon, 29 Jul 2024 at 21:39, Joel Jacobson wrote: > > I like these simplifications, how `var2ndigits` is used instead of > `res_ndigits`: > - for (int i = res_ndigits - 3; i >= 1; i--) > + for (int i = var2ndigits - 1; i >= 1; i--) > > But I wonder why

Re: Remove last traces of HPPA support

2024-07-29 Thread Thomas Munro
On Wed, Jul 3, 2024 at 8:09 PM Tom Lane wrote: > Thomas Munro writes: > > Here are some experimental patches to try out some ideas mentioned > > upthread, that are approximately unlocked by that cleanup. > > FWIW, I'm good with getting rid of --disable-spinlocks and > --disable-atomics. That's a

Re: xid_wraparound tests intermittent failure.

2024-07-29 Thread Masahiko Sawada
On Sat, Jul 27, 2024 at 1:06 PM Andrew Dunstan wrote: > > > On 2024-07-26 Fr 1:46 PM, Masahiko Sawada wrote: > > On Thu, Jul 25, 2024 at 6:52 PM Andrew Dunstan wrote: > >> > >> On 2024-07-25 Th 3:40 PM, Masahiko Sawada wrote: > >> > >> On Thu, Jul 25, 2024 at 11:06 AM Masahiko Sawada > >> wrote

Re: speed up a logical replica setup

2024-07-29 Thread Euler Taveira
On Wed, Jul 17, 2024, at 11:37 PM, Amit Kapila wrote: > I am thinking of transactions between restart_lsn and "consistent > point lsn" (aka the point after which all commits will be replicated). > You conclusion seems correct to me that such transactions won't be > replicated by streaming replicati

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-07-29 Thread Daniel Gustafsson
Thanks for working on this patchset, I'm looking over 0004 and 0005 but came across a thing I wanted to bring up one thing sooner than waiting for the review. In parse_device_authz we have this: {"user_code", JSON_TOKEN_STRING, {&authz->user_code}, REQUIRED}, {"verification_uri", JSON_TOKEN_ST

Is *fast* 32-bit support still important?

2024-07-29 Thread Joel Jacobson
Hello hackers, I would like your help to collectively try to answer these three questions: 1. Who are the current users of 32-bit PostgreSQL? 2. Among these users, how many are upgrading to new major versions? 3. For how many of these users is performance critical? This came up during ongoing

Re: Optimize mul_var() for var1ndigits >= 8

2024-07-29 Thread Joel Jacobson
On Mon, Jul 29, 2024, at 22:01, Dean Rasheed wrote: > On Mon, 29 Jul 2024 at 18:57, Joel Jacobson wrote: >> >> Thanks to v3-0002, they are all still significantly faster when both patches >> have been applied, >> but I wonder if it is expected or not, that v3-0001 temporarily made them a >> bit

Re: 040_pg_createsubscriber.pl is slow and unstable (was Re: speed up a logical replica setup)

2024-07-29 Thread Tom Lane
Robert Haas writes: > On Sun, Jun 30, 2024 at 2:40 PM Tom Lane wrote: >> ... However, I added a new open item about how the >> 040_pg_createsubscriber.pl test is slow and still unstable. > But that said, I see no commits in the commit history which purport to > improve performance, so I guess th

Re: Refactoring postmaster's code to cleanup after child exit

2024-07-29 Thread Heikki Linnakangas
On 06/07/2024 22:01, Heikki Linnakangas wrote: Reading through postmaster code, I spotted some refactoring opportunities to make it slightly more readable. Currently, when a child process exits, the postmaster first scans through BackgroundWorkerList to see if it was a bgworker process. If not

Re: tls 1.3: sending multiple tickets

2024-07-29 Thread Andres Freund
On 2024-07-26 13:55:29 +0200, Daniel Gustafsson wrote: > Thanks for review, I've applied this backpatched all the way. Thanks for working on this!

Re: Optimize mul_var() for var1ndigits >= 8

2024-07-29 Thread Dean Rasheed
On Mon, 29 Jul 2024 at 18:57, Joel Jacobson wrote: > > Thanks to v3-0002, they are all still significantly faster when both patches > have been applied, > but I wonder if it is expected or not, that v3-0001 temporarily made them a > bit slower? > There's no obvious reason why 0001 would make th

Suboptimal spinlock code due to volatile

2024-07-29 Thread Andres Freund
Hi, As part of [1] I was staring at the assembly code generated for SpinLockAcquire(), fairly randomly using GetRecoveryState() as the example. On master, in an optimized build this generates the following code (gcc 12 in this case, but it doesn't really matter): 4220 : 4220:

Re: tiny step toward threading: reduce dependence on setlocale()

2024-07-29 Thread Peter Eisentraut
On 27.07.24 21:03, Andreas Karlsson wrote: On 7/26/24 10:35 PM, Jeff Davis wrote: database_ctype_is_c refers to the LC_CTYPE environment of the database -- pg_database.datctype. default_locale.ctype_is_c is the ctype of the database's default collation. Confusing, I know, but it matters for a f

Re: Detach shared memory in Postmaster child if not needed

2024-07-29 Thread Heikki Linnakangas
On 29/07/2024 21:10, Robert Haas wrote: On Mon, Jul 29, 2024 at 5:57 AM Rui Zhao wrote: Prior to PG16, postmaster children would manually detach from shared memory if it was not needed. However, this behavior was removed in fork mode in commit aafc05d. Oh. The commit message makes no mention

040_pg_createsubscriber.pl is slow and unstable (was Re: speed up a logical replica setup)

2024-07-29 Thread Robert Haas
On Sun, Jun 30, 2024 at 2:40 PM Tom Lane wrote: > In hopes of moving things along as we approach the v18 branch, > I went ahead and pushed Kuroda-san's patches (with a bit of > further editorialization). AFAICS that allows closing out > the concerns raised by Noah, so I've marked that open item >

Re: Detect double-release of spinlock

2024-07-29 Thread Andres Freund
Hi, Partially replying here to an email on -committers [1]. On 2024-07-29 13:57:02 -0400, Tom Lane wrote: > Andres Freund writes: > > However, I still don't think it's a problem to assert that the lock is held > > in > > in the unlock "routine". As mentioned before, the spinlock implementation

Re: Detect double-release of spinlock

2024-07-29 Thread Andres Freund
Hi, On 2024-07-29 21:00:35 +0300, Heikki Linnakangas wrote: > On 29/07/2024 20:48, Andres Freund wrote: > > On 2024-07-29 13:25:22 -0400, Tom Lane wrote: > > > Heikki Linnakangas writes: > > > > Yeah I'm not worried about that at all. Also, the assert is made when > > > > you have already release

Re: Detach shared memory in Postmaster child if not needed

2024-07-29 Thread Robert Haas
On Mon, Jul 29, 2024 at 5:57 AM Rui Zhao wrote: > Prior to PG16, postmaster children would manually detach from shared memory > if it was not needed. However, this behavior was removed in fork mode in > commit aafc05d. Oh. The commit message makes no mention of that. I wonder whether it was inadv

Re: Interrupts vs signals

2024-07-29 Thread Robert Haas
On Mon, Jul 29, 2024 at 1:24 PM Tom Lane wrote: > Robert Haas writes: > > I wonder how this works right now. Is there something that limits the > > number of authentication requests that can be in flight concurrently, > > or is it completely uncapped (except by machine resources)? > > The former.

Re: Detect double-release of spinlock

2024-07-29 Thread Heikki Linnakangas
On 29/07/2024 20:48, Andres Freund wrote: On 2024-07-29 13:25:22 -0400, Tom Lane wrote: Heikki Linnakangas writes: Yeah I'm not worried about that at all. Also, the assert is made when you have already released the spinlock; you are already out of the critical section. Not in the patch Andre

Re: Optimize mul_var() for var1ndigits >= 8

2024-07-29 Thread Joel Jacobson
On Mon, Jul 29, 2024, at 16:42, Joel Jacobson wrote: > New results with less noise below. > > Pardon the exceeding of 80 chars line width, > but felt important to include commit hash and relative delta. > > > ndigits|rate| change | accum | commit | > su

Re: Detect double-release of spinlock

2024-07-29 Thread Tom Lane
Andres Freund writes: > However, I still don't think it's a problem to assert that the lock is held in > in the unlock "routine". As mentioned before, the spinlock implementation > itself has never followed the "just straight line code" rule that users of > spinlocks are supposed to follow. Yeah,

Re: Detect double-release of spinlock

2024-07-29 Thread Andres Freund
Hi, On 2024-07-29 13:25:22 -0400, Tom Lane wrote: > Heikki Linnakangas writes: > > Yeah I'm not worried about that at all. Also, the assert is made when > > you have already released the spinlock; you are already out of the > > critical section. > > Not in the patch Andres posted. Which seems

Re: Remove dead code generation tools in src/backend/utils/mb/

2024-07-29 Thread Heikki Linnakangas
On 29/07/2024 17:15, Tom Lane wrote: Heikki Linnakangas writes: These programs in src/backend/utils/mb/ are unused, and have been unused and unusable since 2003: iso.c win1251.c win866.c Attached patch removes them. See commit message for a little more detailed analysis. +1. Seems to have be

Re: Detect double-release of spinlock

2024-07-29 Thread Tom Lane
Heikki Linnakangas writes: > Yeah I'm not worried about that at all. Also, the assert is made when > you have already released the spinlock; you are already out of the > critical section. Not in the patch Andres posted. regards, tom lane

Re:Detach shared memory in Postmaster child if not needed

2024-07-29 Thread Rui Zhao
Thanks for your reply. > Thanks for the patch. How do you estimate its performance impact? In my patch, ony child processes that set (child_process_kinds[child_type].shmem_attach == false) will detach from shared memory. Child processes with B_STANDALONE_BACKEND and B_INVALID don't call postmaster_

Re: Interrupts vs signals

2024-07-29 Thread Tom Lane
Robert Haas writes: > I wonder how this works right now. Is there something that limits the > number of authentication requests that can be in flight concurrently, > or is it completely uncapped (except by machine resources)? The former. IIRC, the postmaster won't spawn more than 2X max_connecti

Re: Interrupts vs signals

2024-07-29 Thread Heikki Linnakangas
On 29/07/2024 19:56, Robert Haas wrote: On Wed, Jul 24, 2024 at 8:58 AM Heikki Linnakangas wrote: a) assign every child process a PGPROC entry, and make postmaster responsible for assigning them like you suggest. We'll need more PGPROC entries, because currently a process doesn't reserve one un

Re: Detect double-release of spinlock

2024-07-29 Thread Heikki Linnakangas
On 29/07/2024 19:51, Andres Freund wrote: On 2024-07-29 09:40:26 -0700, Andres Freund wrote: On 2024-07-29 12:33:13 -0400, Tom Lane wrote: Andres Freund writes: On 2024-07-29 11:31:56 -0400, Tom Lane wrote: There was some recent discussion about getting rid of --disable-spinlocks on the grou

Re: Interrupts vs signals

2024-07-29 Thread Robert Haas
On Wed, Jul 24, 2024 at 8:58 AM Heikki Linnakangas wrote: > a) assign every child process a PGPROC entry, and make postmaster > responsible for assigning them like you suggest. We'll need more PGPROC > entries, because currently a process doesn't reserve one until > authentication has happened. Or

Re: CREATE MATERIALIZED VIEW

2024-07-29 Thread Dagfinn Ilmari Mannsåker
Nathan Bossart writes: > Committed. Thanks! - ilmari

Detect double-release of spinlock

2024-07-29 Thread Andres Freund
Hi, On 2024-07-29 09:40:26 -0700, Andres Freund wrote: > On 2024-07-29 12:33:13 -0400, Tom Lane wrote: > > Andres Freund writes: > > > On 2024-07-29 11:31:56 -0400, Tom Lane wrote: > > >> There was some recent discussion about getting rid of > > >> --disable-spinlocks on the grounds that nobody w

Re: CREATE MATERIALIZED VIEW

2024-07-29 Thread Nathan Bossart
Committed. -- nathan

Re: Incremental backup from a streaming replication standby fails

2024-07-29 Thread Robert Haas
On Fri, Jul 26, 2024 at 4:13 PM Alexander Korotkov wrote: > Great! Should we mark the corresponding v17 open item as closed? Done. -- Robert Haas EDB: http://www.enterprisedb.com

Re: Assertion failure with summarize_wal enabled during pg_createsubscriber

2024-07-29 Thread Robert Haas
On Fri, Jul 26, 2024 at 4:10 PM Alexander Korotkov wrote: > 0002 could also use pg_indent and pgperltidy. And I have couple other > notes regarding 0002. As Tom said elsewhere, we don't have a practice of requiring perltidy for every commit, and I normally don't bother. The tree is pgindent-clea

Re: tls 1.3: sending multiple tickets

2024-07-29 Thread Robert Haas
On Mon, Jul 29, 2024 at 5:57 AM Daniel Gustafsson wrote: > I'm sure there are more interactions with OpenSSL, and TLS in general, which > warrants better comments but the attached takes a stab at the two examples in > question here to get started (to avoid perfect get in the way of progress). +1.

Re: Remove dead code generation tools in src/backend/utils/mb/

2024-07-29 Thread Andreas Karlsson
On 7/29/24 5:00 PM, Alexander Lakhin wrote: I also wonder whether src/test/locale/ still makes sense; does anyone run those tests (I could not run a single one on a quick attempt)? I was actually wondering about those yesterday and they should probably be removed (or fixed if anyone can see a

Re: Remove dead code generation tools in src/backend/utils/mb/

2024-07-29 Thread Alexander Lakhin
Hello Tom and Heikki, 29.07.2024 17:15, Tom Lane wrote: Heikki Linnakangas writes: These programs in src/backend/utils/mb/ are unused, and have been unused and unusable since 2003: iso.c win1251.c win866.c Attached patch removes them. See commit message for a little more detailed analysis. +1

Re: Virtual generated columns

2024-07-29 Thread Peter Eisentraut
On 22.07.24 12:53, jian he wrote: another bug? drop table gtest12v; CREATE TABLE gtest12v (a int PRIMARY KEY, b bigint, c int GENERATED ALWAYS AS (b * 2) VIRTUAL); insert into gtest12v (a,b) values (11, 22147483647); table gtest12v; insert ok, but select error: ERROR: integer out of range sho

Re: Optimize mul_var() for var1ndigits >= 8

2024-07-29 Thread Joel Jacobson
On Mon, Jul 29, 2024, at 02:23, Joel Jacobson wrote: > Then, I've used sched_setaffinity() from to ensure the > benchmark run on CPU core id 31. I fixed a bug in my measure function, I had forgot to reset affinity after each benchmark, so the PostgreSQL backend continued to use the core even aft

Re: Remove dead code generation tools in src/backend/utils/mb/

2024-07-29 Thread Tom Lane
Heikki Linnakangas writes: > These programs in src/backend/utils/mb/ are unused, and have been unused > and unusable since 2003: > iso.c > win1251.c > win866.c > Attached patch removes them. See commit message for a little more > detailed analysis. +1. Seems to have been my oversight in 4c3c8c

Re: Make query cancellation keys longer

2024-07-29 Thread Heikki Linnakangas
On 24/07/2024 19:12, Heikki Linnakangas wrote: On 04/07/2024 15:20, Jelte Fennema-Nio wrote: On Thu, 4 Jul 2024 at 12:32, Heikki Linnakangas wrote: We currently don't do any locking on the ProcSignal array. For query cancellations, that's good because a query cancel packet is processed without

RE: Conflict detection and logging in logical replication

2024-07-29 Thread Zhijie Hou (Fujitsu)
On Monday, July 29, 2024 6:59 PM Dilip Kumar wrote: > > On Mon, Jul 29, 2024 at 11:44 AM Zhijie Hou (Fujitsu) > wrote: > > > > I was going through v7-0001, and I have some initial comments. Thanks for the comments ! > > @@ -536,11 +542,9 @@ ExecCheckIndexConstraints(ResultRelInfo > *resultRe

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-07-29 Thread Peter Eisentraut
I have some comments about the first three patches, that deal with memory management. v24-0001-Revert-ECPG-s-use-of-pnstrdup.patch This looks right. I suppose another approach would be to put a full replacement for strndup() into src/port/. But since there is currently only one user, and mo

Re: Conflict detection and logging in logical replication

2024-07-29 Thread shveta malik
On Mon, Jul 29, 2024 at 9:31 AM Amit Kapila wrote: > > On Fri, Jul 26, 2024 at 4:28 PM shveta malik wrote: > > > > On Fri, Jul 26, 2024 at 3:56 PM Amit Kapila wrote: > > > > > > > > One more thing we need to consider is whether we should LOG or ERROR > > > for update/delete_differ conflicts. If

Re: Detach shared memory in Postmaster child if not needed

2024-07-29 Thread Aleksander Alekseev
Hi Rui, > Prior to PG16, postmaster children would manually detach from shared memory > if it was not needed. However, this behavior was removed in fork mode in > commit aafc05d. > > Detaching shared memory when it is no longer needed is beneficial, as > postmaster children (like syslogger) don't

Re: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-29 Thread Amit Kapila
On Thu, Jul 25, 2024 at 5:56 PM Kirill Reshke wrote: > > > +/* > > + * If the tuple to be modified could not be found, a log message is > > emitted. > > + */ > > +static void > > +report_tuple_not_found(CmdType cmd, Relation targetrel, bool is_partition) > > +{ > > + Assert(cmd == CMD_UPDATE || c

Re: Fix smgrtruncate code comment.

2024-07-29 Thread Heikki Linnakangas
On 29/07/2024 13:50, Kirill Reshke wrote: Today I was busy rebasing my Greenplum-related Extendable SMGR patches on Cloudberry, and I faced some conflicts. While resolving them I noticed code & comments inconsistency in smgr.c in smgrtruncate function, which tracks down to c5315f4f44843c20ada876f

Remove dead code generation tools in src/backend/utils/mb/

2024-07-29 Thread Heikki Linnakangas
These programs in src/backend/utils/mb/ are unused, and have been unused and unusable since 2003: iso.c win1251.c win866.c Attached patch removes them. See commit message for a little more detailed analysis. -- Heikki Linnakangas Neon (https://neon.tech)From 2c2c82757749534bd47348e5385cbb2b8

Re: Conflict detection and logging in logical replication

2024-07-29 Thread Dilip Kumar
On Mon, Jul 29, 2024 at 11:44 AM Zhijie Hou (Fujitsu) wrote: > I was going through v7-0001, and I have some initial comments. @@ -536,11 +542,9 @@ ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, ExprContext *econtext; Datum values[INDEX_MAX_KEYS]; bool isnull[

Re: [PATCH] Add crc32(text) & crc32(bytea)

2024-07-29 Thread Aleksander Alekseev
Hi Nathan, > I don't think adding crc32c() would sufficiently increase the scope. We'd > use the existing implementations for both crc32() and crc32c(). And > besides, this could be useful for adding tests for that code. > > +crc32 ( text ) > > Do we need a version of the function that t

Re: why is pg_upgrade's regression run so slow?

2024-07-29 Thread Andrew Dunstan
On 2024-07-29 Mo 4:00 AM, Alexander Lakhin wrote: Hello Andrew, 28.07.2024 22:43, Andrew Dunstan wrote: Maybe, IDK. Meanwhile, I disabled "debug_parallel_query = regress" on HEAD for fairywren and drongo -  fairwren has just gone green, and I expect drongo will when it reports in a few hou

Fix smgrtruncate code comment.

2024-07-29 Thread Kirill Reshke
Today I was busy rebasing my Greenplum-related Extendable SMGR patches on Cloudberry, and I faced some conflicts. While resolving them I noticed code & comments inconsistency in smgr.c in smgrtruncate function, which tracks down to c5315f4f44843c20ada876fdb0d0828795dfbdf5. In this commit, smgr_fsm_

Re: Logical Replication of sequences

2024-07-29 Thread vignesh C
On Thu, 25 Jul 2024 at 15:41, shveta malik wrote: > > On Thu, Jul 25, 2024 at 12:08 PM shveta malik wrote: > > > > On Thu, Jul 25, 2024 at 9:06 AM vignesh C wrote: > > > > > > The attached v20240725 version patch has the changes for the same. > > > > Thank You for addressing the comments. Please

Re: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-29 Thread Amit Kapila
On Thu, Jul 25, 2024 at 4:00 PM Zhijie Hou (Fujitsu) wrote: > > When reviewing the code in logical/worker.c, I noticed that when applying a > cross-partition update action, it scans the old partition twice. > I am attaching the patch 0001 to remove this duplicate table scan. > > The test shows tha

Re: Add ALL_CANDIDATES option to EXPLAIN

2024-07-29 Thread Ashutosh Bapat
On Fri, Jul 26, 2024 at 10:47 PM Robert Haas wrote: > > On Fri, Jul 26, 2024 at 12:59 PM Anthonin Bonnefoy > wrote: > > I have a prototype for an ALL_CANDIDATES option for EXPLAIN. The goal > > of this option is to print all plan candidates instead of only the > > cheapest plan. It will output th

Detach shared memory in Postmaster child if not needed

2024-07-29 Thread Rui Zhao
Prior to PG16, postmaster children would manually detach from shared memory if it was not needed. However, this behavior was removed in fork mode in commit aafc05d. Detaching shared memory when it is no longer needed is beneficial, as postmaster children (like syslogger) don't wish to take any ris

Re: tls 1.3: sending multiple tickets

2024-07-29 Thread Daniel Gustafsson
> On 26 Jul 2024, at 20:29, Robert Haas wrote: > One of my chronic complaints about comments is > that they should say why we're doing things, not what we're doing. Agreed. > I feel like any > place where we are doing X because of some property of a non-PG code > base with which a particular re

Re: Conflict detection and logging in logical replication

2024-07-29 Thread Amit Kapila
On Mon, Jul 29, 2024 at 11:44 AM Zhijie Hou (Fujitsu) wrote: > > On Friday, July 26, 2024 7:34 PM Amit Kapila wrote: > > > > On Thu, Jul 25, 2024 at 4:12 PM Amit Kapila > > wrote: > > > > > > A few more comments: > > Thanks for the comments. > > > 1. > > For duplicate key, the patch reports conf

Re: why is pg_upgrade's regression run so slow?

2024-07-29 Thread Alexander Lakhin
Hello Andrew, 28.07.2024 22:43, Andrew Dunstan wrote: Maybe, IDK. Meanwhile, I disabled "debug_parallel_query = regress" on HEAD for fairywren and drongo -  fairwren has just gone green, and I expect drongo will when it reports in a few hours. I'm at a loss for an explanation. I'm observi

Re: Visibility bug with prepared transaction with subtransactions on standby

2024-07-29 Thread a.kozhemyakin
Hi, I'm trying to run REL_13_STABLE recovey tests for windows and I get the error waiting for server to shut down.. failed pg_ctl: server does not shut down # pg_ctl stop failed: 256 # Stale postmaster.pid file for node "paris": PID 1868 no longer exists Bail out! pg_ctl stop failed

Re: Pgoutput not capturing the generated columns

2024-07-29 Thread Peter Smith
Thanks for the patch updates. Here are my review comments for v21-0001. I think this patch is mostly OK now except there are still some comments about the TAP test. == Commit Message 0. Using Create Subscription: CREATE SUBSCRIPTION sub2_gen_to_gen CONNECTION '$publisher_connstr' PUBLICATIO

Re: Use pgBufferUsage for block reporting in analyze

2024-07-29 Thread Anthonin Bonnefoy
On Sat, Jul 27, 2024 at 12:35 AM Masahiko Sawada wrote: > An alternative idea would > be to pass StringInfo to AcquireSampleRowsFunc() so that callback can > write its messages there. This is somewhat similar to what we do in > the EXPLAIN command (cf, ExplainPropertyText() etc). It could be too >