Re: Built-in Raft replication

2025-04-15 Thread Andrey Borodin
> On 16 Apr 2025, at 09:33, Ashutosh Bapat wrote: > > In my experience, the load of managing hundreds of replicas which all > participate in RAFT protocol becomes more than regular transaction > load. So making every replica a RAFT participant will affect the > ability to deploy hundreds of re

Re: Conflict detection for update_deleted in logical replication

2025-04-15 Thread shveta malik
On Wed, Mar 26, 2025 at 4:17 PM Zhijie Hou (Fujitsu) wrote: > > Here's a rebased version of the patch series. > Thanks Hou-San for the patches. I am going through this long thread and patches. One doubt I have is whenever there is a chance of conflict-slot update (either xmin or possibility of it

Re: Built-in Raft replication

2025-04-15 Thread Ashutosh Bapat
On Wed, Apr 16, 2025 at 10:29 AM Andrey Borodin wrote: > > > We may build an extension which > > has a similar role in PostgreSQL world as zookeeper in Hadoop. > > Patroni, pg_consul and others already use zookeeper, etcd and similar systems > for consensus. > Is it any better as extension than a

Re: recoveryCheck test failure on flaviventris

2025-04-15 Thread Richard Guo
On Wed, Apr 16, 2025 at 11:54 AM Richard Guo wrote: > I noticed this recoveryCheck test failure on flaviventris after > pushing commit 3b35f9a4c (Fix an incorrect check in get_memoize_path). > > ### Reloading node "standby" > # Running: pg_ctl --pgdata xxx/pgdata reload > server signaled > ### Res

Re: pg_dump --if-exists --clean when drop index that is partition of a partitioned index

2025-04-15 Thread jian he
On Wed, Apr 16, 2025 at 6:51 AM Tom Lane wrote: > > Or we could do what Jian suggested and just not emit any dropStmt > for child indexes. I continue to fear that that will have > undesirable side-effects, but I have to admit that I'm not sure > what. The fact that the backend will automatically

Re: transforms [was Re: FmgrInfo allocation patterns (and PL handling as staged programming)]

2025-04-15 Thread Tom Lane
Chapman Flack writes: > On 04/15/25 10:52, Tom Lane wrote: >> The problem from a PL's standpoint is "given this input or output >> of type FOO, should I transform it, and if so using what?". So >> the starting point has to be a type not a transform. > Perhaps the efficiency argument is really "s

Re: recoveryCheck test failure on flaviventris

2025-04-15 Thread Alexander Lakhin
Hello Richard, 16.04.2025 06:05, Richard Guo wrote: On Wed, Apr 16, 2025 at 11:54 AM Richard Guo wrote: I noticed this recoveryCheck test failure on flaviventris after pushing commit 3b35f9a4c (Fix an incorrect check in get_memoize_path). ... I'm not convinced this failure is related to 3b35f9a

Re: Built-in Raft replication

2025-04-15 Thread Andrey Borodin
> On 16 Apr 2025, at 04:19, Tom Lane wrote: > > feebly, and seems to have a bus factor of 1. Another example is the > Spencer regex engine; we thought we could depend on Tcl to be the > upstream for that, but for a decade or more they've acted as though > *we* are the upstream. I think it's

Re: Built-in Raft replication

2025-04-15 Thread Tom Lane
Andrey Borodin writes: > I think it's what Konstantin is proposing. To have our own Raft > implementation, without dependencies. Hmm, OK. I thought that the proposal involved relying on some existing code, but re-reading the thread that was said nowhere. Still, that moves it from a large proje

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-04-15 Thread Thomas Munro
On Tue, Apr 15, 2025 at 5:44 AM Robert Haas wrote: > On Thu, Apr 10, 2025 at 11:15 PM Thomas Munro wrote: > > The new streaming BHS isn't just issuing probabilistic hints about > > future access obtained from a second iterator. It has just one shared > > iterator connected up to the workers' Rea

Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

2025-04-15 Thread Fujii Masao
On 2025/04/15 23:37, Tom Lane wrote: Fujii Masao writes: Thanks for the report and patch! It looks good to me. Agreed. Since this issue exists in the back branches, the patch needs be back-patched to all supported versions. I doubt it's worth the trouble and buildfarm cycles to back-pa

Re: Built-in Raft replication

2025-04-15 Thread Ashutosh Bapat
On Wed, Apr 16, 2025 at 9:37 AM Andrey Borodin wrote: > > My view is what Konstantin wants is automatic replication topology > management. For some reason this technology is called HA, DCS, Raft, Paxos > and many other scary words. But basically it manages primary_conn_info of > some nodes to p

Re: Built-in Raft replication

