Re: Typos in reorderbuffer.c.

2024-03-13 Thread Amit Kapila
On Thu, Mar 14, 2024 at 9:58 AM Kyotaro Horiguchi wrote: > > While examining reorderbuffer.c, I found several typos. I'm not sure > if fixing them is worthwhile, but I've attached a fix just in case. > LGTM. I'll push this in some time. -- With Regards, Amit Kapila.

Re: MERGE ... RETURNING

2024-03-13 Thread jian he
Hi mainly document issues. Other than that, it looks good! MERGE not supported in COPY MERGE not supported in WITH query These entries in src/backend/po.* need to be deleted if this patch is committed? -- RETURNING INSERT

Re: Have pg_basebackup write "dbname" in "primary_conninfo"?

2024-03-13 Thread Amit Kapila
On Thu, Mar 14, 2024 at 5:57 AM Masahiko Sawada wrote: > > This fact makes me think that the slotsync worker might be able to > accept the primary_conninfo value even if there is no dbname in the > value. That is, if there is no dbname in the primary_conninfo, it uses > the username in accordance

Re: pg16: XX000: could not find pathkey item to sort

2024-03-13 Thread Ashutosh Bapat
On Thu, Mar 14, 2024 at 4:30 AM David Rowley wrote: > On Thu, 14 Mar 2024 at 06:00, Alexander Lakhin > wrote: > > I've stumbled upon the same error, but this time it apparently has > another > > cause. It can be produced (on REL_16_STABLE and master) as follows: > > CREATE TABLE t (a int, b

Re: Remove a FIXME and unused variables in Meson

2024-03-13 Thread Tristan Partin
On Thu Mar 14, 2024 at 12:15 AM CDT, Michael Paquier wrote: On Thu, Mar 14, 2024 at 12:13:18AM -0500, Tristan Partin wrote: > One of them adds version gates to two LLVM flags (-frwapv, > -fno-strict-aliasing). I believe we moved the minimum LLVM version recently, > so these might not be

Re: Remove a FIXME and unused variables in Meson

2024-03-13 Thread Michael Paquier
On Thu, Mar 14, 2024 at 12:13:18AM -0500, Tristan Partin wrote: > One of them adds version gates to two LLVM flags (-frwapv, > -fno-strict-aliasing). I believe we moved the minimum LLVM version recently, > so these might not be necessary, but maybe it helps for historictal reasons. > If not, I'll

Remove a FIXME and unused variables in Meson

2024-03-13 Thread Tristan Partin
Two meson patches. One of them adds version gates to two LLVM flags (-frwapv, -fno-strict-aliasing). I believe we moved the minimum LLVM version recently, so these might not be necessary, but maybe it helps for historictal reasons. If not, I'll just remove the comment in a different patch.

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-03-13 Thread Masahiko Sawada
On Thu, Mar 14, 2024 at 1:29 PM John Naylor wrote: > > On Thu, Mar 14, 2024 at 8:53 AM Masahiko Sawada wrote: > > > > On Thu, Mar 14, 2024 at 9:59 AM John Naylor wrote: > > > > BTW do we still want to test the tidstore by using a combination of > > > > SQL functions? We might no longer need to

Can Execute commands for different portals interleave?

2024-03-13 Thread Evgeny Smirnov
Greetings! The question (a short version): is it possible for a client to send two selects in the same transaction using the extended query protocol (without declaring cursors) and pull rows simultaneously by means of interleaving portal names and restricting fetch size in Execute commands. The

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-13 Thread Dilip Kumar
On Wed, Mar 13, 2024 at 9:25 PM Robert Haas wrote: > > On Wed, Mar 13, 2024 at 11:39 AM Dilip Kumar wrote: > > > Andres already commented on the snapshot stuff on an earlier patch > > > version, and that's much nicer with this version. However, I don't > > > understand why a parallel bitmap heap

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-03-13 Thread John Naylor
On Thu, Mar 14, 2024 at 8:53 AM Masahiko Sawada wrote: > > On Thu, Mar 14, 2024 at 9:59 AM John Naylor wrote: > > > BTW do we still want to test the tidstore by using a combination of > > > SQL functions? We might no longer need to input TIDs via a SQL > > > function. > > > > I'm not sure. I

Typos in reorderbuffer.c.

2024-03-13 Thread Kyotaro Horiguchi
Hello. While examining reorderbuffer.c, I found several typos. I'm not sure if fixing them is worthwhile, but I've attached a fix just in case. regards. -- Kyotaro Horiguchi NTT Open Source Software Center diff --git a/src/backend/replication/logical/reorderbuffer.c

Inconsistent printf placeholders

2024-03-13 Thread Kyotaro Horiguchi
Hello. A recent commit 6612185883 introduced two error messages that are identical in text but differ in their placeholders. - pg_fatal("could not read file \"%s\": read only %d of %d bytes", -filename, (int) rb, (int) st.st_size); +

