Re: strange context message in spi.c?

2024-08-02 Thread Umar Hayat
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: tested, failed Documentation:tested, failed As tree is branched out for PG17, I guess now it's time to co

Re: [HACKERS] make async slave to wait for lsn to be replayed

2024-08-02 Thread Alexander Korotkov
On Sat, Aug 3, 2024 at 3:45 AM Kevin Hale Boyes wrote: > I noticed the commit and had a question and a comment. > There is a small problem in func.sgml in the sentence "After that the changes > made of primary". Should be "on primary". Thank you for spotting this. Will fix. > In the for loop i

Re: [HACKERS] make async slave to wait for lsn to be replayed

2024-08-02 Thread Kevin Hale Boyes
I noticed the commit and had a question and a comment. There is a small problem in func.sgml in the sentence "After that the changes made of primary". Should be "on primary". In the for loop in WaitForLSNReplay, shouldn't the check for in-recovery be moved up above the call to GetXLogReplayRecPtr

Re: Why is citext/regress failing on hamerkop?

2024-08-02 Thread Thomas Munro
On Sat, Aug 3, 2024 at 2:11 AM David E. Wheeler wrote: > Haven’t been following this thread, but this post reminded me of an issue I > saw with locales on Windows[1]. Could it be that the introduction of > Universal CRT[2] in Windows 10 has improved UTF-8 support? Yeah. We have a few places th

Draft release notes for next week's releases are up

2024-08-02 Thread Tom Lane
See https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ee219ee8c40d88e7a0ef52c3c1b76c90bbd0d164 As usual, please send corrections/comments by Sunday. regards, tom lane

Re: pg_dump: optimize dumpFunc()

2024-08-02 Thread Nathan Bossart
On Fri, Aug 02, 2024 at 01:33:45AM -0400, Tom Lane wrote: > I'm a bit concerned about this on two grounds: > > 1. Is it a win for DBs with not so many functions? > > 2. On the other end of the scale, if you've got a *boatload* of > functions, what does it do to pg_dump's memory requirements? > I'

Re: meson "experimental"?

2024-08-02 Thread Noah Misch
On Thu, May 30, 2024 at 01:32:18PM +0300, Aleksander Alekseev wrote: > > > [*] What is the correct name for this? > > > > I believe in this section it should be "Visual Studio" as we specify > > elsewhere [1][2]. In [2] we name specific required versions. Maybe we > > should reference this section.

Fix memory counter update in reorderbuffer

2024-08-02 Thread Masahiko Sawada
Hi, I found a bug in the memory counter update in reorderbuffer. It was introduced by commit 5bec1d6bc5e, so pg17 and master are affected. In ReorderBufferCleanupTXN() we zero the transaction size and then free the transaction entry as follows: /* Update the memory counter */ ReorderBuff

Re: New compiler warnings in buildfarm

2024-08-02 Thread Tom Lane
Peter Eisentraut writes: > On 31.07.24 20:39, Andres Freund wrote: >> I Wonder if I should also should add -Wno-clobbered to serinus' config. >> Afaict >> -Wclobbered is pretty useless once optimizations are used. I've long added >> that to my local dev environment flags because it's so noisy (wh

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-08-02 Thread Peter Eisentraut
On 02.08.24 19:51, Jacob Champion wrote: But it sounds like we agree that we shouldn't be using fe_memutils at all in shlib builds. (If you can't use palloc -- it calls exit -- then you can't use pfree either.) Is 0002 still worth pursuing, once I've correctly wordsmithed the commit? Or did I mis

Re: Official devcontainer config

2024-08-02 Thread Peter Eisentraut
On 01.08.24 23:38, Andrew Dunstan wrote: Not totally opposed, and I will probably give it a try very soon, but I'm wondering if this really needs to go in the core repo. We've generally shied away from doing much in the way of editor / devenv support, trying to be fairly agnostic. It's true we

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Jacob Champion
On Fri, Aug 2, 2024 at 10:40 AM Robert Haas wrote: > My belief is that nearly everything in unsafe. We ship with very > little marked leakproof right now, and that might be too conservative, > but probably not by much. Then to me, that seems like the best-case scenario for a "maybe" classificatio

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-08-02 Thread Jacob Champion
On Fri, Aug 2, 2024 at 10:13 AM Peter Eisentraut wrote: > You shouldn't use pfree() interchangeably with free(), even if that is > not enforced because it's the same thing underneath. First, it just > makes sense to keep the alloc and free pairs matched up. And second, on > Windows there is some

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Robert Haas
On Fri, Aug 2, 2024 at 12:33 PM Jacob Champion wrote: > (Now, if there aren't that many cases where we can all agree on > "unsafe", then the proposal loses pretty much all value, because we'll > never shrink the uncertainty.) My belief is that nearly everything in unsafe. We ship with very little