2025-04-15 Thread Andrey Borodin
> On 16 Apr 2025, at 11:18, Ashutosh Bapat wrote: > > Having only some of the nodes act as DCS > and others purely PostgreSQL nodes will reduce waste of resources. But typically you need more DCS nodes than PostgreSQL nodes. Did you mean “Having only some of nodes act as PostgreSQL and others

Re: not null constraints, again

2025-04-15 Thread Tender Wang
Alvaro Herrera 于2025年4月16日周三 03:12写道: > On 2025-Apr-15, Tender Wang wrote: > > > I thought further about the lockmode calling find_inheritance_children > > in ATPrepAddPrimaryKey. > > What we do here? We first get oids of children, then check the if the > > column of children has marked not-null,

Re: Built-in Raft replication

2025-04-15 Thread Ashutosh Bapat
On Wed, Apr 16, 2025 at 11:57 AM Andrey Borodin wrote: > > > > > On 16 Apr 2025, at 11:18, Ashutosh Bapat > > wrote: > > > > Having only some of the nodes act as DCS > > and others purely PostgreSQL nodes will reduce waste of resources. > > But typically you need more DCS nodes than PostgreSQL n

Re: dispchar for oauth_client_secret

2025-04-15 Thread Jelte Fennema-Nio
On Wed, 16 Apr 2025 at 02:03, Jacob Champion wrote: > Thank you for saying something; I'd hallucinated that srvoptions was > limited to the server owner, and that's not true. It's pg_user_mapping > that has the protection. FWIW, I have some ideas on being able to store secrets in a server in a sa

Re: Built-in Raft replication

2025-04-15 Thread Andrey Borodin
> On 16 Apr 2025, at 09:26, Tom Lane wrote: > > Andrey Borodin writes: >> I think it's what Konstantin is proposing. To have our own Raft >> implementation, without dependencies. > > Hmm, OK. I thought that the proposal involved relying on some existing > code, but re-reading the thread th

Re: Built-in Raft replication

2025-04-15 Thread Kirill Reshke
On Wed, 16 Apr 2025 at 10:25, Andrey Borodin wrote: > > I think I can provide some reasons why it cannot be neither extension, nor > any part running within postmaster reign. > > 1. When joining cluster, there’s not PGDATA to run postmaster on top of it. You can join the cluster on pg_basebackup

Re: Fundamental scheduling bug in parallel restore of partitioned tables

2025-04-15 Thread Tom Lane
Ashutosh Bapat writes: > On Mon, Apr 14, 2025 at 11:14 PM Tom Lane wrote: >> This is disastrous for assorted reasons. The ALTER ADD CONSTRAINT >> command might fail outright if we've loaded data for the referencing >> table but not the referenced table. > There's a comment in getConstraints() >

Re: not null constraints, again

2025-04-15 Thread Alvaro Herrera
On 2025-Apr-15, Tender Wang wrote: > I thought further about the lockmode calling find_inheritance_children > in ATPrepAddPrimaryKey. > What we do here? We first get oids of children, then check the if the > column of children has marked not-null, if not, report an error. > No operation here on c

dispchar for oauth_client_secret