Re: Recent 027_streaming_regress.pl hangs

2024-03-13 Thread Thomas Munro
On Thu, Mar 14, 2024 at 3:27 PM Michael Paquier wrote: > Hmm. Perhaps 8af25652489? That looks like the closest thing in the > list that could have played with the way WAL is generated, hence > potentially impacting the records that are replayed. Yeah, I was wondering if its checkpoint delaying

Re: Improve eviction algorithm in ReorderBuffer

2024-03-13 Thread Masahiko Sawada
On Wed, Mar 13, 2024 at 11:23 AM Peter Smith wrote: > > On Wed, Mar 13, 2024 at 12:48 PM Masahiko Sawada > wrote: > > > > On Wed, Mar 13, 2024 at 10:15 AM Peter Smith wrote: > > > > > > On Tue, Mar 12, 2024 at 4:23 PM Masahiko Sawada > > > wrote: > > > > > > > > On Fri, Mar 8, 2024 at 12:58 

Re: Improve eviction algorithm in ReorderBuffer

2024-03-13 Thread Masahiko Sawada
On Mon, Mar 11, 2024 at 3:04 PM Peter Smith wrote: > > Here are some review comments for v8-0003 > > == > 0. GENERAL -- why the state enum? > > This patch introduced a new ReorderBufferMemTrackState with 2 states > (REORDER_BUFFER_MEM_TRACK_NO_MAXHEAP, >

Re: ERROR: error triggered for injection point gin-leave-leaf-split-incomplete

2024-03-13 Thread Tom Lane
Thomas Munro writes: > I noticed 3 regression test failures like $SUBJECT in cfbot runs for > unrelated patches that probably shouldn't affect GIN, so I guess this > is probably a problem in master. Hmm ... I have no insight on what's causing this, but "error triggered for" is about as

Re: Recent 027_streaming_regress.pl hangs

2024-03-13 Thread Michael Paquier
On Thu, Mar 14, 2024 at 03:00:28PM +1300, Thomas Munro wrote: > Assuming it is due to a commit in master, and given the failure > frequency, I think it is very likely to be a change from this 3 day > window of commits, and more likely in the top half dozen or so: > > d360e3cc60e Fix compiler

RE: Synchronizing slots from primary to standby

2024-03-13 Thread Zhijie Hou (Fujitsu)
Hi, Since the standby_slot_names patch has been committed, I am attaching the last doc patch for review. Best Regards, Hou zj v109-0001-Document-the-steps-to-check-if-the-standby-is-r.patch Description: v109-0001-Document-the-steps-to-check-if-the-standby-is-r.patch

Re: Recent 027_streaming_regress.pl hangs

2024-03-13 Thread Thomas Munro
On Wed, Mar 13, 2024 at 10:53 AM Thomas Munro wrote: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink=2024-02-23%2015%3A44%3A35 Assuming it is due to a commit in master, and given the failure frequency, I think it is very likely to be a change from this 3 day window of commits,

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-03-13 Thread Masahiko Sawada
On Thu, Mar 14, 2024 at 9:59 AM John Naylor wrote: > > On Wed, Mar 13, 2024 at 9:29 PM Masahiko Sawada wrote: > > > > On Wed, Mar 13, 2024 at 8:05 PM John Naylor wrote: > > > > > > On Wed, Mar 13, 2024 at 8:39 AM Masahiko Sawada > > > wrote: > > > > > > > As I mentioned above, if we implement

small_cleanups around login event triggers

2024-03-13 Thread Robert Treat
I was taking a look at the login event triggers work (nice work btw) and saw a couple of minor items that I thought would be worth cleaning up. This is mostly just clarifying the exiting docs and code comments. Robert Treat https://xzilla.net login_event_trigger_small_cleanups.patch

ERROR: error triggered for injection point gin-leave-leaf-split-incomplete

2024-03-13 Thread Thomas Munro
Hi, I noticed 3 regression test failures like $SUBJECT in cfbot runs for unrelated patches that probably shouldn't affect GIN, so I guess this is probably a problem in master. All three happened on FreeBSD, but I doubt that's relevant, it's just that the FreeBSD CI task was randomly selected to

Re: Put genbki.pl output into src/include/catalog/ directly

2024-03-13 Thread Andreas Karlsson
On 3/13/24 12:41 PM, Andreas Karlsson wrote: On 2/8/24 8:58 AM, Peter Eisentraut wrote: I think keeping the two build systems aligned this way will be useful for longer-term maintenance. Agreed, so started reviewing the patch. Attached is a rebased version of the patch to solve a conflict.

Re: RFC: Logging plan of the running query

2024-03-13 Thread jian he
On Wed, Mar 13, 2024 at 1:28 PM torikoshia wrote: > > On Fri, Feb 16, 2024 at 11:42 PM torikoshia > wrote: > > I'm not so sure about the implementation now, i.e. finding the next > > node > > to be executed from the planstate tree, but I'm going to try this > > approach. > > Attached a patch

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-03-13 Thread John Naylor
On Wed, Mar 13, 2024 at 9:29 PM Masahiko Sawada wrote: > > On Wed, Mar 13, 2024 at 8:05 PM John Naylor wrote: > > > > On Wed, Mar 13, 2024 at 8:39 AM Masahiko Sawada > > wrote: > > > > > As I mentioned above, if we implement the test cases in C, we can use > > > the debug-build array in the

Re: Sequence Access Methods, round two

2024-03-13 Thread Michael Paquier
On Wed, Mar 13, 2024 at 07:00:37AM +0100, Peter Eisentraut wrote: > I don't understand what the overall benefit of this change is supposed to > be. In the context of this thread, this removes the dependency of sequence value lookup to heap. > If this route were to be pursued, it should be a

Re: Have pg_basebackup write "dbname" in "primary_conninfo"?

2024-03-13 Thread Masahiko Sawada
On Fri, Feb 23, 2024 at 3:05 PM Amit Kapila wrote: > > On Wed, Feb 21, 2024 at 7:46 AM Hayato Kuroda (Fujitsu) > wrote: > > > > > > Just FYI - here is an extreme case. And note that I have applied > > > > proposed patch. > > > > > > > > When `pg_basebackup -D data_N2 -R` is used: > > > > ``` >

Re: Improve readability by using designated initializers when possible

2024-03-13 Thread Michael Paquier
On Wed, Mar 13, 2024 at 02:24:32PM +0100, Peter Eisentraut wrote: > On 08.03.24 06:50, Michael Paquier wrote: >> This is usually taken care of by committers or updated automatically. > > both fixed Looks mostly fine, thanks for the new version. -EventTriggerSupportsObjectClass(ObjectClass

Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.

2024-03-13 Thread Alexander Korotkov
On Mon, Mar 11, 2024 at 11:48 AM Alexander Korotkov wrote: > > On Mon, Mar 11, 2024 at 5:43 AM Anton A. Melnikov > wrote: > > On 11.03.2024 03:39, Alexander Korotkov wrote: > > > Now that we distinguish stats for checkpoints and > > > restartpoints, we need to update the docs. Please, check the

Re: Volatile write caches on macOS and Windows, redux

2024-03-13 Thread Thomas Munro
Short sales pitch for these patches: * the default settings eat data on Macs and Windows * nobody understands what wal_sync_method=fsync_writethrough means anyway * it's a weird kludge that it affects not only WAL, let's clean that up

Re: SQL:2011 application time

2024-03-13 Thread jian he
in GetOperatorFromWellKnownStrategy: *strat = GistTranslateStratnum(opclass, instrat); if (*strat == InvalidStrategy) { HeapTuple tuple; tuple = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclass)); if (!HeapTupleIsValid(tuple)) elog(ERROR, "cache lookup failed for operator class %u", opclass);

Re: Vectored I/O in bulk_write.c

2024-03-13 Thread Thomas Munro
On Thu, Mar 14, 2024 at 10:49 AM Heikki Linnakangas wrote: > I tried to say that smgr implementation might have better ways to assert > that than calling smgrnblocks(), so it would be better to leave it to > the implementation. But what bothered me most was that smgrwrite() had a > different

Re: pg16: XX000: could not find pathkey item to sort

2024-03-13 Thread David Rowley
On Thu, 14 Mar 2024 at 06:00, Alexander Lakhin wrote: > I've stumbled upon the same error, but this time it apparently has another > cause. It can be produced (on REL_16_STABLE and master) as follows: > CREATE TABLE t (a int, b int) PARTITION BY RANGE (a); > CREATE TABLE td PARTITION OF t

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-13 Thread Thomas Munro
On Sun, Mar 3, 2024 at 11:41 AM Tomas Vondra wrote: > On 3/2/24 23:28, Melanie Plageman wrote: > > On Sat, Mar 2, 2024 at 10:05 AM Tomas Vondra > > wrote: > >> With the current "master" code, eic=1 means we'll issue a prefetch for B > >> and then read+process A. And then issue prefetch for C and

Re: Statistics Import and Export

2024-03-13 Thread Corey Huinker
> > Note that there's two different things we're talking about here- the > lock on the relation that we're analyzing and then the lock on the > pg_statistic (or pg_class) catalog itself. Currently, at least, it > looks like in the three places in the backend that we open > StatisticRelationId, we

Re: Vectored I/O in bulk_write.c

2024-03-13 Thread Heikki Linnakangas
On 13/03/2024 23:12, Thomas Munro wrote: Alright, here is a first attempt at merging all three interfaces as you suggested. I like it! I especially like the way it removes lots of duplication. I don't understand your argument about the location of the write-vs-extent assertions. It seems to

Re: Vectored I/O in bulk_write.c

2024-03-13 Thread Thomas Munro
Alright, here is a first attempt at merging all three interfaces as you suggested. I like it! I especially like the way it removes lots of duplication. I don't understand your argument about the location of the write-vs-extent assertions. It seems to me that these are assertions about what the

Re: Add basic tests for the low-level backup method.

2024-03-13 Thread David Steele
On 3/13/24 19:15, Michael Paquier wrote: On Wed, Mar 13, 2024 at 01:12:28PM +1300, David Steele wrote: Not sure what to look for here. There are no distinct messages for crash recovery. Perhaps there should be? The closest thing I can think of here would be "database system was not properly

Re: un-revert the MAINTAIN privilege and the pg_maintain predefined role

2024-03-13 Thread Nathan Bossart
On Wed, Mar 13, 2024 at 09:49:26AM -0700, Jeff Davis wrote: > Looks good to me. Thank you for expanding on the comment, as well. Thanks for reviewing! Committed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: RFC: Logging plan of the running query

2024-03-13 Thread Robert Haas
On Wed, Mar 13, 2024 at 1:28 AM torikoshia wrote: > - I saw no way to find the next node to be executed from the planstate > tree, so the patch wraps all the ExecProcNode of the planstate tree at > CHECK_FOR_INTERRUPTS(). I don't think it does this correctly, because some node types have

Re: Add system identifier to backup manifest

2024-03-13 Thread Robert Haas
On Fri, Mar 8, 2024 at 12:14 AM Amul Sul wrote: > Thank you for the improvement. > > The caller of verify_control_file() has the full path of the control file that > can pass it and avoid recomputing. With this change, it doesn't really need > verifier_context argument -- only the manifest's

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-03-13 Thread Jacob Champion
On Wed, Mar 13, 2024 at 12:01 PM Alvaro Herrera wrote: > On 2024-Mar-13, Jelte Fennema-Nio wrote: > > Sadly I'm having a hard time reliably reproducing this race condition > > locally. So it's hard to be sure what is happening here. Attached is a > > patch with a wild guess as to what the issue

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Laurenz Albe
On Tue, 2024-03-12 at 11:56 +0100, Daniel Gustafsson wrote: > > I liked the statement from Laurenz a while ago on his blog > > (paraphrased): "Upgrading to the latest patch release does not require > > application testing or recertification". I am not sure we want to put > > that into the official

Re: clarify equalTupleDescs()

2024-03-13 Thread Tomas Vondra
On 2/27/24 12:13, jian he wrote: > On Mon, Feb 12, 2024 at 7:47 PM Peter Eisentraut wrote: >> >> >> In principle, hashRowType() could process all the fields that >> equalRowTypes() does. But since it's only a hash function, it doesn't >> have to be perfect. (This is also the case for the

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-03-13 Thread Alvaro Herrera
On 2024-Mar-13, Jelte Fennema-Nio wrote: > I agree it's probably a timing issue. The cancel being received after > the query is done seems very unlikely, since the query takes 180 > seconds (assuming PG_TEST_TIMEOUT_DEFAULT is not lowered for these > animals). I think it's more likely that the

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Nathan Bossart
On Wed, Mar 13, 2024 at 02:21:20PM -0400, Tom Lane wrote: > I'm +1 on rewriting these documentation pages though. Seems like > they could do with a whole fresh start rather than just tweaks > around the edges --- what we've got now is an accumulation of such > tweaks. If no one else volunteers,

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Jeremy Schneider
> On Mar 13, 2024, at 11:39 AM, Tom Lane wrote: > > Jeremy Schneider writes: >>> On 3/13/24 11:21 AM, Tom Lane wrote: >>> Agreed, we would probably add confusion not reduce it if we were to >>> change our longstanding nomenclature for this. > >> Before v10, the quarterly maintenance updates

Re: clarify equalTupleDescs()

2024-03-13 Thread Tomas Vondra
Hi, I looked at this patch today. I went through all the calls switched to equalRowTypes, and AFAIK all of them are correct - all the places switched to equalRowTypes() only need the weaker checks. There's only two places still calling equalTupleDescs() - relcache certainly needs that, and so

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Tom Lane
Jeremy Schneider writes: > On 3/13/24 11:21 AM, Tom Lane wrote: >> Agreed, we would probably add confusion not reduce it if we were to >> change our longstanding nomenclature for this. > Before v10, the quarterly maintenance updates were unambiguously and > always called patch releases I think

Re: Popcount optimization using AVX512

2024-03-13 Thread Nathan Bossart
On Wed, Mar 13, 2024 at 05:52:14PM +, Amonson, Paul D wrote: >> I think we want these to be architecture-specific, i.e., only built for >> x86_64 if the compiler knows how to use the relevant instructions. There is >> a >> good chance that we'll want to add similar support for other systems.

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Jeremy Schneider
On 3/13/24 11:21 AM, Tom Lane wrote: > Robert Treat writes: >> On Wed, Mar 13, 2024 at 1:12 PM Bruce Momjian wrote: >>> On Wed, Mar 13, 2024 at 09:21:27AM -0700, Jeremy Schneider wrote: In my view, the best thing would be to move toward consistently using the word "patch" and moving

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Tom Lane
Robert Treat writes: > On Wed, Mar 13, 2024 at 1:12 PM Bruce Momjian wrote: >> On Wed, Mar 13, 2024 at 09:21:27AM -0700, Jeremy Schneider wrote: >>> In my view, the best thing would be to move toward consistently using >>> the word "patch" and moving away from the word "minor" for the >>>

Re: Support json_errdetail in FRONTEND builds

2024-03-13 Thread Jacob Champion
On Tue, Mar 12, 2024 at 11:38 PM Michael Paquier wrote: > On Tue, Mar 12, 2024 at 08:38:43PM -0400, Andrew Dunstan wrote: > > yeah, although maybe worth a different patch. > > I've wanted that a few times, FWIW. I would do a split, mainly for > clarity. Sounds good, split into v2-0002. (That

Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs

2024-03-13 Thread Jelte Fennema-Nio
Fixed some conflicts again, as well as adding a connection option to choose the requested protocol version (as discussed in[1]). This new connection option is not useful when connecting to any of the supported postgres versions. But it can be useful when connecting to PG versions before 9.3. Or

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-13 Thread Tomas Vondra
On 3/13/24 14:34, Heikki Linnakangas wrote: > ... > > Lots of discussion happening on the performance results but it seems > that there is no performance impact with the preliminary patches up to > v5-0013-Streaming-Read-API.patch. I'm focusing purely on those > preliminary patches now, because I

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Robert Treat
On Wed, Mar 13, 2024 at 1:12 PM Bruce Momjian wrote: > > On Wed, Mar 13, 2024 at 09:21:27AM -0700, Jeremy Schneider wrote: > > It's not just roadmaps and release pages where we mix up these terms > > either, it's even in user-facing SQL and libpq routines: both > > PQserverVersion and

RE: Popcount optimization using AVX512

2024-03-13 Thread Amonson, Paul D
> -Original Message- > From: Nathan Bossart > Sent: Wednesday, March 13, 2024 9:39 AM > To: Amonson, Paul D > +extern int pg_popcount32_slow(uint32 word); extern int > +pg_popcount64_slow(uint64 word); > > +/* In pg_popcnt_*_accel source file. */ extern int >

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Bruce Momjian
On Wed, Mar 13, 2024 at 09:21:27AM -0700, Jeremy Schneider wrote: > It's not just roadmaps and release pages where we mix up these terms > either, it's even in user-facing SQL and libpq routines: both > PQserverVersion and current_setting('server_version_num') return the > patch release version in

Re: pg16: XX000: could not find pathkey item to sort

2024-03-13 Thread Alexander Lakhin
Hello David, 09.10.2023 07:13, David Rowley wrote: On Mon, 9 Oct 2023 at 12:42, David Rowley wrote: Maybe it's worth checking the total planning time spent in a run of the regression tests with and without the patch to see how much overhead it adds to the "average case". I've now pushed the

Re: un-revert the MAINTAIN privilege and the pg_maintain predefined role

2024-03-13 Thread Jeff Davis
On Tue, 2024-03-12 at 16:05 -0500, Nathan Bossart wrote: > It's easy enough to resolve this inconsistency by sending > down the parent OID when recursing to a TOAST table and using that > for the > privilege checks.  AFAICT this avoids any kind of cache lookup > hazards > because we hold a session

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

2024-03-13 Thread Bharath Rupireddy
On Wed, Mar 13, 2024 at 11:13 AM shveta malik wrote: > > > Thanks. v8-0001 is how it looks. Please see the v8 patch set with this > > change. > > JFYI, the patch does not apply to the head. There is a conflict in > multiple files. Thanks for looking into this. I noticed that the v8 patches

Re: Popcount optimization using AVX512

2024-03-13 Thread Nathan Bossart
A couple of thoughts on v7-0001: +extern int pg_popcount32_slow(uint32 word); +extern int pg_popcount64_slow(uint64 word); +/* In pg_popcnt_*_accel source file. */ +extern int pg_popcount32_fast(uint32 word); +extern int pg_popcount64_fast(uint64 word); Can these prototypes be moved to a

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

2024-03-13 Thread Bharath Rupireddy
On Wed, Mar 13, 2024 at 12:51 PM Bertrand Drouvot wrote: > > See the error messages on a standby: > > == wal removal > > postgres=# SELECT * FROM pg_logical_slot_get_changes('lsub4_slot', NULL, > NULL, 'include-xids', '0'); > ERROR: can no longer get changes from replication slot "lsub4_slot"

Re: Reports on obsolete Postgres versions

2024-03-13 Thread Jeremy Schneider
On 3/12/24 3:56 AM, Daniel Gustafsson wrote: >>> but that is far down the page. Do we need to improve this? > >> I liked the statement from Laurenz a while ago on his blog >> (paraphrased): "Upgrading to the latest patch release does not require >> application testing or recertification". I am

Re: Have pg_basebackup write "dbname" in "primary_conninfo"?

2024-03-13 Thread vignesh C
On Wed, 13 Mar 2024 at 16:58, Amit Kapila wrote: > > On Tue, Mar 12, 2024 at 5:13 PM vignesh C wrote: > > > > On Mon, 11 Mar 2024 at 17:16, Amit Kapila wrote: > > > > > > On Tue, Feb 27, 2024 at 2:07 PM Hayato Kuroda (Fujitsu) > > > wrote: > > > > > > > > > PSA the patch for implementing it.

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-13 Thread Robert Haas
On Wed, Mar 13, 2024 at 11:39 AM Dilip Kumar wrote: > > Andres already commented on the snapshot stuff on an earlier patch > > version, and that's much nicer with this version. However, I don't > > understand why a parallel bitmap heap scan needs to do anything at all > > with the snapshot, even

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

2024-03-13 Thread Bharath Rupireddy
On Wed, Mar 13, 2024 at 9:21 AM Amit Kapila wrote: > > > So, how about we turn conflict_reason to only report the reasons that > > actually cause conflict with recovery for logical slots, something > > like below, and then have invalidation_cause as a generic column for > > all sorts of

Re: Constant Splitting/Refactoring

2024-03-13 Thread David Christensen
Here is a version 2 of this patch, rebased atop 97d85be365. As before, this is a cleanup/prerequisite patch series for the page features/reserved page size patches[1]. (Said patch series is going to be updated shortly.) This splits each of the 4 constants that care about page size into

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-13 Thread Dilip Kumar
On Wed, Mar 13, 2024 at 7:04 PM Heikki Linnakangas wrote: > > (Adding Dilip, the original author of the parallel bitmap heap scan > patch all those years ago, in case you remember anything about the > snapshot stuff below.) > > On 27/02/2024 16:22, Melanie Plageman wrote: > Andres already

Re: Support a wildcard in backtrace_functions

2024-03-13 Thread Jelte Fennema-Nio
On Wed, 13 Mar 2024 at 15:20, Peter Eisentraut wrote: > Hence the idea > > backtrace_on_error = {all|internal|none} > > which could default to 'internal'. I think one use-case that I'd personally at least would like to see covered is being able to get backtraces on all warnings. How would

Re: Support a wildcard in backtrace_functions

2024-03-13 Thread Bharath Rupireddy
On Wed, Mar 13, 2024 at 7:50 PM Peter Eisentraut wrote: > > > I think it all depends on how close we consider > > backtrace_on_internal_error and backtrace_functions. While they > > obviously have similar functionality, I feel like > > backtrace_on_internal_error is probably a function that we'd

Re: meson vs tarballs

2024-03-13 Thread Tom Lane
Peter Eisentraut writes: > On 13.03.24 07:42, Andrew Dunstan wrote: >> On 2024-03-13 We 02:31, Andrew Dunstan wrote: Alternatively, PostgreSQL can be built using Meson. This is currently experimental and only works when building from a Git checkout (not from a distribution

Re: MERGE ... WHEN NOT MATCHED BY SOURCE

2024-03-13 Thread Dean Rasheed
Rebased version attached. Regards, Dean diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml new file mode 100644 index f8f83d4..380d0c9 --- a/doc/src/sgml/mvcc.sgml +++ b/doc/src/sgml/mvcc.sgml @@ -394,10 +394,14 @@ conditions for each action are re-evaluated on the updated version

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-03-13 Thread Masahiko Sawada
On Wed, Mar 13, 2024 at 8:05 PM John Naylor wrote: > > On Wed, Mar 13, 2024 at 8:39 AM Masahiko Sawada wrote: > > > As I mentioned above, if we implement the test cases in C, we can use > > the debug-build array in the test code. And we won't use it in AND/OR > > operations tests in the future.

Re: Support a wildcard in backtrace_functions

2024-03-13 Thread Peter Eisentraut
On 08.03.24 16:55, Jelte Fennema-Nio wrote: On Fri, 8 Mar 2024 at 15:51, Peter Eisentraut wrote: What is the relationship of these changes with the recently added backtrace_on_internal_error? I think that's a reasonable question. And the follow up ones too. I think it all depends on how

Re: MERGE ... RETURNING

2024-03-13 Thread Dean Rasheed
On Wed, 13 Mar 2024 at 08:58, Dean Rasheed wrote: > > I think I'll go make those doc changes, and back-patch them > separately, since they're not related to this patch. > OK, I've done that. Here is a rebased patch on top of that, with the other changes you suggested. Regards, Dean diff --git

Re: Regarding the order of the header file includes

2024-03-13 Thread Peter Eisentraut
On 12.03.24 12:47, Richard Guo wrote: On Wed, Mar 6, 2024 at 5:32 PM Richard Guo > wrote: Please note that this patch only addresses the order of header file includes in backend modules (and might not be thorough).  It is possible that other modules

Re: Add new error_action COPY ON_ERROR "log"

2024-03-13 Thread Bharath Rupireddy
On Wed, Mar 13, 2024 at 11:09 AM Michael Paquier wrote: > > Hmm. This NOTICE is really bugging me. It is true that the clients > would get more information, but the information is duplicated on the > server side because the error context provides the same information as > the NOTICE itself: >

Re: type cache cleanup improvements

2024-03-13 Thread Teodor Sigaev
I think that this patch should be split for clarity, as there are a few things that are independently useful. I guess something like that: Done, all patches should be applied consequentially. > - The typcache changes. 01-map_rel_to_type.v5.patch adds map relation to its type - Introduction

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-13 Thread Heikki Linnakangas
(Adding Dilip, the original author of the parallel bitmap heap scan patch all those years ago, in case you remember anything about the snapshot stuff below.) On 27/02/2024 16:22, Melanie Plageman wrote: On Mon, Feb 26, 2024 at 08:50:28PM -0500, Melanie Plageman wrote: On Fri, Feb 16, 2024 at

Re: Using the %m printf format more

2024-03-13 Thread Peter Eisentraut
On 12.03.24 02:22, Michael Paquier wrote: On Mon, Mar 11, 2024 at 11:19:16AM +, Dagfinn Ilmari Mannsåker wrote: On closer look, fprintf() is actually the only errno-clobbering function it calls, I was just hedging my bets in that statement. This makes the whole simpler, so I'd be OK with

Re: Disabling Heap-Only Tuples

2024-03-13 Thread Laurenz Albe
On Thu, 2023-09-21 at 16:18 -0700, Andres Freund wrote: > I think a minimal working approach could be to have the configuration be based > on the relation size vs space known to the FSM. If the target block of an > update is higher than ((relation_size - fsm_free_space) * > new_reloption_or_guc),

Re: Improve readability by using designated initializers when possible

2024-03-13 Thread Peter Eisentraut
On 08.03.24 06:50, Michael Paquier wrote: On Mon, Mar 04, 2024 at 09:29:03AM +0800, jian he wrote: On Fri, Mar 1, 2024 at 5:26 PM Peter Eisentraut wrote: Oops, there was a second commit in my branch that I neglected to send in. Here is my complete patch set. Thanks for the new patch set.

Re: On disable_cost

2024-03-13 Thread Robert Haas
On Tue, Mar 12, 2024 at 4:55 PM David Rowley wrote: > The primary place I see issues with disabled_cost is caused by > STD_FUZZ_FACTOR. When you add 1.0e10 to a couple of modestly costly > paths, it makes them appear fuzzily the same in cases where one could > be significantly cheaper than the

Re: Using the %m printf format more

2024-03-13 Thread Dagfinn Ilmari Mannsåker
Michael Paquier writes: > On Mon, Mar 11, 2024 at 11:19:16AM +, Dagfinn Ilmari Mannsåker wrote: >> On closer look, fprintf() is actually the only errno-clobbering function >> it calls, I was just hedging my bets in that statement. > > This makes the whole simpler, so I'd be OK with that. I

Re: POC, WIP: OR-clause support for indexes

2024-03-13 Thread Andrei Lepikhov
On 13/3/2024 18:05, Alexander Korotkov wrote: On Wed, Mar 13, 2024 at 7:52 AM Andrei Lepikhov Given all of the above, I think moving transformation to the canonicalize_qual() would be the right way to go. Ok, I will try to move the code. I have no idea about the timings so far. I recall the

Re: Statistics Import and Export

2024-03-13 Thread Stephen Frost
Greetings, * Corey Huinker (corey.huin...@gmail.com) wrote: > > No, we should be keeping the lock until the end of the transaction > > (which in this case would be just the one statement, but it would be the > > whole statement and all of the calls in it). See analyze.c:268 or > > so, where we

Re: Put genbki.pl output into src/include/catalog/ directly

2024-03-13 Thread Andreas Karlsson
On 2/8/24 8:58 AM, Peter Eisentraut wrote: I think keeping the two build systems aligned this way will be useful for longer-term maintenance. Agreed, so started reviewing the patch. Attached is a rebased version of the patch to solve a conflict. AndreasFrom

Re: Have pg_basebackup write "dbname" in "primary_conninfo"?

2024-03-13 Thread Amit Kapila
On Tue, Mar 12, 2024 at 5:13 PM vignesh C wrote: > > On Mon, 11 Mar 2024 at 17:16, Amit Kapila wrote: > > > > On Tue, Feb 27, 2024 at 2:07 PM Hayato Kuroda (Fujitsu) > > wrote: > > > > > > > PSA the patch for implementing it. It is basically same as Ian's one. > > > > However, this patch still

Re: POC, WIP: OR-clause support for indexes

2024-03-13 Thread Alexander Korotkov
On Wed, Mar 13, 2024 at 7:52 AM Andrei Lepikhov wrote: > On 12/3/2024 22:20, Alexander Korotkov wrote: > > On Mon, Mar 11, 2024 at 2:43 PM Andrei Lepikhov > >> I think you are right. It is probably a better place than any other to > >> remove duplicates in an array. I just think we should sort

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-03-13 Thread John Naylor
On Wed, Mar 13, 2024 at 8:39 AM Masahiko Sawada wrote: > As I mentioned above, if we implement the test cases in C, we can use > the debug-build array in the test code. And we won't use it in AND/OR > operations tests in the future. That's a really interesting idea, so I went ahead and tried

Re: Vectored I/O in bulk_write.c

2024-03-13 Thread Heikki Linnakangas
On 13/03/2024 12:18, Thomas Munro wrote: On Wed, Mar 13, 2024 at 9:57 PM Heikki Linnakangas wrote: Here also is a first attempt at improving the memory allocation and memory layout. ... +typedef union BufferSlot +{ + PGIOAlignedBlock buffer; + dlist_node freelist_node; +}

Re: Vectored I/O in bulk_write.c

2024-03-13 Thread Thomas Munro
On Wed, Mar 13, 2024 at 9:57 PM Heikki Linnakangas wrote: > Let's bite the bullet and merge the smgrwrite and smgrextend functions > at the smgr level too. I propose the following signature: > > #define SWF_SKIP_FSYNC 0x01 > #define SWF_EXTEND 0x02 > #define SWF_ZERO

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-03-13 Thread Jelte Fennema-Nio
On Wed, 13 Mar 2024 at 04:53, Tom Lane wrote: > I suspect it's basically just a > timing dependency. Have you thought about the fact that a cancel > request is a no-op if it arrives after the query's done? I agree it's probably a timing issue. The cancel being received after the query is done

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

2024-03-13 Thread shveta malik
On Fri, Mar 8, 2024 at 10:42 PM Bharath Rupireddy wrote: > > On Wed, Mar 6, 2024 at 4:49 PM Amit Kapila wrote: > > > > You might want to consider its interaction with sync slots on standby. > > Say, there is no activity on slots in terms of processing the changes > > for slots. Now, we won't

Re: MERGE ... RETURNING

2024-03-13 Thread Dean Rasheed
On Wed, 13 Mar 2024 at 06:44, jian he wrote: > > > [ WITH with_query [, ...] ] > MERGE INTO [ ONLY ] > here the "WITH" part should have "[ RECURSIVE ]" Actually, no. MERGE doesn't support WITH RECURSIVE. It's not entirely clear to me why though. I did a quick test, removing that restriction

Re: Vectored I/O in bulk_write.c

2024-03-13 Thread Heikki Linnakangas
(Replying to all your messages in this thread together) This made me wonder why smgrwritev() and smgrextendv() shouldn't be backed by the same implementation, since they are essentially the same operation. +1 to the general idea of merging the write and extend functions. The differences are

Re: session username in default psql prompt?

2024-03-13 Thread Andrew Dunstan
On 2024-02-27 Tu 19:19, Kori Lane wrote: Here’s a patch for this. Reposting as the archive mail processor doesn't seem to like the Apple mail attachment. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com diff --git a/doc/src/sgml/ref/psql-ref.sgml

Re: Transaction timeout

2024-03-13 Thread Alexander Korotkov
On Wed, Mar 13, 2024 at 7:56 AM Andrey M. Borodin wrote: > > On 13 Mar 2024, at 05:23, Alexander Korotkov wrote: > > > > On Tue, Mar 12, 2024 at 10:28 AM Andrey M. Borodin > > wrote: > >>> On 11 Mar 2024, at 16:18, Alexander Korotkov wrote: > >>> > >>> I think if checking psql stderr is

  1   2   >