Re: New compiler warnings in buildfarm

2024-08-02 Thread Peter Eisentraut
On 31.07.24 20:39, Andres Freund wrote: On 2024-07-31 11:32:56 -0700, Andres Freund wrote: On 2024-07-31 10:11:07 -0400, Tom Lane wrote: It looks like serinus needs this fix too. Added to both. I've forced runs for both animals, so the bf should show results of that soon. I Wonder if I sho

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-08-02 Thread Peter Eisentraut
On 30.07.24 00:30, Jacob Champion wrote: But under what circumstances does "the linker doesn't strip out" happen? If this happens accidentally, then we should have seen some buildfarm failures or something? On my machine, for example, I see differences with optimization levels. Say you inadve

Re: [BUG?] check_exclusion_or_unique_constraint false negative

2024-08-02 Thread Michail Nikolaev
Hello, Amit! > I think it is rather less likely or not possible in a parallel apply > case because such conflicting updates (updates on the same tuple) > should be serialized at the publisher itself. So one of the updates > will be after the commit that has the second update. Glad to hear! But an

Re: Injection points: preloading and runtime arguments

2024-08-02 Thread Andrey M. Borodin
> On 18 Jul 2024, at 03:55, Michael Paquier wrote: > > If there is anything else you would like to see adjusted in this area, > please let me know. I’ve tried to switch my multixact test to new INJECTION_POINT_CACHED… and it does not work for me. Could you please take a look? 2024-08-02 18:5

Re: On disable_cost

2024-08-02 Thread Robert Haas
On Fri, Aug 2, 2024 at 12:51 PM Tom Lane wrote: > That absolutely is the expectation, and we'd better be careful not > to break it. I have every intention of not breaking it. :-) -- Robert Haas EDB: http://www.enterprisedb.com

Re: On disable_cost

2024-08-02 Thread Tom Lane
Robert Haas writes: > On Fri, Aug 2, 2024 at 9:13 AM David Rowley wrote: >> ... That way you maintain the >> existing behaviour of not optimising for disabled node types and don't >> risk plan changes if the final cost comes out cheaper than the initial >> cost. > All three initial_cost_XXX func

Re: Memory growth observed with C++ application consuming libpq.dll on Windows

2024-08-02 Thread Rajesh Kokkonda
We did run our application under valgrind on Linux. We did not see any leaks. There is no platform dependent code in our application. We are seeing gradual memory growth only on windows. That is what lead me to believe the leak may be present in postgresql. I will run under available memory tools

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Jacob Champion
On Fri, Aug 2, 2024 at 9:22 AM Robert Haas wrote: > I'll be honest: I don't like it, either. I don't even like > proleakproof=true/false/maybe; I asked about that to understand if > that was what Jacob was proposing, not because I actually think we > should do it. The problem is that there's likel

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Robert Haas
On Fri, Aug 2, 2024 at 11:07 AM Tom Lane wrote: > Joe Conway writes: > > > > Hmmm, and then have "leakproof_mode" = strict/lax/off where 'strict' is > > current behavior, 'lax' allows the 'maybe's to get pushed down, and > > 'off' ignores the leakproof attribute entirely and pushes down anything

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Jacob Champion
On Fri, Aug 2, 2024 at 9:13 AM Joe Conway wrote: > > On 8/2/24 11:07, Tom Lane wrote: > > Joe Conway writes: > >> > >> Hmmm, and then have "leakproof_mode" = strict/lax/off where 'strict' is > >> current behavior, 'lax' allows the 'maybe's to get pushed down, and > >> 'off' ignores the leakproof

Re: Memory growth observed with C++ application consuming libpq.dll on Windows

2024-08-02 Thread Ranier Vilela
Em sex., 2 de ago. de 2024 às 11:54, Rajesh Kokkonda < rajeshk.kokko...@gmail.com> escreveu: > Okay. I will try to create one sample program and send it to you sometime > next week. In the meantime, I am listing down all the methods we are > consuming from libpq. > > PQconnectdbParams > PQstatus >

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Joe Conway
On 8/2/24 11:07, Tom Lane wrote: Joe Conway writes: Hmmm, and then have "leakproof_mode" = strict/lax/off where 'strict' is current behavior, 'lax' allows the 'maybe's to get pushed down, and 'off' ignores the leakproof attribute entirely and pushes down anything that merits being pushed?