2025-04-15 Thread Noah Misch
commit b3f0be7 wrote: + {"oauth_scope", NULL, NULL, NULL, + "OAuth-Scope", "", 15, + offsetof(struct pg_conn, oauth_scope)}, The field containing "" is documented as follows: char *dispchar; /* Indicates how to display this field in a

Re: dispchar for oauth_client_secret

2025-04-15 Thread Jacob Champion
On Tue, Apr 15, 2025 at 12:14 PM Noah Misch wrote: > I suspect this should use .dispchar="*" to encourage UIs to display > oauth_client_secret like a password field. Thoughts? Hmm, from a UI perspective I agree. (The builtin flow targets "public clients", where secrets are discouraged and/or und

Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2025-04-15 Thread David Rowley
On Tue, 15 Apr 2025 at 21:44, Ilia Evdokimov wrote: > Wrapping the line in costs or verbose would help with test stability, but > doing that only to simplify test output doesn't look like the right reason. > Maybe it makes more sense to mask these values in other tests that use > Memoize too. W

Re: pgsql: Non text modes for pg_dumpall, correspondingly change pg_restore

2025-04-15 Thread Álvaro Herrera
On 2025-Apr-15, Mahendra Singh Thalor wrote: > I took this patch and did some testing. Patch looks good to me. Hello, thank you very much for looking. > I was not able to use "git am" in my setup due to CR's in patch but no > warning in the patch when I used "patch -p". Hmm, don't blame me; rat

Re: A modest proposal: make parser/rewriter/planner inputs read-only

2025-04-15 Thread Tom Lane
Andrei Lepikhov writes: > But what is the way you are proposing here? Do you mean that one more > entity will be explicitly introduced: a transformed parse tree? No, I wasn't thinking of adding new concepts, just saying that the inputs to certain operations need to be treated as read-only. What

Re: Built-in Raft replication

2025-04-15 Thread Konstantin Osipov
* Greg Sabino Mullane [25/04/15 18:08]: > > If anyone is working on Raft already I'd be happy to discuss > > the details. I am fairly new to the PostgreSQL hackers ecosystem > > so cautious of starting work in isolation/knowing there is no > > interest in accepting the feature into the trunk. > >

Re: A modest proposal: make parser/rewriter/planner inputs read-only

2025-04-15 Thread Tom Lane
Richard Guo writes: > On Sun, Apr 6, 2025 at 1:46 AM Tom Lane wrote: >> Years ago we fixed the executor to treat its input Plan trees as >> read-only. It seems like we really ought to do the same for these >> upstream subsystems. Surely, whatever benefit we get from changing >> Node contents in

Re: Fix a resource leak (src/backend/utils/adt/rowtypes.c)

2025-04-15 Thread Ranier Vilela
Em seg., 14 de abr. de 2025 às 18:11, Tom Lane escreveu: > Robert Haas writes: > > On Sun, Apr 13, 2025 at 7:34 PM Ranier Vilela > wrote: > >> The function *record_in* has a new report about resource leak. > >> I think Coverity is right. > > > I agree, for small values of "right". The memory is

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-15 Thread Tom Lane
Chapman Flack writes: > On 04/06/25 22:37, Tom Lane wrote: >> BTW, I feel a little uncomfortable with the idea that we're adding >> dependencies on objects that are explicitly mentioned nowhere in the >> pg_proc entry. > Pursuing that idea a bit further, was there a compelling original reason > t

Re: Fundamental scheduling bug in parallel restore of partitioned tables

2025-04-15 Thread Ashutosh Bapat
On Mon, Apr 14, 2025 at 11:14 PM Tom Lane wrote: > > I wrote: > > Here's a draft patch for this. It seems to fix the problem in > > light testing. > > I realized that the "repro" I had for this isn't testing the same > thing that Dimitrios is seeing; what it is exposing looks more like > a bug or

Re: pgsql: Add function to get memory context stats for processes

2025-04-15 Thread Robert Haas
On Thu, Apr 10, 2025 at 4:05 PM Andres Freund wrote: > I don't know of existing discussion, but it seems rather fundamental to me - > if either DSA or memory contexts could be inconsistent at a CFI(), how could > it possibly be safe to interrupt at that point? After all, after an error you > need

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-15 Thread Jacob Champion
On Tue, Apr 15, 2025 at 5:31 AM Peter Eisentraut wrote: > On 10.04.25 01:08, Jacob Champion wrote: > > Christoph noted that this was also confusing from the packaging side, > > earlier, Since Christoph has withdrawn the request, I will drop -0002. However, I'll go ahead and put some of my opinio

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-15 Thread Robert Haas
On Tue, Apr 15, 2025 at 8:32 AM Peter Eisentraut wrote: > On 10.04.25 01:08, Jacob Champion wrote: > > Christoph noted that this was also confusing from the packaging side, > > earlier, and Daniel proposed -Doauth-client/--with-oauth-client as the > > feature switch name instead. Any objections? U

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-15 Thread Jacob Champion
On Tue, Apr 15, 2025 at 11:57 AM Christoph Berg wrote: > What made me reconsider was Peter saying that what defines the blast > radius of some feature is usually the extra dependency pulled in. If > you don't like tracking OpenSSL problems, build without it. If you > don't like libcurl, build with

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-15 Thread Jacob Champion
On Tue, Apr 15, 2025 at 12:21 PM Robert Haas wrote: > I also don't mind being wrong, of course. But I think it's better to > bet on making this like other things and then change strategy if that > doesn't work out, rather than starting out by making this different > from other things. Works for m

Re: not null constraints, again

2025-04-15 Thread Tom Lane
Alvaro Herrera writes: > However, I've also been looking at this and realized that this code can > have different structure which may allows us to skip the > find_inheritance_children() altogether. The reason is that we already > scan the parent's list of columns searching for not-null constraint

Re: Non-text mode for pg_dumpall

2025-04-15 Thread Mahendra Singh Thalor
On Sat, 5 Apr 2025 at 01:41, Andrew Dunstan wrote: > > > On 2025-04-04 Fr 5:12 AM, Mahendra Singh Thalor wrote: > > On Fri, 4 Apr 2025 at 13:52, Mahendra Singh Thalor wrote: > > On Fri, 4 Apr 2025 at 01:17, Andrew Dunstan wrote: > > On 2025-04-01 Tu 1:59 AM, Mahendra Singh Thalor wrote: > > On M

Re: Non-text mode for pg_dumpall

2025-04-15 Thread Andrew Dunstan
On 2025-04-15 Tu 2:30 PM, Mahendra Singh Thalor wrote: Hi Andrew, I did some refactoring to find out dump file extensions(.dmp/.tar etc) in pg_restore. With the attached patch, we will not try to find out file extension with each database, rather we will find out before the loop. Here, I am at

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-15 Thread Christoph Berg
Re: Jacob Champion > But there's no connection between "libcurl" and "OAuth Device > Authorization flow" in anyone's mind except the people who have worked > on that feature. Fwiw that was exactly the reason I originally voiced the idea to rename. > But let me turn this around, because we current

Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

2025-04-15 Thread Tom Lane
Fujii Masao writes: > Thanks for the report and patch! It looks good to me. Agreed. > Since this issue exists in the back branches, > the patch needs be back-patched to all supported versions. I doubt it's worth the trouble and buildfarm cycles to back-patch, since this should be a can't-happen

Re: Built-in Raft replication

2025-04-15 Thread Greg Sabino Mullane
On Mon, Apr 14, 2025 at 1:15 PM Konstantin Osipov wrote: > If anyone is working on Raft already I'd be happy to discuss > the details. I am fairly new to the PostgreSQL hackers ecosystem > so cautious of starting work in isolation/knowing there is no > interest in accepting the feature into the t

Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2025-04-15 Thread Robert Haas
On Mon, Apr 14, 2025 at 8:23 PM David Rowley wrote: > Maybe we could compress the text output a bit with: > > "Estimates: capacity=N distinct keys=N hit ratio=N.N%" Sure, that works for me. > If we get it that compact, maybe lookups could fit in there too, i.e.: > > "Estimates: capacity=N distin

RE: AIX support

2025-04-15 Thread Srirama Kucherlapati
Hi Team, Please find the attached diff with the latest changes. The diff file changes that were done for memset and spinlock, are modified on top of the previous patch. New changes for review: 0001-AIX-support.tas.memset.diffs Previous patch: 0001-AIX-support.v8.patch >> diff --git a/src/includ

Re: pg_dump --if-exists --clean when drop index that is partition of a partitioned index

2025-04-15 Thread jian he
On Tue, Apr 15, 2025 at 1:45 PM Pavel Stehule wrote: >> >> seems pretty easy to fix. >> we only need dropStmt when IndxInfo->parentidx oid is invalid. >> >> +if (!OidIsValid(indxinfo->parentidx)) >> +appendPQExpBuffer(delq, "DROP INDEX %s;\n", qqindxname); > > > I don't think i

Re: Fundamental scheduling bug in parallel restore of partitioned tables

2025-04-15 Thread Dimitrios Apostolou
On 15 April 2025 18:18:41 CEST, Tom Lane wrote: >Dimitrios Apostolou writes: >> I only got the "ERROR: deadlock detected" message once, with pg_restore >> compiled from master branch. > >Oh, hmm ... do you recall just when on the master branch? I'm >wondering if it was before or after 14e87ffa5

Re: rounding_up

2025-04-15 Thread Daria Shanina
Hi, Tom! > Round-to-nearest-even is a well-respected rule Yes, you're convinced me! I can’t argue with IEEE 754 =) And, of course, can’t break compatibility. Best regards, Daria Shanina пн, 14 апр. 2025 г. в 17:26, Tom Lane : > Christoph Moench-Tegeder writes: > > ## Daria Shanina (vilensip

Re: rounding_up

2025-04-15 Thread Daria Shanina
Hi, Christoph! You wrote a very interesting answer. > First question would be "which round rule?" I mean rounding up “as at school”, but there are nuances in programming. > https://www.postgresql.org/docs/current/functions-math.html Thanks a lot for the link to the doc! > you set it to with

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-15 Thread Jacob Champion
On Mon, Apr 14, 2025 at 1:17 PM Jacob Champion wrote: > I believe so. I'm in the middle of the .pc stuff right now; v6 should > have the fixes as long as I don't get stuck. Done in v6-0001. I think this is now architecturally complete, so if reviewers are happy I can work on docs and the commit m

Re: Fix a resource leak (src/backend/utils/adt/rowtypes.c)

2025-04-15 Thread Robert Haas
On Sun, Apr 13, 2025 at 7:34 PM Ranier Vilela wrote: > CID 1608916: (#1 of 1): Resource leak (RESOURCE_LEAK) > 52. leaked_storage: Variable buf going out of scope leaks the storage > buf.data points to. > > The function *record_in* has a new report about resource leak. > I think Coverity is right

Re: New committer: Jacob Champion

2025-04-15 Thread Andrey Borodin
> On 12 Apr 2025, at 01:26, Jonathan S. Katz wrote: > > Please join us in wishing Jacob much success and few reverts! Congratulations, Jacob! Best regards, Andrey Borodin.

Re: someone else to do the list of acknowledgments

2025-04-15 Thread Aleksander Alekseev
Hi, >> The whole thing might take about 20 to 30 hours wall-clock time. > > After this dev cycle, things with a defined end to them hold a greater > attraction than they did previously. > >> >> So, there is some time to think about this. Please discuss here if >> you're interested or have questi

Re: Support for runtime parameters in injection points, for AIO tests

2025-04-15 Thread Andres Freund
Hi, On 2025-04-14 16:46:22 +0900, Michael Paquier wrote: > While reading the AIO code I have noticed that the way it uses > injection points is limited by the fact that we don't have support for > runtime parameters in the existing injection point facility. Yep. > The code is shaped with two se

Re: Doc: Move standalone backup section, mention -X argument

2025-04-15 Thread Benoit Lobréau
On 3/16/25 2:19 PM, vignesh C wrote: I noticed that Alvaro's comment from [1] is not yet addressed, I have changed the status of commitfest entry to Waiting on Author, please address them and change the status back to Needs review. [1] - https://www.postgresql.org/message-id/202502101154.bmb536n

Re: [Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql

2025-04-15 Thread Tom Lane
Greg Sabino Mullane writes: > On Tue, Apr 15, 2025 at 4:57 AM Srinath Reddy wrote: >> - There's currently no native `\d`-style way to explore which tables are >> using a given TAM. > Perhaps there could be a more generic table-filtering mechanism for \d, but > carving something out for such a ni

Re: Wrong security context for deferred triggers?

2025-04-15 Thread Noah Misch
On Thu, Jan 23, 2025 at 07:28:19PM +0100, Laurenz Albe wrote: > On Thu, 2025-01-23 at 12:30 -0500, Tom Lane wrote: > > Pushed with some cosmetic adjustments > > Thank you! commit 01463e1 wrote: > +NOTICE: I am regress_groot Let's not incur trivially-avoidable trademark risks (https://google.com

RE: Conflict detection for update_deleted in logical replication

2025-04-15 Thread Hayato Kuroda (Fujitsu)
Dear Hou, Thanks for updating the patch! I can finally come back to the thread. Regarding the max_retain_conflict_duration, I prefer GUC approach because it has already had a mechanism for converting unit: subscription option does not have it. Below part contains my comments: 01. check_new_clu

Re: Fundamental scheduling bug in parallel restore of partitioned tables

2025-04-15 Thread Dimitrios Apostolou
On Mon, 14 Apr 2025, Tom Lane wrote: I wrote: Here's a draft patch for this. It seems to fix the problem in light testing. I realized that the "repro" I had for this isn't testing the same thing that Dimitrios is seeing; what it is exposing looks more like a bug or at least a behavioral chan

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-15 Thread Christoph Berg
Re: Peter Eisentraut > But worse, what you are hiding is the information what dependencies > you are pulling in, which is the actual reason for the options. (If there > was no external dependency, there would be no option at all.) > > This seems unnecessarily complicated and inconsistent. Once y

Re: bug in stored generated column over domain with constraints.

2025-04-15 Thread Tom Lane
jian he writes: > Thanks for simplifying the tests, overall all looks good. OK, pushed and back-patched, but only to v14. I tried to make a variant that'd work in v13, but it caused ExecCheckPlanOutput to throw "Query provides a value for a generated column" errors for UPDATEs. That's surely re

Re: Logical Replication of sequences

2025-04-15 Thread Peter Smith
Hi Vignesh, Some review comments for v20250525-0004. == Commit message 1. A new sequencesync worker is launched as needed to synchronize sequences. It does the following: a) Retrieves remote values of sequences with pg_sequence_state() INIT. b) Log a warning if the sequence parameter

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-04-15 Thread James Hunter
Thanks for the comments! On Tue, Apr 15, 2025 at 3:11 AM Andres Freund wrote: > > Hi, > > On 2025-04-14 09:58:19 -0700, James Hunter wrote: > > I see two orthogonal problems, in processing Bitmap Heap pages in > > parallel: (1) we need to prefetch enough pages, far enough in advance, > > to hide

Re: AIO v2.5

2025-04-15 Thread Alexander Lakhin
Hello Andres, 14.04.2025 19:06, Andres Freund wrote: Unfortunately I'm several hundred iterations in, without reproducing the issue. I'm bad at statistics, but I think that makes it rather unlikely that I will, without changing some aspect. Was this an assert enabled build? What compiler and wh

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-15 Thread Jacob Champion
On Tue, Apr 15, 2025 at 8:34 AM Christoph Berg wrote: > I agree with this reasoning and retract my suggestion to rename the option. (Thank you for chiming in; having the packager feedback has been extremely helpful.) While I have you, may I ask whether you're okay (from the packager perspective)

Re: New committer: Jacob Champion

2025-04-15 Thread Umar Hayat
On Sat, 12 Apr 2025 at 05:26, Jonathan S. Katz wrote: > > The Core Team would like to extend our congratulations to Jacob > Champion, who has accepted an invitation to become our newest PostgreSQL > committer. > > Please join us in wishing Jacob much success and few reverts! > > Thanks, > > Jonath

Re: pg_combinebackup: correct code comment.

2025-04-15 Thread Daniel Gustafsson
> On 15 Apr 2025, at 06:22, Amul Sul wrote: > Attached is a patch that corrects the code comment for > process_directory_recursively() in pg_combinebackup, where the comment > incorrectly refers to "output_directory" instead of the intended > "input_directory". Agreed. The second paragraph in t

Re: pg_dump --if-exists --clean when drop index that is partition of a partitioned index

2025-04-15 Thread Pavel Stehule
út 15. 4. 2025 v 8:52 odesílatel jian he napsal: > On Tue, Apr 15, 2025 at 1:45 PM Pavel Stehule > wrote: > >> > >> seems pretty easy to fix. > >> we only need dropStmt when IndxInfo->parentidx oid is invalid. > >> > >> +if (!OidIsValid(indxinfo->parentidx)) > >> +appendPQExp

Re: minor error message enhancement in refuseDupeIndexAttach

2025-04-15 Thread Daniel Gustafsson
> On 15 Apr 2025, at 10:52, jian he wrote: > in refuseDupeIndexAttach, we can change from > > errdetail("Another index is already attached for partition \"%s\"."...) > > to > > errdetail("Another index \"%s\" is already attached for partition \"%s\".") > > So we can easily understand which in

Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

2025-04-15 Thread Fujii Masao
On 2025/04/15 7:21, Mahendra Singh Thalor wrote: Hi hackers, In _allocAH function(pg_backup_archiver.c), we were using the *fmt* variable in switch case for *default case*, but correct variable is AH->format. Here, I am attaching a patch for the same. Thanks for the report and patch! It l

[Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql

2025-04-15 Thread Srinath Reddy
Hi all, I'd like to propose adding a new `psql` meta-command: \dAt [AMPTRN [TBLPTRN]] This would list all user tables that are using a specific Table Access Method (TAM), optionally filtered by table name pattern. Why? - Table Access Methods are increasingly used. - There's currently no nat

Re: Built-in Raft replication

2025-04-15 Thread Yura Sokolov
14.04.2025 20:44, Kirill Reshke пишет: > OTOH Raft needs to write its own log, and what's worse, it sometimes > needs to remove already written parts of it (so, it is not appended > only, unlike WAL). If you have a production system which maintains two > kinds of logs with different semantics, it i

Re: A modest proposal: make parser/rewriter/planner inputs read-only

2025-04-15 Thread Richard Guo
On Sun, Apr 6, 2025 at 1:46 AM Tom Lane wrote: > The parser, rewriter, and planner all have a bad habit of scribbling > on their input parsetrees. At this point I've lost count of how many > bugs that's caused (but e33f2335a and 0f43083d1 are the two latest > examples), and of how many places the

Re: pg_combinebackup: correct code comment.

2025-04-15 Thread Amul Sul
On Tue, Apr 15, 2025 at 1:16 PM Daniel Gustafsson wrote: > > > On 15 Apr 2025, at 06:22, Amul Sul wrote: > > > Attached is a patch that corrects the code comment for > > process_directory_recursively() in pg_combinebackup, where the comment > > incorrectly refers to "output_directory" instead of

Re: support create index on virtual generated column.

2025-04-15 Thread jian he
On Mon, Apr 14, 2025 at 8:05 PM Kirill Reshke wrote: > > On Mon, 14 Apr 2025 at 16:10, jian he wrote: > > > > new patch attached. Now, > > ALTER TABLE DROP COLUMN works fine. > > ALTER INDEX ATTACH PARTITION works fine. > > creating such an index on a partitioned table works just fine. > > for ta

Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2025-04-15 Thread Ilia Evdokimov
On 15.04.2025 03:23, David Rowley wrote: I'm just looking for ways to allow us to group all three of these together for the TEXT format type. I see the BUFFERS are displayed quite compactly, e.g. "Buffers: shared hit=17 read=4". show_wal_usage() does something similar and so does show_modifytabl

Re: [Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql

2025-04-15 Thread Mahendra Singh Thalor
On Tue, 15 Apr 2025 at 14:27, Srinath Reddy wrote: > > Hi all, > > I'd like to propose adding a new `psql` meta-command: > > \dAt [AMPTRN [TBLPTRN]] > > This would list all user tables that are using a specific Table Access Method > (TAM), optionally filtered by table name pattern. > > Why? >

Re: A modest proposal: make parser/rewriter/planner inputs read-only

2025-04-15 Thread Andrei Lepikhov
On 4/5/25 18:46, Tom Lane wrote: I'm not planning to pursue this idea Right Now, but it seems like something that could happen for v19 or so. In the meantime I wanted to get the ideas down on electrons. Thoughts? I generally like the idea because, for now, I need to be sure that no one touched

Re: Add pg_get_injection_points() for information of injection points

2025-04-15 Thread Michael Paquier
On Mon, Apr 14, 2025 at 05:26:14PM +0500, Kirill Reshke wrote: > Hi! I noticed you do not bump catalog version here, so i was a little > confused with > ``` > reshke=# SELECT name, library, function FROM pg_get_injection_points(); > ERROR: function pg_get_injection_points() does not exist > ``` >

Re: Adding support for SSLKEYLOGFILE in the frontend

2025-04-15 Thread Jacob Champion
On Mon, Apr 14, 2025 at 1:16 PM Daniel Gustafsson wrote: > Just to close the loop, this was done yesterday as 2970c75dd982. Thanks! --Jacob

Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

2025-04-15 Thread Fujii Masao
On 2025/04/15 17:02, Fujii Masao wrote: On 2025/04/15 7:21, Mahendra Singh Thalor wrote: Hi hackers, In _allocAH function(pg_backup_archiver.c), we were using the *fmt* variable in switch case for *default case*, but correct variable is AH->format. Here, I am attaching a patch for the sa

Re: bug in stored generated column over domain with constraints.

2025-04-15 Thread jian he
On Tue, Apr 15, 2025 at 4:10 AM Tom Lane wrote: > > jian he writes: > > new patch attached. > > I looked this over. It's kind of astonishing that nobody has reported > this before, because AFAICT it's been broken since we invented > generated columns. > > > rewriteTargetListIU, expand_insert_tar

Re: pgsql: Add function to get memory context stats for processes

2025-04-15 Thread Andres Freund
Hi, On 2025-04-14 10:03:28 -0400, Robert Haas wrote: > On Thu, Apr 10, 2025 at 4:05 PM Andres Freund wrote: > > I don't know of existing discussion, but it seems rather fundamental to me - > > if either DSA or memory contexts could be inconsistent at a CFI(), how could > > it possibly be safe to

Re: Recent pg_rewind test failures in buildfarm

2025-04-15 Thread Andres Freund
Hi, On 2025-04-14 22:58:28 -0400, Tom Lane wrote: > In the last day or so, both skink and mamba have hit this > in the pg_rewind test suite [1][2]: > > #3 0x01f03f7c in ExceptionalCondition > (conditionName=conditionName@entry=0x2119c4c "pending_since == 0", > fileName=fileName@entry=0x2119454

pending_since assertion failure on skink

2025-04-15 Thread Andres Freund
Hi, https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=skink&dt=2025-04-11%2007%3A41%3A36&stg=subscription-check shows a failure on the publisher: 2025-04-11 11:01:06.175 UTC [2975477][walsender][29/0:0] STATEMENT: START_REPLICATION SLOT "pg_16410_sync_16392_7491957737045826723" LO

Re: Recent pg_rewind test failures in buildfarm

2025-04-15 Thread Andres Freund
Hi, On 2025-04-15 06:04:54 -0400, Andres Freund wrote: > See also > https://postgr.es/m/dwrkeszz6czvtkxzr5mqlciy652zau5qqnm3cp5f3p2po74ppk%40omg4g3cc6dgq Huh, turns out my emails of the last few days had gotten stuck. I only noticed when trying to open the above link and it was dead. I had been

Re: Built-in Raft replication

2025-04-15 Thread Aleksander Alekseev
Hi Konstantin, > I am considering starting work on implementing a built-in Raft > replication for PostgreSQL. Generally speaking I like the idea. The more important question IMO is whether we want to maintain Raft within the PostgreSQL core project. Building distributed systems on commodity hard

minor error message enhancement in refuseDupeIndexAttach

2025-04-15 Thread jian he
hi. minor error message enhancement in refuseDupeIndexAttach, we can change from errdetail("Another index is already attached for partition \"%s\"."...) to errdetail("Another index \"%s\" is already attached for partition \"%s\".") So we can easily understand which index is already attached f

Re: Built-in Raft replication

2025-04-15 Thread Yura Sokolov
15.04.2025 13:20, Aleksander Alekseev пишет: > Hi Konstantin, > >> I am considering starting work on implementing a built-in Raft >> replication for PostgreSQL. > > Generally speaking I like the idea. The more important question IMO is > whether we want to maintain Raft within the PostgreSQL core

Re: Add pg_get_injection_points() for information of injection points

2025-04-15 Thread Rahila Syed
Hi, Thank you for this enhancement to injection points. Following are a few comments. + * This overestimates the allocation size, including slots that may be + * free, for simplicity. + */ + result = palloc0(sizeof(InjectionPointData) * max_inuse); + The result variable name is a bit generic. H

