Re: explain analyze rows=%.0f

2025-02-12 Thread Andrei Lepikhov
On 12/2/2025 03:46, Tom Lane wrote: Robert Haas writes: On Tue, Feb 11, 2025 at 12:14 PM Andrei Lepikhov wrote: I support the idea in general, but I believe it should be expanded to cover all cases of parameterised plan nodes. Each rescan iteration may produce a different number of tuples, an

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-02-12 Thread Shubham Khanna
On Wed, Feb 12, 2025 at 1:15 PM Shubham Khanna wrote: > > On Wed, Feb 12, 2025 at 5:29 AM Peter Smith wrote: > > > > On Tue, Feb 11, 2025 at 9:16 PM Shubham Khanna > > wrote: > > > > > > > #13. Unanswered question "How are tests expecting this even passing?". > > > > Was a reason identified? IOW

Re: TAP test command_fails versus command_fails_like

2025-02-12 Thread Ashutosh Bapat
On Wed, Feb 12, 2025 at 10:36 AM Peter Smith wrote: > > Hi hackers, > > Recently, while writing some new TAP tests my colleague inadvertently > called the command_fails() subroutine instead of command_fails_like() > subroutine. Their parameters are almost the same but > command_fails_like() also t

Re: Showing applied extended statistics in explain Part 2

2025-02-12 Thread Tomas Vondra
On 2/12/25 06:02, Tatsuro Yamada wrote: > Hi Tomas and ALL, > >>I wonder what Yamada-san thinks about these suggestions ... He's the one >>actually developing the patch, so I'd like to know his opinions. > > I will state my thoughts on the two points of discussion. > > I often use SQL Server

Re: NOT ENFORCED constraint feature

2025-02-12 Thread Álvaro Herrera
On 2025-Feb-12, Ashutosh Bapat wrote: > I have been asking a different question: What's the use of > not-enforced constraints if we don't allow VALID, NOT ENFORCED state > for them? That's a question for the SQL standards committee. They may serve schema documentation purposes, for example. http

Re: generic plans and "initial" pruning

2025-02-12 Thread Amit Langote
On Thu, Feb 6, 2025 at 11:35 AM Amit Langote wrote: > Per cfbot-ci, the new test case output in 0002 needed to be updated. > > I plan to push 0001 tomorrow, barring any objections. I pushed that last Friday. With bb3ec16e, d47cbf47, and cbc12791 now in: * Pruning information is now stored separa

Re: NOT ENFORCED constraint feature

2025-02-12 Thread Peter Eisentraut
On 11.02.25 14:36, Álvaro Herrera wrote: On 2025-Feb-10, Isaac Morland wrote: I'm having a lot of trouble understanding the operational distinction between your 'u' and 'U'. If it's not enforced, it cannot be assumed to be valid, regardless of whether it was valid in the past. I'm not sure what

Re: [PATCH] Optionally record Plan IDs to track plan changes for a query

2025-02-12 Thread Alvaro Herrera
On 2025-Feb-12, Julien Rouhaud wrote: > > FWIW, I think options to tweak queryId computation is something that > > should be in core. It was discussed earlier in the context of IN > > list merging; the patch for this currently has the guc for the > > feature in pg_stat_statements, but there was a

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Ranier Vilela
Em qua., 12 de fev. de 2025 às 00:54, Michael Paquier escreveu: > On Tue, Feb 11, 2025 at 01:32:32PM -0300, Euler Taveira wrote: > > There is no bug. They are the same behind the scenes. I'm fine changing > it. It > > is a new code and it wouldn't cause a lot of pain to backpatch patches > in the

Re: TAP test command_fails versus command_fails_like

2025-02-12 Thread Dagfinn Ilmari Mannsåker
Ashutosh Bapat writes: > On Wed, Feb 12, 2025 at 10:36 AM Peter Smith wrote: >> >> Hi hackers, >> >> Recently, while writing some new TAP tests my colleague inadvertently >> called the command_fails() subroutine instead of command_fails_like() >> subroutine. Their parameters are almost the same

Re: [PATCH] Optionally record Plan IDs to track plan changes for a query

2025-02-12 Thread Julien Rouhaud
On Wed, Feb 12, 2025 at 01:57:47PM +0100, Alvaro Herrera wrote: > On 2025-Feb-12, Julien Rouhaud wrote: > > > > FWIW, I think options to tweak queryId computation is something that > > > should be in core. It was discussed earlier in the context of IN > > > list merging; the patch for this currentl

Re: NOT ENFORCED constraint feature

