Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-26 Thread Andrew Dunstan
On 2025-01-24 Fr 1:59 PM, Dagfinn Ilmari Mannsåker wrote: Tom Lane writes: Michael Paquier writes: On Thu, Jan 23, 2025 at 08:25:45PM +, Dagfinn Ilmari Mannsåker wrote: Here's a patch for that. Thanks. I had a bit of time today and applied it. BF member drongo doesn't like the new t

Re: Non-text mode for pg_dumpall

2025-01-26 Thread jian he
hi. attached patching trying to refactor ReadOneStatement for properly handling the single and double quotes. the commit message also has some tests on it. it is based on your v11_pg_dumpall-with-directory-tar-custom-format-21-jan.patch. v11-0001-refactoring-ReadOneStatement.no-cfbot Description

Re: Convert sepgsql tests to TAP

2025-01-26 Thread Peter Eisentraut
On 25.01.25 22:55, Tom Lane wrote: Peter Eisentraut writes: This has been committed. And I understand there is a buildfarm client update available for the affected buildfarm members. BTW, shouldn't the CF entry for this get closed now? done

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-26 Thread Yura Sokolov
24.01.2025 12:07, Japin Li пишет: On Thu, 23 Jan 2025 at 21:44, Japin Li wrote: On Thu, 23 Jan 2025 at 15:03, Yura Sokolov wrote: 23.01.2025 11:46, Japin Li пишет: On Wed, 22 Jan 2025 at 22:44, Japin Li wrote: On Wed, 22 Jan 2025 at 17:02, Yura Sokolov wrote: I believe, I know why it hap

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-26 Thread Yura Sokolov
24.01.2025 12:07, Japin Li wrote: On Thu, 23 Jan 2025 at 21:44, Japin Li wrote: On Thu, 23 Jan 2025 at 15:03, Yura Sokolov wrote: 23.01.2025 11:46, Japin Li пишет: On Wed, 22 Jan 2025 at 22:44, Japin Li wrote: On Wed, 22 Jan 2025 at 17:02, Yura Sokolov wrote: I believe, I know why it hap

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2025-01-26 Thread Srinath Reddy
as suggested did the changes and attached the patch for the same. Regards, Srinath Reddy Sadipiralla, EDB: http://www.enterprisedb.com On Sun, Jan 26, 2025 at 3:20 AM Tom Lane wrote: > Srinath Reddy Sadipiralla writes: > >> On Thu, 05 Dec 2024 21:11:42 +0530 Andres Freund and...@anarazel

Re: speedup COPY TO for partitioned table.

2025-01-26 Thread jian he
On Wed, Jan 22, 2025 at 6:54 AM Melih Mutlu wrote: > > Hi Jian, > > Thanks for the patch. > > jian he , 19 Ara 2024 Per, 15:03 tarihinde şunu > yazdı: >> >> attached copy_par_regress_test.sql is a simple benchmark sql file, >> a partitioned table with 10 partitions, 2 levels of indirection. >> Th

Re: add function argument name to substring and substr

2025-01-26 Thread jian he
hi. I forgot to attach the patch. here we are. From 249a083627b0d8ad15c698601f7b7649be5262a1 Mon Sep 17 00:00:00 2001 From: jian he Date: Wed, 22 Jan 2025 14:19:15 +0800 Subject: [PATCH v1 1/1] add function argument name to function substring and substr --- src/backend/catalog/system_functions

Re: MAX_BACKENDS size (comment accuracy)

2025-01-26 Thread Jacob Brazeal
Looking at v1-0003-WIP-Base-LWLock-limits-directly-on-MAX_BACKENDS.patch, I'm curious about the following assert; > #define LW_VAL_EXCLUSIVE (MAX_BACKENDS + 1) ... > StaticAssertDecl(MAX_BACKENDS < LW_VAL_EXCLUSIVE, "MAX_BACKENDS too big for lwlock.c"); Since LW_VAL_EXCLUSIVE is already defined

Re: XMLDocument (SQL/XML X030)

2025-01-26 Thread Jim Jones
Hi Chapman & Pavel On 25.01.25 16:05, Pavel Stehule wrote: > > > so 25. 1. 2025 v 15:10 odesílatel Chapman Flack napsal: > > On 01/25/25 02:16, Pavel Stehule wrote: > > because the function does nothing, then it is useless to convert > input to > > XML and force detosting > >