Re: Built-in Raft replication

2025-04-15 Thread Konstantin Osipov
* Yura Sokolov [25/04/15 12:02]: > > OTOH Raft needs to write its own log, and what's worse, it sometimes > > needs to remove already written parts of it (so, it is not appended > > only, unlike WAL). If you have a production system which maintains two > > kinds of logs with different semantics,

Re: Built-in Raft replication

2025-04-15 Thread Aleksander Alekseev
Hi Yura, > I've been working in a company which uses MongoDB (3.6 and up) as their > primary storage. And it seemed to me as "God Send". Everything just worked. > Replication was as reliable as one could imagine. It outlives several > hardware incidents without manual intervention. It allowed clus

Re: pgsql: Non text modes for pg_dumpall, correspondingly change pg_restore

2025-04-15 Thread Andrew Dunstan
On 2025-04-14 Mo 6:55 PM, Mahendra Singh Thalor wrote: --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -1053,15 +1053,19 @@ get_dbname_oid_list_from_mfile(const char *dumpdirpath, SimpleOidStringList *dbn         while ((fgets(line, MAXPGPATH, pfile

Re: Built-in Raft replication

2025-04-15 Thread Yura Sokolov
15.04.2025 14:15, Aleksander Alekseev пишет: > Hi Yura, > >> I've been working in a company which uses MongoDB (3.6 and up) as their >> primary storage. And it seemed to me as "God Send". Everything just worked. >> Replication was as reliable as one could imagine. It outlives several >> hardware i

Re: dispchar for oauth_client_secret

2025-04-15 Thread Noah Misch
On Tue, Apr 15, 2025 at 01:16:12PM -0700, Jacob Champion wrote: > On Tue, Apr 15, 2025 at 12:14 PM Noah Misch wrote: > > I suspect this should use .dispchar="*" to encourage UIs to display > > oauth_client_secret like a password field. Thoughts? > > Hmm, from a UI perspective I agree. (The built

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-15 Thread Daniel Gustafsson
> On 15 Apr 2025, at 23:03, David Rowley wrote: > My vote is to make the levels 1-based in all locations where we output > the context information. I agree with this, pg_get_process_memory_contexts() also use 1-based levels fwiw. -- Daniel Gustafsson

Re: pipelining in psql, commit 41625ab

2025-04-15 Thread Jelte Fennema-Nio
On Tue, 15 Apr 2025 at 23:34, Noah Misch wrote: > That said, maybe having > PQpipelineSync() was a mistake, since I think it's just PQsendPipelineSync() + > PQflush(). Yes, IMO that's pretty much the case. But we cannot remove that function because of backwards compatibility. Note that for all t

Re: Built-in Raft replication

2025-04-15 Thread Tom Lane
Nikolay Samokhvalov writes: > This is exactly what I wanted to write as well. The idea is great. At the > same time, I think, consensus on many decisions will be extremely hard to > reach, so this project has a high risk of being very long. Unless it's an > extension, at least in the beginning. Y

Re: Logical Replication of sequences

2025-04-15 Thread Peter Smith
Hi Vignesh, Some review comments for patch v20250325-0005 (docs). == doc/src/sgml/catalogs.sgml (52.55. pg_subscription_rel) 1. State code: i = initialize, d = data is being copied, f = finished table copy, s = synchronized, r = ready (normal replication) ~ This is not part of the patch,

Re: [18] Unintentional behavior change in commit e9931bfb75

2025-04-15 Thread Noah Misch
On Tue, Apr 15, 2025 at 04:08:55PM -0700, Jeff Davis wrote: > On Mon, 2025-04-14 at 13:44 -0700, Noah Misch wrote: > > However, I think v17's > > concept of separate PG_REGEX_ symbols for the default-locale case is > > still the > > right thing for v18.  In other words, this code should change to l

transforms [was Re: FmgrInfo allocation patterns (and PL handling as staged programming)]

2025-04-15 Thread Chapman Flack
On 04/15/25 10:52, Tom Lane wrote: > The problem from a PL's standpoint is "given this input or output > of type FOO, should I transform it, and if so using what?". So > the starting point has to be a type not a transform. ... protrftypes data > is used as a filter before attempting a pg_transform

Re: An incorrect check in get_memoize_path

2025-04-15 Thread Richard Guo
On Mon, Apr 14, 2025 at 8:08 PM wenhui qiu wrote: > No objections.It's a pity that the postgresql18 version has been code-frozen v18 is now in feature freeze, but not code freeze, so bug fixes are still allowed. I've pushed this patch after adding the "Reviewed-by" tags. Thanks Richard

  1   2   >