Re: wrong translation file reference in pg_createsubscriber

2024-08-02 Thread Alvaro Herrera
Hello, On 2024-Aug-02, Kyotaro Horiguchi wrote: > I found that pg_createsubscriber doesn't use NLS files. This is due to > the wrong reference name "pg_createsubscriber" being passed to > set_pglocale_pgservice(). It should be "pg_basebackup" instead. See > the attached patch. Absolutely right.

Re: On disable_cost

2024-08-02 Thread Robert Haas
On Fri, Aug 2, 2024 at 9:13 AM David Rowley wrote: > I now think neither of us got it right. I now think what you'd need to > do to be aligned to the current behaviour is have > initial_cost_nestloop() add the disabled_nodes for the join's subnodes > *only* and have final_cost_nestloop() add the a

Re: Parallel CREATE INDEX for GIN indexes

2024-08-02 Thread Matthias van de Meent
On Tue, 9 Jul 2024 at 03:18, Andy Fan wrote: >> and later we called 'tuplesort_performsort(state->bs_sortstate);'. Even >> we have some CTID merges activity in '(1)', the tuples are still >> ordered, so the sort (in both tuplesort_putgintuple and >> 'tuplesort_performsort) are not necessary,

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Tom Lane
Joe Conway writes: > > Hmmm, and then have "leakproof_mode" = strict/lax/off where 'strict' is > current behavior, 'lax' allows the 'maybe's to get pushed down, and > 'off' ignores the leakproof attribute entirely and pushes down anything > that merits being pushed? > So in other words, we m

Re: Memory growth observed with C++ application consuming libpq.dll on Windows

2024-08-02 Thread Rajesh Kokkonda
Okay. I will try to create one sample program and send it to you sometime next week. In the meantime, I am listing down all the methods we are consuming from libpq. PQconnectdbParams PQstatus PQerrorMessage PQpingParams PQfinish PQresultStatus PQclear PQsetSingleRowMode PQntuples PQnfields PQftype

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread David G. Johnston
On Fri, Aug 2, 2024 at 6:58 AM Joe Conway wrote: > On 8/2/24 09:48, Jacob Champion wrote: > > On Thu, Aug 1, 2024 at 6:03 PM Robert Haas > wrote: > >> > >> On Thu, Aug 1, 2024 at 4:45 PM Jacob Champion > >> wrote: > >> > Would it provide enough value for effort to explicitly mark leaky > >> > p

Re: Why is citext/regress failing on hamerkop?

2024-08-02 Thread David E. Wheeler
On Aug 1, 2024, at 18:54, Thomas Munro wrote: > Done (e52a44b8, 91f498fd). > > Any elucidation on how and why Windows machines have started using > UTF-8 would be welcome. Haven’t been following this thread, but this post reminded me of an issue I saw with locales on Windows[1]. Could it be th

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Joe Conway
On 8/2/24 09:48, Jacob Champion wrote: On Thu, Aug 1, 2024 at 6:03 PM Robert Haas wrote: On Thu, Aug 1, 2024 at 4:45 PM Jacob Champion wrote: > Would it provide enough value for effort to explicitly mark leaky > procedures as such? Maybe that could shrink the grey area enough to be > protecti

Re: Remove obsolete RECHECK keyword completely

2024-08-02 Thread Tom Lane
Peter Eisentraut writes: > I propose to remove the obsolete RECHECK keyword completely. This used > to be part of CREATE OPERATOR CLASS and ALTER OPERATOR FAMILY, but it > has done nothing (except issue a NOTICE) since PostgreSQL 8.4. Commit > 30e7c175b81 removed support for dumping from pre-

Re: Memory growth observed with C++ application consuming libpq.dll on Windows

2024-08-02 Thread Tom Lane
Rajesh Kokkonda writes: > Are you looking for a fully functional sample program or only the APIs from > libpq library that our product uses? I am asking this because if the > requirement is to have a sample code, then I will have to work on creating > one on the same lines as our product. Just fo

Re: can we mark upper/lower/textlike functions leakproof?

2024-08-02 Thread Jacob Champion
On Thu, Aug 1, 2024 at 6:03 PM Robert Haas wrote: > > On Thu, Aug 1, 2024 at 4:45 PM Jacob Champion > wrote: > > Would it provide enough value for effort to explicitly mark leaky > > procedures as such? Maybe that could shrink the grey area enough to be > > protective? > > You mean like proleakpr

Re: pg_combinebackup does not detect missing files

2024-08-02 Thread Robert Haas
On Fri, Apr 19, 2024 at 11:47 AM Robert Haas wrote: > Hmm, that's an interesting perspective. I've always been very > skeptical of doing verification only around missing files and not > anything else. I figured that wouldn't be particularly meaningful, and > that's pretty much the only kind of val

Re: On disable_cost

2024-08-02 Thread David Rowley
On Sat, 3 Aug 2024 at 00:17, Robert Haas wrote: > > On Thu, Aug 1, 2024 at 11:34 PM David Rowley wrote: > > I'm not planning on pushing this any further. I've just tried to > > highlight that there's the possibility of a behavioural change. You're > > claiming there isn't one. I claim there is. >

Re: Conflict detection and logging in logical replication

2024-08-02 Thread Nisha Moond
Performance tests done on the v8-0001 and v8-0002 patches, available at [1]. The purpose of the performance tests is to measure the impact on logical replication with track_commit_timestamp enabled, as this involves fetching the commit_ts data to determine delete_differ/update_differ conflicts. F

Re: On disable_cost

2024-08-02 Thread Robert Haas
On Thu, Aug 1, 2024 at 11:34 PM David Rowley wrote: > I'm not planning on pushing this any further. I've just tried to > highlight that there's the possibility of a behavioural change. You're > claiming there isn't one. I claim there is. I don't know what to tell you. The original version of the

Re: Psql meta-command conninfo+

2024-08-02 Thread Hunaid Sohail
Hi, I have read the entire thread discussion. I understood the importance of this enhancement related to /conninfo+ meta command. I really appreciate the efforts of Maiquel and suggestions made by the reviewers. According to best of my understanding, libpq API should be used instead of creating se

Re: Memory growth observed with C++ application consuming libpq.dll on Windows

2024-08-02 Thread Yasir
On Fri, Aug 2, 2024 at 1:53 PM Rajesh Kokkonda wrote: > Hi Yasir, > > Are you looking for a fully functional sample program or only the APIs > from libpq library that our product uses? I am asking this because if the > requirement is to have a sample code, then I will have to work on creating > o

Re: Memory growth observed with C++ application consuming libpq.dll on Windows

2024-08-02 Thread Rajesh Kokkonda
Hi Yasir, Are you looking for a fully functional sample program or only the APIs from libpq library that our product uses? I am asking this because if the requirement is to have a sample code, then I will have to work on creating one on the same lines as our product. Rajesh On Thu, Aug 1, 2024 a

Re: Conflict detection and logging in logical replication

2024-08-02 Thread Amit Kapila
On Thu, Aug 1, 2024 at 5:23 PM Amit Kapila wrote: > > On Thu, Aug 1, 2024 at 2:26 PM Hayato Kuroda (Fujitsu) > wrote: > > > > 04. general > > > > According to the documentation [1], there is another constraint "exclude", > > which > > can cause another type of conflict. But this pattern cannot b

Remove obsolete RECHECK keyword completely

2024-08-02 Thread Peter Eisentraut
I propose to remove the obsolete RECHECK keyword completely. This used to be part of CREATE OPERATOR CLASS and ALTER OPERATOR FAMILY, but it has done nothing (except issue a NOTICE) since PostgreSQL 8.4. Commit 30e7c175b81 removed support for dumping from pre-9.2 servers, so this no longer se

Re: Small refactoring around vacuum_open_relation

2024-08-02 Thread Kirill Reshke
Thanks for review! On Fri, 2 Aug 2024 at 14:31, Ashutosh Bapat wrote: > > On Fri, Aug 2, 2024 at 1:55 PM Kirill Reshke wrote: > > > > I hate to be "that guy", but there are many places in sources where we use > > LOCKMODE lockmode; variable and exactly one where we use LOCKMODE > > lmode: it is

Re: Wrong results with grouping sets

2024-08-02 Thread Richard Guo
I've been looking at cases where there are grouping-set keys that reduce to Consts, and I noticed a plan with v11 patch that is not very great. explain (verbose, costs off) select 1 as one group by rollup(one) order by one nulls first; QUERY PLAN --- Sort

Re: Small refactoring around vacuum_open_relation

2024-08-02 Thread Ashutosh Bapat
On Fri, Aug 2, 2024 at 1:55 PM Kirill Reshke wrote: > > I hate to be "that guy", but there are many places in sources where we use > LOCKMODE lockmode; variable and exactly one where we use LOCKMODE > lmode: it is vacuum_open_relation function. There are more instances of LOCKMODE lmode; I spotte

Re: [PATCH] Add min/max aggregate functions to BYTEA

2024-08-02 Thread Andrey M. Borodin
> On 24 Jul 2024, at 17:42, Marat Bukharov wrote: > > V5 patch. I've added more tests with different bytea sizes Hi Marat! This looks like a nice feature to have. I’ve took a look into the patch and have few suggestions: 0. Please write more descriptive commit message akin to [0] 1. Use oid

Re: Logical Replication of sequences

2024-08-02 Thread shveta malik
On Fri, Aug 2, 2024 at 2:24 PM shveta malik wrote: > > On Thu, Aug 1, 2024 at 9:26 AM shveta malik wrote: > > > > On Mon, Jul 29, 2024 at 4:17 PM vignesh C wrote: > > > > > > Thanks for reporting this, these issues are fixed in the attached > > > v20240730_2 version patch. > > > > > I was review

Re: v17 vs v16 performance comparison

2024-08-02 Thread Alexander Lakhin
01.08.2024 06:41, Tom Lane wrote: But beside that, I've found a separate regression. Bisecting for this degradation: Best pg-src-17--.* worse than pg-src-16--.* by 105.0 percents (356.63 > 173.96): s64da_tpcds.query95 Average pg-src-17--.* worse than pg-src-16--.* by 105.2 percents (357.79 >

Re: Logical Replication of sequences

2024-08-02 Thread shveta malik
On Thu, Aug 1, 2024 at 9:26 AM shveta malik wrote: > > On Mon, Jul 29, 2024 at 4:17 PM vignesh C wrote: > > > > Thanks for reporting this, these issues are fixed in the attached > > v20240730_2 version patch. > > I was reviewing the design of patch003, and I have a query. Do we need to even star

Small refactoring around vacuum_open_relation

2024-08-02 Thread Kirill Reshke
I hate to be "that guy", but there are many places in sources where we use LOCKMODE lockmode; variable and exactly one where we use LOCKMODE lmode: it is vacuum_open_relation function. Is it worth a patch? v1-0001-Rename-vacuum_open_relation-argument-to-lockmode.patch Description: Binary data

Set query_id for query contained in utility statement

2024-08-02 Thread Anthonin Bonnefoy
Hi all, Some utility statements like Explain, CreateTableAs and DeclareCursor contain a query which will be planned and executed. During post parse, only the top utility statement is jumbled, leaving the contained query without a query_id set. Explain does the query jumble in ExplainQuery but for

Re: [Patch] remove duplicated smgrclose

2024-08-02 Thread Steven Niu
Thanks, I have set my name in the Authors column of CF. Steven Junwang Zhao 于2024年8月2日周五 13:22写道: > Hi Steven, > > On Fri, Aug 2, 2024 at 12:12 PM Steven Niu wrote: > > > > Hi, Junwang, > > > > Thank you for the review and excellent summary in commit message! > > > > This is my first contribut

Re: why there is not VACUUM FULL CONCURRENTLY?

2024-08-02 Thread Kirill Reshke
On Fri, 2 Aug 2024 at 11:09, Antonin Houska wrote: > > Kirill Reshke wrote: > > However, in general, the 3rd patch is really big, very hard to > > comprehend. Please consider splitting this into smaller (and > > reviewable) pieces. > > I'll try to move some preparation steps into separate diffs,

Re: Adding OLD/NEW support to RETURNING

2024-08-02 Thread jian he
On Thu, Aug 1, 2024 at 7:33 PM Dean Rasheed wrote: > > On Mon, 29 Jul 2024 at 11:22, Dean Rasheed wrote: > > > > Trivial rebase, following c7301c3b6f. > > > > Rebased version, forced by a7f107df2b. Evaluating the input parameters > of correlated SubPlans in the referencing ExprState simplifies th

Re: MAINTAIN privilege -- what do we need to un-revert it?

2024-08-02 Thread Yugo NAGATA
On Thu, 01 Aug 2024 11:31:53 -0700 Jeff Davis wrote: > On Wed, 2024-07-31 at 18:20 +0900, Yugo NAGATA wrote: > > I agree that it might not be important, but I think adding the flag > > would be > > also helpful for improving code-readability because it clarify the > > function > > is used in the