2025-02-12 Thread Peter Eisentraut
On 12.02.25 12:13, Álvaro Herrera wrote: On 2025-Feb-12, Ashutosh Bapat wrote: I have been asking a different question: What's the use of not-enforced constraints if we don't allow VALID, NOT ENFORCED state for them? That's a question for the SQL standards committee. They may serve schema do

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-12 Thread Peter Eisentraut
On 08.02.25 02:56, Jacob Champion wrote: On Fri, Feb 7, 2025 at 12:12 PM Daniel Gustafsson wrote: Is it really enough to do this at build time? A very small percentage of users running this will also be building their own libpq so the warning is lost on them. That being said, I'm not entirely

Re: Parallel CREATE INDEX for GIN indexes

2025-02-12 Thread Matthias van de Meent
On Tue, 7 Jan 2025 at 12:59, Tomas Vondra wrote: > > On 1/6/25 20:13, Matthias van de Meent wrote: >> ... >>> >>> Thanks. Attached is a rebased patch series fixing those issues, and one >>> issue I found in an AssertCheckGinBuffer, which was calling the other >>> assert (AssertCheckItemPointers) e

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-12 Thread Peter Eisentraut
On 08.02.25 02:56, Jacob Champion wrote: + oauth_json_set_error(ctx, /* don't bother translating */ With the project style format for translator comments this should be: + /* translator: xxx */ + oauth_json_set_error(ctx, This comment was just meant to draw attention

Re: Adding NetBSD and OpenBSD to Postgres CI

2025-02-12 Thread Andres Freund
Hi, I finally pushed this. The meson fix backpatched to 16. I did some very minor polishing, reordering the OS lists to stay alphabetical, instead of adding netbsd/openbsd somewhere to the front of lists. Thanks for the patches! Obviously not your fault, but I do think it's pretty crazy that w

Re: Improve CRC32C performance on SSE4.2

2025-02-12 Thread John Naylor
On Wed, Feb 12, 2025 at 4:34 AM Devulapalli, Raghuveer wrote: > > On my machine that still regresses compared to master in that range > > (although by > > not as much) so I still think 128 bytes is the right threshold. > > On my TGL, buffer sizes as small as 64 bytes see performance benefits. Y

Re: Question about UpdateFullPageWrites() at the end of recovery.

2025-02-12 Thread Fujii Masao
On 2025/02/08 8:44, Masahiko Sawada wrote: Hi, I have a question about the comment of UpdateFullPageWrites() called at the end of recovery (in StartupXLOG()): /* * Update full_page_writes in shared memory and write an XLOG_FPW_CHANGE * record before resource manager writes c

Re: Fix assert failure when decoding XLOG_PARAMETER_CHANGE on primary

2025-02-12 Thread Amit Kapila
On Wed, Feb 12, 2025 at 1:16 AM Masahiko Sawada wrote: > > On Mon, Feb 10, 2025 at 4:11 AM Amit Kapila wrote: > > > > On Fri, Feb 7, 2025 at 11:30 PM Masahiko Sawada > > wrote: > > > > > > On Thu, Feb 6, 2025 at 9:30 PM Amit Kapila > > > wrote: > > > > > > > > True but it sounds like there is

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Andres Freund
Hi, On 2025-02-11 13:32:32 -0300, Euler Taveira wrote: > On Mon, Feb 10, 2025, at 1:31 PM, Ranier Vilela wrote: > > Coverity has some reports about pg_createsubcriber. > > > > CID 1591322: (#1 of 1): Resource leak (RESOURCE_LEAK) > > 10. leaked_storage: Variable dbname going out of scope leaks th

Re: SQL:2011 application time

2025-02-12 Thread Peter Eisentraut
On 05.02.25 19:31, Paul Jungwirth wrote: On 2/5/25 05:37, Peter Eisentraut wrote: On 29.01.25 07:34, Paul Jungwirth wrote: Is it possible to commit an RI_PLAN_NO_ACTION addition and see if that makes the buildfarm failures go away? Here is a proposed patch for that (v48.1). I would understand

Re: Address the bug in 041_checkpoint_at_promote.pl

2025-02-12 Thread Nitin Jadhav
> Removing the wakeup makes the test > complete, but it should wait in its lookup loop. Thank you for confirming. Besides fixing the if condition as done in the patch, do you think any other changes are necessary? Best Regards, Nitin Jadhav Azure Database for PostgreSQL Microsoft On Wed, Feb 12,

Re: explain analyze rows=%.0f

2025-02-12 Thread Ilia Evdokimov
On 12.02.2025 11:54, Andrei Lepikhov wrote: May we agree on a more general formula to print at least two meaningful digits if we have a fractional part? Examples: - actual rows = 2, nloops = 2 -> rows = 1 - actual rows = 9, nloops = 5 -> rows = 1.8 - actual rows = 101, nloops = 100 -> rows =

Re: Unneeded volatile qualifier in fmgr.c

2025-02-12 Thread Bertrand Drouvot
Hi, On Wed, Feb 12, 2025 at 04:25:38PM +0800, Julien Rouhaud wrote: > Hi, > > While reading some code in fmgr.c I noticed that the save_nestlevel variable > is > declared as volatile. I'm assuming that's because a long time ago it was > modified in the PG_TRY / PG_CATCH block but it doesn't loo

Re: Address the bug in 041_checkpoint_at_promote.pl

2025-02-12 Thread Nitin Jadhav
> > Removing the wakeup makes the test > > complete, but it should wait in its lookup loop. > > Thank you for confirming. Besides fixing the if condition as done in > the patch, do you think any other changes are necessary? I see that it's already been committed and understand that no other change

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-02-12 Thread Rushabh Lathia
On Mon, Feb 10, 2025 at 10:48 PM Rushabh Lathia wrote: > Hi Alvaro, > > I have incorporated the suggested changes, and here is the latest version > of the patch: > >- Added more test cases to the regression suite. >- Included tests in the pg_dump test. >- Left objects with *INVALID NO

Re: Add “FOR UPDATE NOWAIT” lock details to the log.

2025-02-12 Thread Fujii Masao
On 2025/02/03 21:30, Yuki Seino wrote: Thank you for your comment. Sorry for being late. SELECT FOR UPDATE SKIP LOCKED might skip a large number of rows, leading to a high volume of log messages from log_lock_failure in your current patch. Could this be considered unintended behavior? Would

Re: Expanding HOT updates for expression and partial indexes

2025-02-12 Thread Burd, Greg
Matthias, Thanks for the in-depth review, you are correct and I appreciate you uncovering that oversight with summarizing indexes. I’ll add a test case and modify the logic to prevent updates to unchanged summarizing indexes by testing their attributes against the modified set while keeping th

Re: Unneeded volatile qualifier in fmgr.c

2025-02-12 Thread Nathan Bossart
On Wed, Feb 12, 2025 at 08:41:34AM +, Bertrand Drouvot wrote: > On Wed, Feb 12, 2025 at 04:25:38PM +0800, Julien Rouhaud wrote: >> While reading some code in fmgr.c I noticed that the save_nestlevel variable >> is >> declared as volatile. I'm assuming that's because a long time ago it was >>

Re: TAP test command_fails versus command_fails_like

2025-02-12 Thread Andrew Dunstan
On 2025-02-12 We 8:58 AM, Dagfinn Ilmari Mannsåker wrote: Another question is whether command_fails and command_fails_like is the only pair or there are more which need stricter checks? If we do this, we should do it across the board for PostgreSQL::Test::Utils and ::Cluster at least. Once

Re: MAX_BACKENDS size (comment accuracy)

2025-02-12 Thread Andres Freund
Hi, On 2025-02-09 12:41:58 -0800, Jacob Brazeal wrote: > > Halfing the size of LWLock and laying > > the ground work for making the wait-list lock-free imo would be very well > > worth the reduction in an unrealistic limit... > > BTW, I spent a week or two researching the lock-free queue idea, > s

Re: [PATCH] Optionally record Plan IDs to track plan changes for a query

2025-02-12 Thread Alvaro Herrera
On 2025-Feb-12, Julien Rouhaud wrote: > On Wed, Feb 12, 2025 at 01:57:47PM +0100, Alvaro Herrera wrote: > > Anyway, I think that's different. We do support compute_query_id=off as > > a way for a custom module to compute completely different query IDs > > using their own algorithm, which I think

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Tom Lane
Andres Freund writes: > On 2025-02-11 13:32:32 -0300, Euler Taveira wrote: >> There is no bug. They are the same behind the scenes. > That *is* a bug. On windows the allocator that a shared library (i.e. libpq) > uses, may *not* be the same as the one that an executable > (i.e. pg_createsubscribe

Re: Change GUC hashtable to use simplehash?

2025-02-12 Thread Anton A. Melnikov
Hi, John! On 13.02.2025 04:49, John Naylor wrote: On Thu, Feb 13, 2025 at 3:42 AM Anton A. Melnikov wrote: On 29.01.2025 10:02, John Naylor wrote: This is done -- thanks for the report, and for testing. It's good that this is done! But i still see the problem. Hi, my understanding was y

Re: Statistics Import and Export

2025-02-12 Thread Jeff Davis
On Tue, 2025-02-11 at 14:02 -0500, Corey Huinker wrote: > > > The previous 0001 is now committed (thanks!) so only one remains. >   Summary of the decisions made in this thread: * pg_dump --data-only does not include stats[1]. This behavior was not fully resolved, but I didn't see a reaso

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-12 Thread Thomas Munro
On Thu, Feb 13, 2025 at 1:40 PM Melanie Plageman wrote: > On Sun, Feb 9, 2025 at 9:27 AM Tomas Vondra wrote: > > For the nvme RAID (device: raid-nvme), it's looks almost exactly the > > same, except that with parallel query (page 27) there's a clear area of > > regression with eic=1 (look for "co

Re: [PATCH] Optionally record Plan IDs to track plan changes for a query

2025-02-12 Thread Sami Imseih
>> On Mon, Feb 10, 2025 at 02:02:10PM -0600, Sami Imseih wrote: >> > I am OK with moving away from "jumble" in-lieu of something else, but my >> > thoughts are we should actually call this process "fingerprint" > > > I agree fingerprint is the right final word. But "jumble" conveys the > *process

Re: Track the amount of time waiting due to cost_delay

2025-02-12 Thread Bertrand Drouvot
Hi, On Wed, Feb 12, 2025 at 11:13:13AM -0600, Nathan Bossart wrote: > On Wed, Feb 12, 2025 at 06:19:12AM +, Bertrand Drouvot wrote: > > Thanks! Regarding 0003 I think it's ok to keep it in this thread (and not > > create a dedicated one), as it still fits well with $SUBJECT (and the folks > >

Re: Change GUC hashtable to use simplehash?

2025-02-12 Thread John Naylor
On Thu, Feb 13, 2025 at 9:58 AM Anton A. Melnikov wrote: > > Hi, my understanding was you previously tested with the revert. Did > > you not actually test, or are you building differently for these > > cases? > > My first test [1] was made at b7493e1 > while the second [2] at ecb8226a after revert

Re: Fix for a crash caused by triggers in cross-partition updates

2025-02-12 Thread Michael Paquier
On Fri, Feb 07, 2025 at 03:47:02PM +0900, Michael Paquier wrote: > Hmm.. Agreed, it seems that you are right in the way of taking care > of this inconsistency. That's interesting. I would need to look at > that more closely with a couple of hours head down. It's a bit late > in the week here so

Re: Change GUC hashtable to use simplehash?

2025-02-12 Thread Anton A. Melnikov
Hi! On 13.02.2025 09:03, John Naylor wrote: Three weeks ago, you said "Agreed that reverting seems as a preferable way, and here's why." I assumed that meant you tested it, so my mistake. I'll take a look. Sorry! I was wrong not to express my thoughts clearly here. I meant revert in a common

Re: Proposal - Allow extensions to set a Plan Identifier

2025-02-12 Thread Bertrand Drouvot
Hi, On Wed, Feb 12, 2025 at 05:44:20PM -0600, Sami Imseih wrote: > Meanwhile, existing extensions like pg_stat_monitor [3] compute a planId and > store the plan text, but they lack a way to expose planId in pg_stat_activity. > This limits their usefulness, as identifying top or long-running plans

Re: Add isolation test template in injection_points for wait/wakeup/detach

2025-02-12 Thread Michael Paquier
On Fri, Feb 07, 2025 at 01:41:20PM +0900, Michael Paquier wrote: > I have done a total of 10 runs in the CI with the attached, without > getting a failure. HEAD was failing a bit more easily than that, with > at least one failure every 5 runs in my branches. Will go adjust that > in a bit as per

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Michael Paquier
On Wed, Feb 12, 2025 at 07:08:31PM -0500, Tom Lane wrote: > I spent a little time earlier today seeing what I could do with the > use-dmalloc patch I posted earlier. It turns out you can get through > initdb after s/free/PQfreemem/ in just two places, and then the > backend works fine. But psql i

DOCS - Question about pg_sequences.last_value notes

2025-02-12 Thread Peter Smith
Hi, I noticed the pg_sequences system-view DOCS page [1] has a note about the 'last_value' field. But the note is not within the row for that field. Indeed, it is not even within the table. Is it deliberate? Apparently, this changed in commit 3cb2f13 [2], so CC-ing author Nathan. My attached pat

Re: EquivalenceClass and custom_read_write

2025-02-12 Thread Ashutosh Bapat
On Wed, Feb 12, 2025 at 10:25 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > In pathnodes.h > > typedef struct EquivalenceClass > > { > > pg_node_attr(custom_read_write, no_copy_equal, no_read, no_query_jumble) > > > Because of custom_read_write attribute, I expect _outEquivalenceClass > > to

Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-12 Thread Evgeny Voropaev
Hello hackers! The functions, bootstrapping SLRU pages, such as BootStrapMultiXact, BootStrapCLOG, ActivateCommitTs, multixact_redo and others, have a lot of repetitive code. A new proposed function BootStrapSlruPage moves a duplicating code into the single place. Additionally, a new member

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-02-12 Thread Shubham Khanna
On Thu, Feb 13, 2025 at 4:48 AM Peter Smith wrote: > > Some review comments for v7-0001 > > == > src/bin/pg_basebackup/pg_createsubscriber.c > > 1. > + /* Error if no databases were found on the source server */ > + if (num_rows == 0) > + { > + pg_log_error("no convertable databases found on t

Re: NOT ENFORCED constraint feature

2025-02-12 Thread Ashutosh Bapat
On Wed, Feb 12, 2025 at 8:15 PM Peter Eisentraut wrote: > > On 12.02.25 12:13, Álvaro Herrera wrote: > > On 2025-Feb-12, Ashutosh Bapat wrote: > > > >> I have been asking a different question: What's the use of > >> not-enforced constraints if we don't allow VALID, NOT ENFORCED state > >> for them

Re: Address the bug in 041_checkpoint_at_promote.pl

2025-02-12 Thread Ashutosh Bapat
On Thu, Feb 13, 2025 at 5:08 AM Michael Paquier wrote: > > Anyway, how did you find that? Did you see a pattern when running the > test on a very slow machine or just from a read? That was a good > catch. +1. I was wondering the same. -- Best Wishes, Ashutosh Bapat

Re: Restrict publishing of partitioned table with a foreign table as partition

2025-02-12 Thread vignesh C
On Tue, 11 Feb 2025 at 16:55, Shlok Kyal wrote: > I have handled the above cases and added tests for the same. There is a concurrency issue with the patch: +check_partrel_has_foreign_table(Form_pg_class relform) +{ + boolhas_foreign_tbl = false; + + if (relform->relkind ==

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Andres Freund writes: >> Particularly for something like libpq it's not quitetrivial to add >> attributes like this, of course. We can't even depend on pg_config.h. >> One way would be to define them in libpq-fe.h, guarded by an #ifdef, that's >

Re: explain analyze rows=%.0f

2025-02-12 Thread Robert Haas
On Tue, Feb 11, 2025 at 2:18 PM Ilia Evdokimov wrote: > With such example, it's hard to disagree with it. This would really add > valuable information. Taking all opinions into account, I have updated > the patch v8. I have also included a check for the case where there are > only zeros after the

Re: pg_stat_statements and "IN" conditions

2025-02-12 Thread Dmitry Dolgov
> On Tue, Feb 11, 2025 at 08:00:27PM GMT, Dmitry Dolgov wrote: > > Hmm, what about doing something much simpler, such as testing whether > > there's just a CoerceViaIO/RelabelType around a Const or a one-parameter > > function call of an immutable boostrap-OID function that has a Const as > > argum

Re: Get rid of WALBufMappingLock

2025-02-12 Thread Yura Sokolov
08.02.2025 13:07, Alexander Korotkov пишет: > On Fri, Feb 7, 2025 at 1:39 PM Alexander Korotkov > wrote: >> Good, thank you. I think 0001 patch is generally good, but needs some >> further polishing, e.g. more comments explaining how does it work. I tried to add more comments. I'm not good at,

Re: explain analyze rows=%.0f

2025-02-12 Thread Robert Haas
On Wed, Feb 12, 2025 at 5:10 AM Ilia Evdokimov wrote: > I think the idea of keeping two significant digits after the decimal > point is quite reasonable. The thing is, rows=0.01 or something > similar can only occur when loops is quite large. If we show the order > of magnitude in rows, it wil

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-12 Thread Robert Haas
On Wed, Feb 12, 2025 at 3:07 PM Tomas Vondra wrote: > AFAICS the "1" value is simply one of the many "defensive" defaults in > our sample config. It's much more likely to help than cause harm, even > on smaller/older systems, but for many systems a higher value would be > more appropriate. There's

RE: Improve CRC32C performance on SSE4.2

2025-02-12 Thread Devulapalli, Raghuveer
Hi, > 2. Unfortunately, there is another wrinkle that I failed to consider: If you > search > the web for "VirtualBox pclmulqdq" you can see a few reports from not very > long > ago that some hypervisors don't enable the CPUID for pclmul. I don't know how > big a problem that is in practice tod

Re: describe special values in GUC descriptions more consistently

2025-02-12 Thread Nathan Bossart
Here is what I have staged for commit, which I intend to do within the next couple of days unless there is additional feedback. In v4, I've added a commit message, removed the changes to the ssl_crl_* parameters, and fixed a couple of very small mistakes. -- nathan >From 3205f1172ac6ec2a82171bba

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Tom Lane
Ranier Vilela writes: > Coverity has some reports about pg_createsubcriber. > CID 1591322: (#1 of 1): Resource leak (RESOURCE_LEAK) > 10. leaked_storage: Variable dbname going out of scope leaks the storage it > points to. FTR, the security team's Coverity instance also complained about that. I

Re: Improve CRC32C performance on SSE4.2

2025-02-12 Thread Nathan Bossart
On Wed, Feb 12, 2025 at 09:02:27PM +, Devulapalli, Raghuveer wrote: > Also, do we really need to have both USE_SSE42_CRC32C and > USE_SSE42_CRC32C_WITH_RUNTIME_CHECK > features support? The former macro is used to enable running the SSE42 > version without a runtime check > when someone buil

Re: TAP test command_fails versus command_fails_like

2025-02-12 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Andrew Dunstan writes: >> Is there any reason we can't move to 5.20? Are there any buildfarm >> animals using such an old version? 5.20 is now almost 10 years old. > Red Hat Enterprise Linux 7 has Perl 5.16 and is on Extended Lifecycle > Suppor

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Dagfinn Ilmari Mannsåker
Andres Freund writes: > Hi, > > On 2025-02-12 11:02:04 -0500, Tom Lane wrote: >> I wish we had some way to detect misuses automatically ... >> >> This seems like the sort of bug that Coverity could detect if only it >> knew to look, but I have no idea if it could be configured that way. >> Maybe

Re: pg_stat_statements and "IN" conditions

2025-02-12 Thread Dmitry Dolgov
> On Wed, Feb 12, 2025 at 07:39:39PM GMT, Álvaro Herrera wrote: > The nastiness level of this seems quite low, compared to what happens to > this other example if we didn't handle these easy cases: > > create table t (a float); > select i from t where i in (1, 2); > select i from t where i in (1, '

Re: Allow io_combine_limit up to 1MB

2025-02-12 Thread Andres Freund
Hi, On 2025-02-12 15:24:21 +1300, Thomas Munro wrote: > On Wed, Feb 12, 2025 at 3:22 PM Andres Freund wrote: > > On 2025-02-12 13:59:21 +1300, Thomas Munro wrote: > > > How about just maintaining it in a new variable > > > effective_io_combine_limit, whenever either of them is assigned? > > > > Y

Re: Add -k/--link option to pg_combinebackup

2025-02-12 Thread Robert Haas
Some more review: +Use hard links instead of copying files to the synthetic backup. +Reconstruction of the synthetic backup might be faster (no file copying ) +and use less disk space. I think it would be good to add a caveat at the end of this sentence: and use less disk

Re: explain analyze rows=%.0f

2025-02-12 Thread Robert Haas
On Wed, Feb 12, 2025 at 2:55 PM Andrei Lepikhov wrote: > On 13/2/2025 01:40, Tom Lane wrote: > > I was idly speculating yesterday about letting the Ryu code print > > the division result, so that we get a variable number of digits. > > Realistically, that'd probably result in many cases in more di

Re: explain analyze rows=%.0f

2025-02-12 Thread Andrei Lepikhov
On 13/2/2025 01:40, Tom Lane wrote: I was idly speculating yesterday about letting the Ryu code print the division result, so that we get a variable number of digits. Realistically, that'd probably result in many cases in more digits than anybody wants, so it's not a serious proposal. I'm cool w

Re: Add -k/--link option to pg_combinebackup

2025-02-12 Thread Robert Haas
Oh, one more thing: +If a backup manifest is not available or does not contain checksum of +the right type, file cloning will be used to copy the file, but the +file will be also read block-by-block for the checksum calculation. s/file cloning will be used to copy the file

Re: dblink: Add SCRAM pass-through authentication

2025-02-12 Thread Matheus Alcantara
Hi, thanks for reviewing this patch! Em seg., 10 de fev. de 2025 às 20:19, Jacob Champion escreveu: > > On Wed, Jan 22, 2025 at 6:10 AM Matheus Alcantara > wrote: > > The attached patch enables SCRAM authentication for dblink connections when > > using dblink_fdw without requiring a plain-text p

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-12 Thread Tomas Vondra
On 2/12/25 20:08, Robert Haas wrote: > On Mon, Feb 10, 2025 at 4:41 PM Melanie Plageman > wrote: >> I had taken to thinking of it as "queue depth". But I think that's not >> really accurate. Do you know why we set it to 1 as the default? I >> thought it was because the default should be just pr

Cost-based delay for (other) maintenance operations

2025-02-12 Thread Christophe Pettus
We've run into multiple situations recently where clients were effectively unable to run CREATE INDEX or REINDEX (CONCURRENTLY or otherwise) due to the load that they imposed on the system, mostly in I/O. I'd like to propose a cost-based delay system for maintenance operations such as these, pa

Re: Add “FOR UPDATE NOWAIT” lock details to the log.

2025-02-12 Thread Jelte Fennema-Nio
On Wed, 12 Feb 2025 at 12:32, Fujii Masao wrote: > > What do you think if we simply don't log anything for SKIP LOCKED? > > Implementing both NOWAIT and SKIP LOCKED could take time and make the patch > more complex. I'm fine with focusing on the NOWAIT case first as an initial > patch. I think t

Re: AIO v2.3

2025-02-12 Thread Robert Haas
On Tue, Feb 11, 2025 at 4:43 PM Andres Freund wrote: > Alternatively we could make pgaio_batch_begin() basically start a critical > section, but that doesn't seem like a good idea, because too much that needs > to happen around buffered IO isn't compatible with critical sections. A critical secti

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Tom Lane
I experimented with the other approach: hack libpq.so to depend on dmalloc, leaving the rest of the system alone, so that libpq's allocations could not be freed elsewhere nor vice versa. It could not even get through initdb, crashing here: replace_guc_value(char **lines, const char *guc_name, con

Re: explain analyze rows=%.0f

2025-02-12 Thread Tom Lane
Robert Haas writes: > I agree that showing 2 digits after the decimal point in all cases is > not ideal, but I suggest that we take a practical approach. Figuring > out dynamically what number of decimal digits to display in each case > sounds complicated and we may spend a bunch of time arguing a

Re: pg_stat_statements and "IN" conditions

2025-02-12 Thread Álvaro Herrera
On 2025-Feb-12, Dmitry Dolgov wrote: > I've been experimenting with this today, and while it's easy to > implement, Great. > there is one annoying thing for which I don't have a solution > yet. When generating a normalized version for such merged queries in > pgss we rely on expression location,

Re: Change GUC hashtable to use simplehash?

2025-02-12 Thread Anton A. Melnikov
Hi! On 29.01.2025 10:02, John Naylor wrote: This is done -- thanks for the report, and for testing. It's good that this is done! But i still see the problem. At ecb8226a in master with the same configure as in [1] (with asserts) valgrind gives: ==00:00:00:23.937 285792== Conditional jump or m

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Tom Lane writes: >> libpq-fe.h has to be compilable by application code that has never >> heard of pg_config.h let alone c.h, so we'd have to tread carefully >> about not breaking that property. But it seems like this would be >> worth looking

Re: TAP test command_fails versus command_fails_like

2025-02-12 Thread Dagfinn Ilmari Mannsåker
Andrew Dunstan writes: > On 2025-02-12 We 8:58 AM, Dagfinn Ilmari Mannsåker wrote: >> >>> Another question is whether command_fails and command_fails_like is >>> the only pair or there are more which need stricter checks? >> If we do this, we should do it across the board for >> PostgreSQL::Test:

Re: TAP test command_fails versus command_fails_like

2025-02-12 Thread Dagfinn Ilmari Mannsåker
Dagfinn Ilmari Mannsåker writes: > Andrew Dunstan writes: > >> On 2025-02-12 We 8:58 AM, Dagfinn Ilmari Mannsåker wrote: >>> Another question is whether command_fails and command_fails_like is the only pair or there are more which need stricter checks? >>> If we do this, we should do i

Re: Track the amount of time waiting due to cost_delay

2025-02-12 Thread Nathan Bossart
On Wed, Feb 12, 2025 at 06:19:12AM +, Bertrand Drouvot wrote: > Thanks! Regarding 0003 I think it's ok to keep it in this thread (and not > create a dedicated one), as it still fits well with $SUBJECT (and the folks > interested in are probably already part of this thread). Sounds good to you?

Re: AIO v2.3

2025-02-12 Thread James Hunter
On Tue, Feb 11, 2025 at 1:44 PM Andres Freund wrote: > ... > Alternatively we could make pgaio_batch_begin() basically start a critical > section, but that doesn't seem like a good idea, because too much that needs > to happen around buffered IO isn't compatible with critical sections. > > > Does

Re: Parallel heap vacuum

2025-02-12 Thread Masahiko Sawada
On Tue, Jan 21, 2025 at 11:05 AM Masahiko Sawada wrote: > > On Sun, Jan 19, 2025 at 7:50 AM Tomas Vondra wrote: > > > > Hi, > > > > Thanks for the new patches. I've repeated my benchmarking on v8, and I > > agree this looks fine - the speedups are reasonable and match what I'd > > expect on this

Re: describe special values in GUC descriptions more consistently

2025-02-12 Thread Nathan Bossart
On Thu, Feb 13, 2025 at 09:02:30AM +1100, Peter Smith wrote: > One last thing... > > - gettext_noop("Zero logs all files. The default is -1 (turning this > feature off)."), > + gettext_noop("-1 disables temporary file logs. 0 means log all > temporary files."), > > The first sentence could be amb

RE: Improve CRC32C performance on SSE4.2

2025-02-12 Thread Devulapalli, Raghuveer
> > Sounds good to me. Although, users building with just -msse4.2 will > > now encounter an an additional pclmul runtime check. That would be a > > regression unless they update to building with both -msse4.2 and -mpclmul. > > My thinking was that building with just -msse4.2 would cause the exi

Unneeded volatile qualifier in fmgr.c

2025-02-12 Thread Julien Rouhaud
Hi, While reading some code in fmgr.c I noticed that the save_nestlevel variable is declared as volatile. I'm assuming that's because a long time ago it was modified in the PG_TRY / PG_CATCH block but it doesn't look needed anymore. Trivial patch attached. diff --git a/src/backend/utils/fmgr/fmg

Re: Address the bug in 041_checkpoint_at_promote.pl

2025-02-12 Thread Michael Paquier
On Wed, Feb 12, 2025 at 01:28:55PM +0530, Nitin Jadhav wrote: > The code is intended to wait for the restart point to complete before > proceeding. However, it doesn't actually wait. Regardless of whether > the restart point completes, the loop exits after the first iteration > because the if condi

Re: describe special values in GUC descriptions more consistently

2025-02-12 Thread David G. Johnston
On Wed, Feb 12, 2025 at 3:47 PM Nathan Bossart wrote: > Good catch. I've fixed that in v5. > > I presume it doesn't affect the actual output which just concatenates the fragments together but the source placement probably should be made consistent; the line containing the initial default value s

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Michael Paquier
On Wed, Feb 12, 2025 at 12:00:03PM -0500, Andres Freund wrote: > Particularly for something like libpq it's not quitetrivial to add > attributes like this, of course. We can't even depend on pg_config.h. > > One way would be to define them in libpq-fe.h, guarded by an #ifdef, that's > "armed" by a

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Michael Paquier
On Wed, Feb 12, 2025 at 01:35:20PM -0500, Tom Lane wrote: > For amusement's sake, totally dirty hack-and-slash patch attached. > (I tested this on macOS, with dmalloc from MacPorts; adjust SHLIB_LINK > to suit on other platforms.) Ugh. Fun one. -- Michael signature.asc Description: PGP signatur

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Tom Lane
Michael Paquier writes: > I have looked at bit at the uses of PQescapeLiteral() and > PQescapeIdentifier() in the tree. On top of the one in pg_amcheck you > are just pointing to, there is an inconsistency in pg_upgrade.c for > set_locale_and_encoding() where datlocale_literal may be allocated >

Re: Change GUC hashtable to use simplehash?

2025-02-12 Thread John Naylor
On Thu, Feb 13, 2025 at 3:42 AM Anton A. Melnikov wrote: > > Hi! > > On 29.01.2025 10:02, John Naylor wrote: > > This is done -- thanks for the report, and for testing. > > It's good that this is done! But i still see the problem. Hi, my understanding was you previously tested with the revert. Di

Re: Skip collecting decoded changes of already-aborted transactions

2025-02-12 Thread Masahiko Sawada
On Tue, Feb 11, 2025 at 9:43 PM Peter Smith wrote: > > Hi. Here are some minor comments for the v18* patch set. > > // > > Patch v18-0001 > > 1.1. Commit message > > A previously reported typo still exists: > > /noticeble/noticeable/ > > // > > Patch v18-0002 > > 2.1 > +#define RBT

Re: Separate GUC for replication origins

2025-02-12 Thread Masahiko Sawada
On Tue, Feb 11, 2025 at 12:27 PM Euler Taveira wrote: > > On Wed, Feb 5, 2025, at 9:49 PM, Masahiko Sawada wrote: > > On Wed, Feb 5, 2025 at 4:39 PM Euler Taveira wrote: > > > > On Wed, Feb 5, 2025, at 1:56 AM, Amit Kapila wrote: > > > > On Wed, Feb 5, 2025 at 8:17 AM Euler Taveira wrote: > > >

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-02-12 Thread Peter Smith
Some review comments for v7-0001 == src/bin/pg_basebackup/pg_createsubscriber.c 1. + /* Error if no databases were found on the source server */ + if (num_rows == 0) + { + pg_log_error("no convertable databases found on the source server"); + pg_log_error_hint("Ensure that there are non-templ

Proposal - Allow extensions to set a Plan Identifier

2025-02-12 Thread Sami Imseih
Hi, A patch by Lukas Fittl [1] introduces the pg_stat_plans extension, which exposes execution plans along with execution statistics. As part of this work, a new infrastructure is being proposed to compute a plan identifier (planId), which is exposed in both pg_stat_plans and pg_stat_activity. Ex

Re: Address the bug in 041_checkpoint_at_promote.pl

2025-02-12 Thread Michael Paquier
On Wed, Feb 12, 2025 at 04:50:34PM +0530, Nitin Jadhav wrote: > I see that it's already been committed and understand that no other > changes are needed. Thank you! My apologies for the lack of updates here. I've looked at the whole test again yesterday and the issue that you have reported was th

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Ranier Vilela
Hi. Em qua., 12 de fev. de 2025 às 13:02, Tom Lane escreveu: > Andres Freund writes: > > On 2025-02-11 13:32:32 -0300, Euler Taveira wrote: > >> There is no bug. They are the same behind the scenes. > > > That *is* a bug. On windows the allocator that a shared library (i.e. > libpq) > > uses, m

Re: Small memory fixes for pg_createsubcriber

2025-02-12 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: >> Andres Freund writes: >>> Particularly for something like libpq it's not quitetrivial to add >>> attributes like this, of course. We can't even depend on pg_config.h. >>> One way would be to define them in libpq-fe.h, guard

  1   2   >