Re: MAX_BACKENDS size (comment accuracy)

2025-01-26 Thread Andres Freund
Hi, On 2025-01-25 16:06:29 -0800, Jacob Brazeal wrote: > > In lwlocks.c, we have the following comment, related to LWLock state: > > > > > > */* Must be greater than MAX_BACKENDS - which is 2^23-1, so we're fine. > > */#define LW_SHARED_MASK ((uint32) ((1 << 24)-1))* > > > > However, MAX_BACKENDS

Re: MAX_BACKENDS size (comment accuracy)

2025-01-26 Thread Andres Freund
Hi, On 2025-01-25 23:35:51 -0800, Jacob Brazeal wrote: > While we are on the topic of comments from lwlock.c, there is one other one > that confused me, in LWLockWaitListLock: > * /* and then spin without atomic operations until lock is released */ { > SpinDelayStatus delayStatus; init_local_spi

Re: New process of getting changes into the commitfest app

2025-01-26 Thread Yura Sokolov
23.01.2025 15:57, Jelte Fennema-Nio пишет: (Resent because sending to both -hackers and -www gets emails put in the moderation queue, and I don't want to introduce that delay to all replies. If you received the previous version because you're in the CC please only reply to this one) # Background

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-26 Thread Michael Paquier
On Sun, Jan 26, 2025 at 09:12:49AM -0500, Andrew Dunstan wrote: > On 2025-01-26 Su 9:02 AM, Andrew Dunstan wrote: >> This seems to me like the wrong fix. We don't want to create >> "no_such_user" I think, we just want to catch the Windows error message, >> as in this patch. Back into business now,

Re: MAX_BACKENDS size (comment accuracy)

2025-01-26 Thread Jacob Brazeal
I find I didn't send the previous reply to the mailing list, so I'll copy it here. --- The patch series looks good. It looks like this currently leaves 10 bits of unused space (bits 20 - 29) in the state. > StaticAssertDecl((MAX_BACKENDS & LW_FLAG_MASK) == 0, > "MAX_BACKENDS and LW_FLAG_MASK o

Re: MAX_BACKENDS size (comment accuracy)

2025-01-26 Thread Jacob Brazeal
I had a typo earlier: I should have said: > StaticAssertDecl((MAX_BACKENDS & LW_FLAG_MASK) == 0, > "MAX_BACKENDS and LW_FLAG_MASK overlap"); Should this check that LW_LOCK_MASK & LW_FLAG_MASK == 0? To also ensure the LW_VAL_EXCLUSIVE bit does not overlap.

Re: Set AUTOCOMMIT to on in script output by pg_dump

2025-01-26 Thread Shinya Kato
On 2025-01-26 02:45, Tom Lane wrote: Robert Treat writes: On Wed, Jan 22, 2025 at 8:02 AM Shinya Kato wrote: I agree to it and fixed the patch. LGTM LGTM too. Pushed with a couple of very minor tweaks. regards, tom lane Thank you for pushing! -- Regards, Shin

Re: POC: track vacuum/analyze cumulative time per relation

2025-01-26 Thread Michael Paquier
On Fri, Jan 24, 2025 at 02:19:59PM -0600, Sami Imseih wrote: > So currently, the report of the last_(autoanalyze|analyze)_time > is set before the index_vacuum_cleanup, but for logging purposes > the elapsed time is calculated afterwards. Most users will not notice > this, but I think that is wrong

Re: Show WAL write and fsync stats in pg_stat_io

2025-01-26 Thread Michael Paquier
On Fri, Jan 24, 2025 at 06:29:46PM +0300, Nazir Bilal Yavuz wrote: > By saying that, this does not solve the problem; there is still a > difference although you omit WAL initialization stats from the > pg_stat_io. Reattaching the remaining patches to make the cfbot happy, as 0001 has been applied

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2025-01-26 Thread Srinath Reddy
On Sun, Jan 26, 2025 at 9:49 PM Tom Lane wrote: > Srinath Reddy writes: > > as suggested did the changes and attached the patch for the same. > > Uh ... what in the world is the point of changing > BufferIsExclusiveLocked's signature? > > regards, tom lane > as there was

Re: Using Expanded Objects other than Arrays from plpgsql

2025-01-26 Thread Andrey Borodin
> On 26 Jan 2025, at 20:37, Tom Lane wrote: > >> And the coverage of newly invented mark_stmt() 42.37%. Some of branches are >> easy noops, but some are not. > > Yeah. I'm not too concerned about that because it's pretty much a > copy-and-paste of the adjacent code. Maybe we should think a

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

2025-01-26 Thread Michael Paquier
On Fri, Jan 24, 2025 at 01:59:00AM -0800, Lukas Fittl wrote: > Overall, I also do wonder if it wouldn't be better to have a callback > mechanism in the shared memory stats, so stats plugins can do extra work > when an entry gets dropped (like freeing the DSA memory for the plan text), > vs having t

Re: Pass ParseState as down to utility functions.

2025-01-26 Thread Michael Paquier
On Fri, Dec 27, 2024 at 03:01:58PM +0800, jian he wrote: > please check attached for changes within ATPrepAlterColumnType Sorry for the late reply. This is more complete. Two strings are more complex after doing the coerce_to_target_type(), but honestly I am not these are worth having a parser_e

Re: PGSERVICEFILE as part of a normal connection string

2025-01-26 Thread Michael Paquier
On Wed, Nov 20, 2024 at 02:58:43AM -0500, Corey Huinker wrote: > Currently, a lot of our utility scripts (anything that uses > connectDatabase) don't support service=name params or PGSERVICE=name env > vars, which is really too bad. I previously thought that this was because > of a lack of interest

Re: Allowing pg_recvlogical to create temporary replication slots

2025-01-26 Thread Michael Paquier
On Tue, Nov 19, 2024 at 09:53:42AM +0900, Michael Paquier wrote: > And concurrency issues like this one are very unlikely going to happen > once you do that. The patch has been waiting for input for 8~9 weeks, so I am marking it as returned with feedback in the CF app. Feel free to resubmit if yo

Re: Pgoutput not capturing the generated columns

2025-01-26 Thread Amit Kapila
On Fri, Jan 24, 2025 at 1:08 PM vignesh C wrote: > > The attached patch has the changes for the same. > LGTM. Unless there are more comments, I'll push this in a day or so. -- With Regards, Amit Kapila.

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

2025-01-26 Thread Nisha Moond
On Wed, Jan 22, 2025 at 10:49 AM Nisha Moond wrote: > > On Tue, Jan 21, 2025 at 8:22 AM Peter Smith wrote: > > > > Some review comments for patch v61-0001. > > > > == > > src/backend/replication/slot.c > > > > 2. > > + /* > > + * The logical replication slots shouldn't be invalidated as GUC >

Re: meson and check-tests

2025-01-26 Thread Ashutosh Bapat
On Mon, Nov 25, 2024 at 7:06 PM Nazir Bilal Yavuz wrote: > > Hi, > > On Mon, 25 Nov 2024 at 16:19, Ashutosh Bapat > wrote: > > > > On Mon, Nov 25, 2024 at 6:47 PM Ashutosh Bapat > > wrote: > > > > > > > > For patch 2, it will be good to introduce expanded functionality to > > > make as well. But

Re: An improvement of ProcessTwoPhaseBuffer logic

2025-01-26 Thread Michael Paquier
On Thu, Jan 16, 2025 at 06:44:16PM -0800, Noah Misch wrote: > I got here on a yak shave for postgr.es/m/20250111214454.9a.nmi...@google.com. > I expect that project will still want FullTransactionIdFromAllowableAt(). If > so, I'll include it in that thread's patch series. Note that this one has b

Re: BF member drongo doesn't like 035_standby_logical_decoding.pl

2025-01-26 Thread Bertrand Drouvot
Hi, On Fri, Jan 24, 2025 at 11:42:15AM -0500, Tom Lane wrote: > I realized just now that drongo has been intermittently failing like this: Thanks for the report! > PS: FTR, the hits I got on this in the past 90 days were > > sysname |branch | snapshot | stage |

Re: BF member drongo doesn't like 035_standby_logical_decoding.pl

2025-01-26 Thread Bertrand Drouvot
Hi, On Fri, Jan 24, 2025 at 02:44:21PM -0500, Andres Freund wrote: > Hm, maybe I'm missing something, but isn't it possible for the active slot to > actually progress decoding past the conflict point? It's an active slot, with > the consumer running in the background, so all that needs to happen f

Re: Reorder shutdown sequence, to flush pgstats later

2025-01-26 Thread Bertrand Drouvot
Hi, On Sat, Jan 25, 2025 at 11:44:54AM -0500, Andres Freund wrote: > Hi, > > On 2025-01-24 15:06:17 -0500, Andres Freund wrote: > > Unless somebody argues against, I'm planning to push all but the last later > > today, wait for the buildfarm to settle, and then push the last. This is a > > depen

Re: Modern SHA2- based password hashes for pgcrypto

2025-01-26 Thread Japin Li
On Fri, 24 Jan 2025 at 19:06, Alvaro Herrera wrote: > On 2025-Jan-24, Bernd Helmle wrote: > >> So we behave exactly the same way as px_crypt_md5(): It stops after the >> first '$' after the magic byte preamble. For shacrypt, this could be >> the next '$' after the closing one of the non-mandatory

Re: New process of getting changes into the commitfest app

2025-01-26 Thread Umar Hayat
On Mon, 27 Jan 2025 at 03:09, Yura Sokolov wrote: > > 23.01.2025 15:57, Jelte Fennema-Nio пишет: > > (Resent because sending to both -hackers and -www gets emails put in > > the moderation queue, and I don't want to introduce that delay to all > > replies. If you received the previous version beca

Re: Skip collecting decoded changes of already-aborted transactions

2025-01-26 Thread Amit Kapila
On Fri, Jan 24, 2025 at 12:38 AM Masahiko Sawada wrote: > > On Wed, Jan 22, 2025 at 7:35 PM Peter Smith wrote: > > > > On Thu, Jan 23, 2025 at 2:17 PM Amit Kapila wrote: > > > > > > On Wed, Jan 22, 2025 at 9:21 AM Peter Smith wrote: > > > > > > > > > > > > == > > > > Commit message > > > >

Re: postgres_fdw could deparse ArrayCoerceExpr

2025-01-26 Thread Alexander Pyhalov
Maxim Orlov писал(а) 2025-01-24 18:09: Look like an overlook for me. Apparently no one has encountered this use case before. Patch seems good to me with no visible defects. Deparse support was also added. As well as a test case. But do we really need copy/paste code for a T_ArrayCoerceExpr case?

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-01-26 Thread Krasiyan Andreev
Hi, I was able to reproduce exactly the problem, with clean compile and --enable-cassert: test=# SELECT x,y,lead(y) IGNORE NULLS OVER (ORDER BY x) FROM (VALUES(1,NULL),(2,2),(3,NULL)) AS v(x,y); x | y | lead ---+---+-- 1 | |2 2 | 2 |2 3 | |2 (3 rows) test=# Also, make check

Re: Show WAL write and fsync stats in pg_stat_io

2025-01-26 Thread Bertrand Drouvot
Hi, On Fri, Jan 24, 2025 at 06:29:46PM +0300, Nazir Bilal Yavuz wrote: > Hi, > > Thanks for looking into this! > > On Fri, 24 Jan 2025 at 17:20, Bertrand Drouvot > wrote: > > > > I did not look at the code yet but did a few tests. > > I can see diff between pg_stat_wal and pg_stat_io, for examp

Re: New process of getting changes into the commitfest app

2025-01-26 Thread Jacob Brazeal
> > Magnus wants reviews before deployment to be required, in an effort to > get as close-to-perfect commits as possible. I, on the other hand, > think that the benefit of close-to-perfect commits is not worth the > delays in deploying that those reviews currently introduce. I'd rather > deploy cod

Re: Using Expanded Objects other than Arrays from plpgsql

2025-01-26 Thread Andrey Borodin
Hello everyone in this thread. > On 21 Jan 2025, at 23:12, Tom Lane wrote: > > somebody will review this I'm trying to dig into the patch set. My knowledge of the module is shallow and I hope to improve it by reading more patches in this area. This patch set provides a new test, which runs ju

Re: Convert sepgsql tests to TAP

2025-01-26 Thread Joe Conway
On 1/24/25 09:00, Andrew Dunstan wrote: On 2025-01-24 Fr 7:25 AM, Peter Eisentraut wrote: On 27.08.24 10:12, Peter Eisentraut wrote: Here is a new patch version. I simplified the uses of sed and awk inside the Perl script.  I also fixed "make installcheck".  I noticed that meson installs sep

Re: Using Expanded Objects other than Arrays from plpgsql

2025-01-26 Thread Tom Lane
Andrey Borodin writes: >> On 21 Jan 2025, at 23:12, Tom Lane wrote: >> somebody will review this > I'm trying to dig into the patch set. My knowledge of the module is shallow > and I hope to improve it by reading more patches in this area. Thanks for looking! > And the coverage of newly inven

Re: Non-text mode for pg_dumpall

2025-01-26 Thread Mahendra Singh Thalor
> hi. > After some tests and thinking about your reply, I admit that using > expand_dbname_patterns > in pg_restore will not work. > We need to do pattern matching against the map.dat file. > Please check the attached v12 series based on your > v11_pg_dumpall-with-directory-tar-custom-format-21-jan

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-26 Thread Andrew Dunstan
On 2025-01-26 Su 9:02 AM, Andrew Dunstan wrote: This seems to me like the wrong fix. We don't want to create "no_such_user" I think, we just want to catch the Windows error message, as in this patch. Ignore this ... I'm clearly insufficiently caffeinated this morning. Despite the n

Re: Using Expanded Objects other than Arrays from plpgsql

2025-01-26 Thread Tom Lane
Andrey Borodin writes: > On 26 Jan 2025, at 20:37, Tom Lane wrote: >> Maybe we should recast it as an action. What do you think of >> "mark_expr_as_assignment_source"? > Sounds better to me. I found no examples of similar functions nether in > pl_gram.y, nor in gram.y, so IMO mark_expr_as_assi

Re: MAX_BACKENDS size (comment accuracy)

2025-01-26 Thread Andres Freund
Hi, On 2025-01-26 13:10:35 -0500, Andres Freund wrote: > On 2025-01-25 16:06:29 -0800, Jacob Brazeal wrote: > > diff --git a/src/backend/storage/lmgr/lwlock.c > > b/src/backend/storage/lmgr/lwlock.c index 2f558ffea1..d3a2619072 100644 --- > > a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/s

Re: Convert sepgsql tests to TAP

2025-01-26 Thread Joe Conway
On 1/26/25 11:36, Andrew Dunstan wrote: On 2025-01-26 Su 10:29 AM, Joe Conway wrote: On 1/24/25 09:00, Andrew Dunstan wrote: On 2025-01-24 Fr 7:25 AM, Peter Eisentraut wrote: On 27.08.24 10:12, Peter Eisentraut wrote: Here is a new patch version. I simplified the uses of sed and awk inside

Re: Convert sepgsql tests to TAP

2025-01-26 Thread Andrew Dunstan
On 2025-01-26 Su 10:29 AM, Joe Conway wrote: On 1/24/25 09:00, Andrew Dunstan wrote: On 2025-01-24 Fr 7:25 AM, Peter Eisentraut wrote: On 27.08.24 10:12, Peter Eisentraut wrote: Here is a new patch version. I simplified the uses of sed and awk inside the Perl script.  I also fixed "make i

Re: Eagerly scan all-visible pages to amortize aggressive vacuum

2025-01-26 Thread Robert Treat
On Fri, Jan 24, 2025 at 3:43 PM Robert Haas wrote: > On Fri, Jan 24, 2025 at 3:02 PM Melanie Plageman > wrote: > > > > > + ereport(INFO, > > > + (errmsg("Vacuum successfully froze %u eager scanned blocks of > > > \"%s.%s.%s\". Now disabling eager scanning.", > > > > > > I predict that if Tom sees

Re: Allow NOT VALID foreign key constraints on partitioned tables.

2025-01-26 Thread Álvaro Herrera
On 2025-Jan-25, Álvaro Herrera wrote: > On Sat, Jan 25, 2025, at 6:00 AM, Alexander Lakhin wrote: > > Hello Álvaro, > > > > Please look at the script that produces an error starting from b663b9436: > > Ah yes, this is my bug: I moved a CCI where it became conditional. > Will fix, thanks for the

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2025-01-26 Thread Tom Lane
Srinath Reddy writes: > as suggested did the changes and attached the patch for the same. Uh ... what in the world is the point of changing BufferIsExclusiveLocked's signature? regards, tom lane

Re: Eagerly scan all-visible pages to amortize aggressive vacuum

2025-01-26 Thread Robert Treat
On Fri, Jan 24, 2025 at 3:43 PM Robert Haas wrote: > On Fri, Jan 24, 2025 at 3:02 PM Melanie Plageman > wrote: > > This thought exercise made me realize something is wrong with my > > current patch, though. If you set the failure tolerance > > (vacuum_eager_scan_max_fails) to 0 right now, it disa