Re: meson: Specify -Wformat as a common warning flag for extensions

2024-03-13 Thread Sutou Kouhei
Hi, In "Re: meson: Specify -Wformat as a common warning flag for extensions" on Wed, 13 Mar 2024 00:43:11 -0500, "Tristan Partin" wrote: > Perhaps adding some more clarification in the comments that I wrote. > > - # -Wformat-security requires -Wformat, so check for it > + # -Wformat-secu

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

2024-03-13 Thread shveta malik
> JFYI, the patch does not apply to the head. There is a conflict in > multiple files. For review purposes, I applied v8 to the March 6 code-base. I have yet to review in detail, please find my initial thoughts: 1) I found that 'inactive_replication_slot_timeout' works only if there was any walse

Re: Disable LLVM bitcode generation with pgxs.mk framework.

2024-03-13 Thread Xing Guo
> On Wed, Mar 13, 2024 at 2:45 PM Peter Eisentraut wrote: > > On 12.03.24 14:38, Xing Guo wrote: > > When the PostgreSQL server is configured with --with-llvm, the pgxs.mk > > framework will generate LLVM bitcode for extensions automatically. > > Sometimes, I don't want to generate bitcode for som

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

2024-03-13 Thread Bertrand Drouvot
Hi, On Tue, Mar 12, 2024 at 09:19:35PM +0530, Bharath Rupireddy wrote: > On Tue, Mar 12, 2024 at 9:11 PM Bertrand Drouvot > wrote: > > > > > AFAIR, we don't prevent similar invalidations due to > > > 'max_slot_wal_keep_size' for sync slots, > > > > Right, we'd invalidate them on the standby shoul

Re: meson: Specify -Wformat as a common warning flag for extensions

2024-03-13 Thread Peter Eisentraut
On 08.03.24 17:05, Tristan Partin wrote: Ok, I figured this out. -Wall implies -Wformat=1. We set warning_level to 1 in the Meson project() call, which implies -Wall, and set -Wall in CFLAGS for autoconf. That's the reason we don't get issues building Postgres. A user making use of the pg_confi

Re: meson vs tarballs

2024-03-13 Thread Peter Eisentraut
On 13.03.24 07:42, Andrew Dunstan wrote: On 2024-03-13 We 02:31, Andrew Dunstan wrote: On 2024-03-13 We 02:22, Peter Eisentraut wrote: On 13.03.24 07:11, Andrew Dunstan wrote: I and several colleagues have just been trying to build from a tarball with meson. That seems pretty awful and unfri

Re: Add the ability to limit the amount of memory that can be allocated to backends.

2024-03-13 Thread Anton A. Melnikov
On 12.03.2024 16:30, Aleksander Alekseev wrote: Just wanted to let you know that v20231226 doesn't apply. The patch needs love from somebody interested in it. Thanks for pointing to this! Here is a version updated for the current master. With the best regards, -- Anton A. Melnikov Postgres P

Re: a wrong index choose when statistics is out of date

2024-03-13 Thread Andy Fan
> > Having had the same problem for a long time, I've made an attempt and > invented a patch that probes an index to determine whether the estimated > constant is within statistics' scope. > I remember David's remark on the overhead problem, but I don't argue it > here. This patch is on the table

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-03-13 Thread jian he
On Mon, Mar 11, 2024 at 8:56 AM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Mon, 11 Mar 2024 08:00:00 +0800, > jian he wrote: > > > Hi, here are my cents: > > Currently in v17, we have 3 extra functions within DoCopyTo

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 proble

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 b/doc/src/sgml/ref/ps

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: 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 in

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 perf

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 se

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: 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: [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 tha

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 and

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 c

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 2069c6d6e2ef2bc37c5af0df12c558ead8

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 ca

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 last

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 a

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 ot

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. T

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), t

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 t

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: 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: 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: > NO

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 m

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 a/

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 clos

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: 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 o

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 tarball

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 w

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 th

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 comment

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 Cluster-s

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 invalidati

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 b

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. It

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 no

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: 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 hea

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 neede

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: 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 p

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: 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 > +pg_popcount32_fast(uint32

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 current_sett

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: 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 whe

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 giv

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 >>> Postgre

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 awa

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 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 t

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 doe

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: 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, I

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 can

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 curr

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: [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 mi

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 syste

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 children

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: 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 s

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: 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 m

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: 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: 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 DEFAULT;

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 signa

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); erepo

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: 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: 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 objcla

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: 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 diffe

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 tes

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 whic

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.

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 a

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 Description:

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

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&dt=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: 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 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 warni

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 content-fr

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, > REORDER_BUFFER_MEM_TRACK_MAINTAIN_MAXHE

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 P

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

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); +

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 b/src/backend/replication/lo

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 stop

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

  1   2   >