Re: Memory context can be its own parent and child in replication command

2025-03-12 Thread Anthonin Bonnefoy
I've updated the patch with another approach: 0001: This sets the MemoryContext type to T_Invalid just before adding it to the aset freelist, allowing to distinguish between a MemoryContext that was placed in the freelist and shouldn't be used, and a valid one. The existing MemoryContextIsValid ch

Re: DOCS - Generated Column Replication Examples

2025-03-12 Thread vignesh C
On Sat, 1 Mar 2025 at 19:01, Amit Kapila wrote: > > On Mon, Feb 3, 2025 at 4:23 AM Peter Smith wrote: > > > > A recent commit [1] added a new section "29.6. Generated Column > > Replication" to the documentation [2]. But, no "Examples" were > > included. > > > > I've created this new thread to ma

Re: Non-text mode for pg_dumpall

2025-03-12 Thread jian he
On Wed, Mar 12, 2025 at 1:06 AM Álvaro Herrera wrote: > > Hello, > > On 2025-Mar-11, Mahendra Singh Thalor wrote: > > > In map.dat file, I tried to fix this issue by adding number of characters > > in dbname but as per code comments, as of now, we are not supporting \n\r > > in dbnames so i remove

Re: Selectively invalidate caches in pgoutput module

2025-03-12 Thread Amit Kapila
On Tue, Mar 11, 2025 at 5:47 PM Hayato Kuroda (Fujitsu) wrote: > > Attached patch address comments by you and Amit [1]. What's new; > Thanks, the patch looks mostly good to me. I have made few cosmetic changes in the attached and combined both the patches. The existing Alter Publication ... Renam

Re: Wrong results with subquery pullup and grouping sets

2025-03-12 Thread Dean Rasheed
On Wed, 12 Mar 2025 at 07:45, Richard Guo wrote: > > I refined the comment in v2 and ended up with: > > * This analysis could be tighter: in particular, a non-strict > * construct hidden within a lower-level PlaceHolderVar is not > * reason to add another PHV. But for now it doe

Re: pgsql: reindexdb: Add the index-level REINDEX with multiple jobs

2025-03-12 Thread Álvaro Herrera
On 2025-Mar-11, Alexander Korotkov wrote: > Thank you for your feedback! I also think that pipelining would be a > better options, but it's too invasive for backpatching. I've written > comments for gen_reindex_command() and run_reindex_command(). I'm > going to push this patch to master and 17

Re: AIO v2.5

2025-03-12 Thread Noah Misch
On Tue, Mar 11, 2025 at 07:55:35PM -0400, Andres Freund wrote: > On 2025-03-11 12:41:08 -0700, Noah Misch wrote: > > On Mon, Sep 16, 2024 at 01:51:42PM -0400, Andres Freund wrote: > > > On 2024-09-16 07:43:49 -0700, Noah Misch wrote: > What do we want to do for ConditionalLockBufferForCleanup() (I

Re: Special-case executor expression steps for common combinations

2025-03-12 Thread Daniel Gustafsson
> On 9 Mar 2025, at 23:35, Daniel Gustafsson wrote: >> On 8 Mar 2025, at 17:15, Andreas Karlsson wrote: >> +1 Still seems like a nice change to me too. > > Thanks, I actually had it staged to go in early next week. ..which was done yesterday, thanks for review! -- Daniel Gustafsson

Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

2025-03-12 Thread Jim Jones
On 12.03.25 09:00, jian he wrote: >> 1) WARNING might be a better fit than NOTICE here. >> > but NOTICE, on_errror set_to_null is aligned with on_errror ignore. > >> I would still leave the extra messages from "log_verbosity verbose" as >> NOTICE though. What do you think? >> >> > When LOG_V

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

2025-03-12 Thread Ashutosh Bapat
On Tue, Mar 11, 2025 at 3:46 PM Rushabh Lathia wrote: >> >> > JFYI, I can reproduce the failure Ashutosh Bapat reported, while >> > running the pg_upgrade test through meson commands. I am >> > investigating that further. >> >> Ah good, thanks. > > > Somehow, I am now not able to reproduce after

Re: Wrong results with subquery pullup and grouping sets

2025-03-12 Thread Richard Guo
On Wed, Mar 12, 2025 at 1:32 AM Dean Rasheed wrote: > On Mon, 10 Mar 2025 at 13:05, Richard Guo wrote: > > Attached are the patches. > These 2 comment changes from 0002 could be made part of 0001: > > 1). In pull_up_simple_subquery(), removing the word "Again" from the > comment following the de

Re: Conflict detection for update_deleted in logical replication

2025-03-12 Thread vignesh C
On Thu, 20 Feb 2025 at 12:50, Zhijie Hou (Fujitsu) wrote: > > > Here is the v28 patch set, which converts the subscription option > max_conflict_retention_duration into a GUC. Other logic remains unchanged. After discussing with Hou internally, I have moved this to the next CommitFest since it wi

Re: Question about duplicate JSONTYPE_JSON check

2025-03-12 Thread Álvaro Herrera
On 2025-Mar-12, Amit Langote wrote: > I was able to construct a test case that crashes due to this bug: > > CREATE TYPE mood AS ENUM ('happy', 'sad', 'neutral'); > CREATE FUNCTION mood_to_json(mood) RETURNS json AS $$ > SELECT to_json($1::text); > $$ LANGUAGE sql IMMUTABLE; > CREATE CAST (mood

Re: Parallel heap vacuum

2025-03-12 Thread Dilip Kumar
On Wed, Mar 12, 2025 at 3:40 PM Amit Kapila wrote: > > On Wed, Mar 12, 2025 at 11:24 AM Dilip Kumar wrote: > > > > On Wed, Mar 12, 2025 at 3:17 AM Masahiko Sawada > > wrote: > > > > > > On Tue, Mar 11, 2025 at 5:51 AM Amit Kapila > > > wrote: > > > > > > > > Some thoughts/questions on the ide

Re: Test mail for pgsql-hackers

2025-03-12 Thread Ashutosh Bapat
Hi Blessy, On Tue, Mar 11, 2025 at 6:03 PM BharatDB wrote: >> >> Hi , > > >> >> I’ve been exploring logical replication and noticed that if the column >> datatypes don’t match between the publisher and subscriber, PostgreSQL >> doesn’t give a warning. This can cause unexpected behavior, and I t

Re: Index AM API cleanup

2025-03-12 Thread Peter Eisentraut
While studying the patch "[PATCH v21 08/12] Allow non-btree indexes to participate in mergejoin", I figured we could do the sortsupport.c piece much simpler. The underlying issue there is similar to commits 0d2aa4d4937 and c594f1ad2ba: We're just using the btree strategy numbers to pass inform

Re: meson vs. llvm bitcode files

2025-03-12 Thread Nazir Bilal Yavuz
Hi, On Tue, 11 Mar 2025 at 01:04, Diego Fronza wrote: > I did a full review on the provided patches plus some tests, I was able to > validate that the loading of bitcode modules is working also JIT works for > both backend and contrib modules. Thank you! > To test JIT on contrib modules I jus

Re: Add an option to skip loading missing publication to avoid logical replication failure

2025-03-12 Thread Dilip Kumar
On Tue, Mar 11, 2025 at 4:01 PM vignesh C wrote: > > On Mon, 10 Mar 2025 at 09:33, Amit Kapila wrote: > > > > On Tue, Mar 4, 2025 at 6:54 PM vignesh C wrote: > > > > > > On further thinking, I felt the use of publications_updated variable > > > is not required we can use publications_valid itsel

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

2025-03-12 Thread Ashutosh Bapat
On Wed, Mar 12, 2025 at 3:20 PM Alvaro Herrera wrote: > > On 2025-Mar-12, Ashutosh Bapat wrote: > > > If the test passes for you, can you please try the patches at [1] on > > top of your patches? Please apply those, set and export environment > > variable PG_TEST_EXTRA=regress_dump_test, and run 0

Re: [PATCH] SVE popcount support

2025-03-12 Thread chiranmoy.bhattacha...@fujitsu.com
On Wed, Mar 12, 2025 at 02:41:18AM +, nathandboss...@gmail.com wrote: > v5-no-sve is the result of using a function pointer, but pointing to the > "slow" versions instead of the SVE version. v5-sve is the result of the > latest patch in this thread on a machine with SVE support, and v5-4reg i

Re: Add an option to skip loading missing publication to avoid logical replication failure

2025-03-12 Thread Amit Kapila
On Tue, Mar 11, 2025 at 9:48 AM Dilip Kumar wrote: > > On Mon, Mar 10, 2025 at 10:54 AM Amit Kapila wrote: > > > > > >> BTW, I am planning to commit this only on HEAD as this is a behavior > > >> change. Please let me know if you guys think otherwise. > > > > > > > > > Somehow this looks like a b

Re: SQL function which allows to distinguish a server being in point in time recovery mode and an ordinary replica

2025-03-12 Thread vignesh C
On Fri, 28 Feb 2025 at 19:37, wrote: > > Hi, > > Fix an error in the patch. I felt you might have missed attaching the test patches added at [1]. Also the test from [1] is failing with the latest v6 version patch. This change is not required: extern void XLogRecGetBlockRefInfo(XLogReaderState *

Re: Vacuum timing in pg_stat_all_tables

2025-03-12 Thread Bertrand Drouvot
Hi, On Tue, Mar 04, 2025 at 03:24:26PM +, Bertrand Drouvot wrote: > Like "more stats are always nice" I think that "more explanations in the doc" > are > always nice, so I don't see any reason why not to add this extra explanation. Attached an attempt to do so. Note that it does not add ext

Re: Improve monitoring of shared memory allocations

2025-03-12 Thread Rahila Syed
Hi Andres, >> > + if (hashp->isshared) >> > + { >> > + int nsegs; >> > + int nbuckets; >> > + nsegs = find_num_of_segs(nelem, &nbuckets, >> hctl->num_partitions, hctl->ssiz

Re: Proposal: Limitations of palloc inside checkpointer

2025-03-12 Thread Maxim Orlov
On Wed, 12 Mar 2025 at 10:27, Xuneng Zhou wrote: > Hi, > The patch itself looks ok to me. I'm curious about the trade-offs between > this incremental approach and the alternative of > using palloc_extended() with the MCXT_ALLOC_HUGE flag. The approach of > splitting the requests into fixed-size s

Re: INSERT ... ON CONFLICT DO SELECT [FOR ...] take 2

2025-03-12 Thread Dean Rasheed
> On 3/4/25 10:24 AM, Andreas Karlsson wrote: > Rebased the patch to add support for OLD.* and NEW.*. create table t (key int primary key, val text); insert into t values (1, 'old'); insert into t values (1, 'new') on conflict (key) do select for update returning old.*, new.*; key | val | key

Re: Implement waiting for wal lsn replay: reloaded

2025-03-12 Thread Yura Sokolov
10.03.2025 14:30, Alexander Korotkov пишет: > On Fri, Feb 28, 2025 at 3:55 PM Yura Sokolov wrote: >> 28.02.2025 16:03, Yura Sokolov пишет: >>> 17.02.2025 00:27, Alexander Korotkov wrote: On Thu, Feb 6, 2025 at 10:31 AM Yura Sokolov wrote: > I briefly looked into patch and have coup

Re: dblink: Add SCRAM pass-through authentication

2025-03-12 Thread Jacob Champion
On Mon, Mar 10, 2025 at 11:25 AM Jacob Champion wrote: > > On Fri, Mar 7, 2025 at 8:22 AM Peter Eisentraut wrote: > > Right. How about the attached? It checks as an alternative to a > > password whether the SCRAM keys were provided. That should get us back > > to the same level of checking? >

remove open-coded popcount in acl.c

2025-03-12 Thread Nathan Bossart
There's a count_one_bits() function in acl.c that can be replaced with a call to pg_popcount64(). This isn't performance-critical code, but IMHO we might as well use the centralized implementation. -- nathan >From 932fac13bf168571b145a54c29d9ac28ca2a070f Mon Sep 17 00:00:00 2001 From: Nathan Bos

Re: Orphaned users in PG16 and above can only be managed by Superusers

2025-03-12 Thread Nathan Bossart
On Wed, Mar 12, 2025 at 12:10:30PM +0530, Ashutosh Sharma wrote: > I think moving the check to the second pass won´t work in this case. > The reason is that we rely on entries in the pg_auth_members table. By > the time the check occurs in the second pass, the first pass will have > already removed

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-12 Thread Andrey Borodin
> On 12 Mar 2025, at 20:02, Evgeny Voropaev wrote: > v6 looks good to me. I'll flip the CF entry. Thanks! Best regards, Andrey Borodin.

Re: Log connection establishment timings

2025-03-12 Thread Melanie Plageman
On Tue, Mar 11, 2025 at 6:27 PM Melanie Plageman wrote: > > I did more manual testing of my patches, and I think they are mostly > ready for commit except for the IsConnectionBackend() macro (if we > have something to change it to). I've committed this and marked it as such in the CF app. Thanks

Re: Introduce "log_connection_stages" setting.

2025-03-12 Thread Melanie Plageman
On Mon, Mar 3, 2025 at 6:43 PM Melanie Plageman wrote: > > Okay, I got cold feet today working on this. I actually think we > probably want some kind of guc set (set like union/intersection/etc > not set like assign a value) infrastructure for gucs that can be equal > to any combination of predete

Re: Index AM API cleanup

2025-03-12 Thread Mark Dilger
On Wed, Mar 12, 2025 at 7:00 AM Peter Eisentraut wrote: > And another small patch set extracted from the bigger one, to keep > things moving along: > > 0001: Add get_opfamily_method() in lsyscache.c, from your patch set. > Right, this came from v21-0006-*, with a slight code comment change and o

Re: Test to dump and restore objects left behind by regression

2025-03-12 Thread Ashutosh Bapat
On Wed, Mar 12, 2025 at 5:35 PM Alvaro Herrera wrote: > > Hello > > When running these tests, I encounter this strange diff in the dumps, > which seems to be that the locale for type money does not match. I > imagine the problem is that the locale is not set correctly when > initdb'ing one of the

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

2025-03-12 Thread Rushabh Lathia
On Wed, Mar 12, 2025 at 3:20 PM Alvaro Herrera wrote: > On 2025-Mar-12, Ashutosh Bapat wrote: > > > If the test passes for you, can you please try the patches at [1] on > > top of your patches? Please apply those, set and export environment > > variable PG_TEST_EXTRA=regress_dump_test, and run 00

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-12 Thread Evgeny Voropaev
Hello Hackers! Andrey, thank you for your review and remarks. > Patch adds whitespace errors Cleaned. > if (writePage != 0) should be if (writePage) Done. > XLogSimpleInsert(int64 simpledata, RmgrId rmid, uint8 info) > I’d rename function XLogSimpleInsert() to something more descriptive > and

Re: Proposal: Progressive explain

2025-03-12 Thread Euler Taveira
On Fri, Mar 7, 2025, at 5:34 PM, Rafael Thofehrn Castro wrote: > Did additional benchmarks and found issues with the patch that doesn't do > execProcNode > wrapping. There are sporadic crashes with **double free or corruption (top)** > > So making the patch that uses the wrapper the current

Re: Index AM API cleanup

2025-03-12 Thread Tom Lane
Peter Eisentraut writes: > 0002: Add get_opfamily_member_for_cmptype(). This was called > get_opmethod_member() in your patch set, but I think that name wasn't > quite right. I also removed the opmethod argument, which was rarely > used and is somewhat redundant. Hm, that will throw an error

Re: Optimizing FastPathTransferRelationLocks()

2025-03-12 Thread Ashutosh Bapat
On Tue, Mar 11, 2025 at 8:46 PM Fujii Masao wrote: > > > > On 2025/03/11 20:55, Ashutosh Bapat wrote: > > Hi Fujii-san, > > > > It seems that this was forgotten somehow. > > > > The patch still applies. > > > > Examining c4d5cb71d229095a39fda1121a75ee40e6069a2a, it seems that this patch > > could

Re: Draft for basic NUMA observability

2025-03-12 Thread Jakub Wartak
On Mon, Mar 10, 2025 at 11:14 AM Bertrand Drouvot wrote: > Thanks for the new version! v10 is attached with most fixes after review and one new thing introduced: pg_numa_available() for run-time decision inside tests which was needed after simplifying code a little bit as you wanted. I've also f

Re: Separate GUC for replication origins

2025-03-12 Thread vignesh C
On Fri, 7 Mar 2025 at 21:21, Euler Taveira wrote: > > On Fri, Mar 7, 2025, at 11:47 AM, Peter Eisentraut wrote: > > Is that maximum active for the whole system, or maximum active per > session, or maximum active per created origin, or some combination of these? > > > It is a cluster-wide setting.

Re: Question about duplicate JSONTYPE_JSON check

2025-03-12 Thread Álvaro Herrera
On 2025-Mar-12, Amit Langote wrote: > Patch look good for committing? Ah sorry, I should have said so -- yes, it looks good to me. I feel a slight dislike for using URL-escaped characters in the mailing list link you added, because it means I cannot directly copy/paste the message-id string into

Re: Changing the state of data checksums in a running cluster

2025-03-12 Thread Tomas Vondra
On 3/11/25 14:07, Dagfinn Ilmari Mannsåker wrote: > As the resident perl style pedant, I'd just like to complain about the > below: > > Tomas Vondra writes: > >> diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm >> b/src/test/perl/PostgreSQL/Test/Cluster.pm >> index 666bd2a2d4c..1c66360c16c

Re: Index AM API cleanup

2025-03-12 Thread Peter Eisentraut
And another small patch set extracted from the bigger one, to keep things moving along: 0001: Add get_opfamily_method() in lsyscache.c, from your patch set. 0002: Add get_opfamily_member_for_cmptype(). This was called get_opmethod_member() in your patch set, but I think that name wasn't quit

Re: AIO v2.5

2025-03-12 Thread Andres Freund
Hi, On 2025-03-11 19:55:35 -0400, Andres Freund wrote: > On 2025-03-11 12:41:08 -0700, Noah Misch wrote: > > On Mon, Sep 16, 2024 at 01:51:42PM -0400, Andres Freund wrote: > > > On 2024-09-16 07:43:49 -0700, Noah Misch wrote: > > > > For non-sync IO methods, I gather it's essential that a process

Re: Add pg_buffercache_evict_all() and pg_buffercache_mark_dirty[_all]() functions

2025-03-12 Thread Nazir Bilal Yavuz
Hi, On Mon, 17 Feb 2025 at 19:59, Andres Freund wrote: > > Hi, Thanks for the review! And sorry for the late reply. > On 2024-12-25 15:57:34 +0300, Nazir Bilal Yavuz wrote: > > So, this patchset extends pg_buffercache with 3 functions: > > > > 1- pg_buffercache_evict_all(): This is very similar

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-03-12 Thread Peter Geoghegan
On Wed, Mar 12, 2025 at 4:28 PM Alena Rybakina wrote: > Thank you for the explanation! > > Now I see why these changes were made. > > After your additional explanations, everything really became clear and I > fully agree with the current code regarding this part. Cool. > However I did not see an

Re: PGSERVICEFILE as part of a normal connection string

2025-03-12 Thread Ryo Kanbayashi
On Mon, Jan 27, 2025 at 2:01 PM Michael Paquier wrote: > > 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.

RE: CRC32C Parallel Computation Optimization on ARM

2025-03-12 Thread Devulapalli, Raghuveer
> > Intel has contributed SSE4.2 CRC32C [1] and AVX-512 CRC32C [2] based on > similar techniques to postgres. > > ...this is a restatement of facts we already know. I'm guessing the intended > takeaway is "since Intel submitted an implementation to us based on paper A, > then we are free to separa

Re: Separate GUC for replication origins

2025-03-12 Thread vignesh C
On Thu, 13 Mar 2025 at 05:59, Euler Taveira wrote: > > On Wed, Mar 12, 2025, at 8:47 AM, vignesh C wrote: > > I reviewed the discussion on this thread and believe we now have an > agreement on the design and GUC names. However, the patch still needs > updates and extensive testing, especially cons

Re: DOCS: Make the Server Application docs synopses more consistent

2025-03-12 Thread Peter Smith
On Wed, Mar 12, 2025 at 3:18 AM David G. Johnston wrote: > > On Thu, Dec 12, 2024 at 8:25 PM Peter Smith wrote: >> >> [1] initdb [option...] [ --pgdata | -D ] directory >> [2] pg_archivecleanup [option...] archivelocation oldestkeptwalfile >> [3] pg_checksums [option...] [[ -D | --pgdata ]datadir

Re: Proposal: Filter irrelevant change before reassemble transactions during logical decoding

2025-03-12 Thread Ajin Cherian
On Mon, Mar 3, 2025 at 9:10 PM Ajin Cherian wrote: > > On Thu, Feb 20, 2025 at 8:42 PM Hayato Kuroda (Fujitsu) > wrote: > > I confirmed with tests that with the patch, a lot less disk space is used when there are lots of unpublished changes and the subscription is not configured to be streaming.

Re: Vacuum statistics

2025-03-12 Thread Jim Nasby
On Wed, Mar 12, 2025 at 2:41 PM Alena Rybakina wrote: > Hi! > > On 10.03.2025 12:13, Ilia Evdokimov wrote: > > Hi, > > > > After commit eaf5027 we should add information about wal_buffers_full. > > > > Any thoughts? > > > > -- > > Best regards, > > Ilia Evdokimov, > > Tantor Labs LLC. > > > I thi

DOCS: Make the Server Application docs synopses more consistent

2025-03-12 Thread David G. Johnston
On Wednesday, March 12, 2025, Peter Smith wrote: > > > I've made some updates and attached the v2 patch. Thanks. Full review later. Pg_controldata - TODO. The page structure looks strange. There should be an "Options" > section to describe -D, -V, and -? Agreed. > > [7] pg_resetwal [ -f |

Re: DOCS: Make the Server Application docs synopses more consistent

2025-03-12 Thread David G. Johnston
On Wednesday, March 12, 2025, David G. Johnston wrote: > > > My take on this is that the presence of environment variables doesn’t > impact whether a given CLI option is shown optional or mandatory. We are, > in effect, communicating that “datadir” must be specified for this > command. And then

Re: Add Postgres module info

2025-03-12 Thread Andrei Lepikhov
On 7/3/2025 16:56, Andrei Lepikhov wrote: On 2/3/2025 20:35, Andrei Lepikhov wrote: On 17/2/2025 04:00, Michael Paquier wrote: No documentation provided. Ok, I haven't been sure this idea has a chance to be committed. I will introduce the docs in the next version. This is a new version with bu

Re: remove open-coded popcount in acl.c

2025-03-12 Thread Álvaro Herrera
On 2025-Mar-12, Nathan Bossart wrote: > On Wed, Mar 12, 2025 at 05:23:25PM +0100, Álvaro Herrera wrote: > > Strange: this code is not covered by any tests. > > > > https://coverage.postgresql.org/src/backend/utils/adt/acl.c.gcov.html#5533 > > https://coverage.postgresql.org/src/backend/utils/adt/

Re: remove open-coded popcount in acl.c

2025-03-12 Thread Nathan Bossart
On Wed, Mar 12, 2025 at 05:23:25PM +0100, Álvaro Herrera wrote: > Strange: this code is not covered by any tests. > > https://coverage.postgresql.org/src/backend/utils/adt/acl.c.gcov.html#5533 > https://coverage.postgresql.org/src/backend/utils/adt/acl.c.gcov.html#5438 Huh. Well, it's easy enoug

Re: remove open-coded popcount in acl.c

2025-03-12 Thread Nathan Bossart
On Wed, Mar 12, 2025 at 07:34:16PM +0100, Álvaro Herrera wrote: > Thanks :-) I confirm that this covers the code in select_best_grantor > that you're modifying. Thanks for the quick review. I'll plan on committing this shortly if CI is happy. -- nathan

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

2025-03-12 Thread Alvaro Herrera
On 2025-Mar-12, Rushabh Lathia wrote: > Hi Alvaro, > > Here are the latest patches, which includes the regression fix. Thank you. Taking a step back after discussing this with some colleagues, I need to contradict what I said at the start of this thread. There's a worry that changing pg_attrib

Re: [PATCH] SVE popcount support

2025-03-12 Thread Nathan Bossart
On Wed, Mar 12, 2025 at 10:34:46AM +, chiranmoy.bhattacha...@fujitsu.com wrote: > On Wed, Mar 12, 2025 at 02:41:18AM +, nathandboss...@gmail.com wrote: > >> v5-no-sve is the result of using a function pointer, but pointing to the >> "slow" versions instead of the SVE version. v5-sve is t

Re: Handle interrupts while waiting on Append's async subplans

2025-03-12 Thread Heikki Linnakangas
On 03/03/2025 19:44, Heikki Linnakangas wrote: In any case, the attached patch works and seems like an easy fix for stable branches at least. Committed that to master and all affected stable branches. -- Heikki Linnakangas Neon (https://neon.tech)

Re: remove open-coded popcount in acl.c

2025-03-12 Thread Álvaro Herrera
On 2025-Mar-12, Nathan Bossart wrote: > There's a count_one_bits() function in acl.c that can be replaced with a > call to pg_popcount64(). This isn't performance-critical code, but IMHO we > might as well use the centralized implementation. Makes sense. Patch looks good to me. > @@ -5532,7 +5

Re: vacuumdb changes for stats import/export

2025-03-12 Thread Nathan Bossart
On Wed, Mar 12, 2025 at 01:56:04PM +0700, John Naylor wrote: > The change here seems fine. My only quibble is that this sentence now > seems out of place: "Option --analyze-in-stages can be used to > generate minimal statistics quickly." I'm thinking we should make a > clearer separation for with a

Re: Vacuum statistics

2025-03-12 Thread Alena Rybakina
Hi! On 10.03.2025 16:33, Kirill Reshke wrote: On Thu, 27 Feb 2025 at 23:00, Alena Rybakina wrote: Hi! On 17.02.2025 17:46, Alena Rybakina wrote: On 04.02.2025 18:22, Alena Rybakina wrote: Hi! Thank you for your review! On 02.02.2025 23:43, Alexander Korotkov wrote: On Mon, Jan 13, 2025 at

Re: Vacuum statistics

2025-03-12 Thread Alena Rybakina
Hi! On 10.03.2025 12:13, Ilia Evdokimov wrote: Hi, After commit eaf5027 we should add information about wal_buffers_full. Any thoughts? -- Best regards, Ilia Evdokimov, Tantor Labs LLC. I think I can add it. To be honest, I haven't gotten to know this statistic yet, haven't had time to get

Re: Optimization for lower(), upper(), casefold() functions.

2025-03-12 Thread Alexander Borisov
12.03.2025 19:55, Alexander Borisov wrote: [...] A couple questions: * Is there a reason the fast-path for codepoints < 0x80 is in unicode_case.c rather than unicode_case_func.h? Yes, this is an important optimization, below are benchmarks that [...] I forgot to add the benchmark: Benchm

Re: Rename functions to alloc/free things in reorderbuffer.c

2025-03-12 Thread Tom Lane
Heikki Linnakangas writes: > ReorderBufferGetRelids allocates an array with MemoryContextAlloc, and > ReorderBufferReturnRelids just calls pfree. The pools are long gone, and > now the naming looks weird. > Attached patch renames those functions and other such functions to use > the terms Allo

Re: making EXPLAIN extensible

2025-03-12 Thread Sami Imseih
Hi, >>> EXPLAIN output. It wouldn't make sense for core to have an EXPLAIN >>> option whose whole purpose is to cater to the needs of some extension, >>> so that made me think of providing some extensibility infrastructure. >> Making EXPLAIN extensible sounds like a good idea.. FWIW, There is a

Re: making EXPLAIN extensible

2025-03-12 Thread Tom Lane
Sami Imseih writes: > 1/ As you can see form the output above, I used explain_per_node_hook > to append a "Plan Node ID" to the explain output. I really don't like having > it > there, and prefer that it gets added to the top line of the node. > i.e. >-> Foreign Scan on t_r1 (cost=100.00..

Re: Non-text mode for pg_dumpall

2025-03-12 Thread Andrew Dunstan
On 2025-03-12 We 3:03 AM, jian he wrote: On Wed, Mar 12, 2025 at 1:06 AM Álvaro Herrera wrote: Hello, On 2025-Mar-11, Mahendra Singh Thalor wrote: In map.dat file, I tried to fix this issue by adding number of characters in dbname but as per code comments, as of now, we are not supporting

Re: Optimization for lower(), upper(), casefold() functions.

2025-03-12 Thread Jeff Davis
On Wed, 2025-03-12 at 19:55 +0300, Alexander Borisov wrote: > 1. Added static for casemap() function. Otherwise the compiler could > not > optimize the code and the performance dropped significantly. Oops, it was static, but I made it external just to see what code it generated. I didn't intend to

Re: Changing the state of data checksums in a running cluster

2025-03-12 Thread Dagfinn Ilmari Mannsåker
Tomas Vondra writes: > On 3/11/25 14:07, Dagfinn Ilmari Mannsåker wrote: >> As the resident perl style pedant, I'd just like to complain about the >> below: >> >> Tomas Vondra writes: >> >>> diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm >>> b/src/test/perl/PostgreSQL/Test/Cluster.pm >

Re: meson vs. llvm bitcode files

2025-03-12 Thread Diego Fronza
Hi, The v7 patch looks good to me, handling the bitcode modules in a uniform way and also avoiding the hacky code and warnings, much better now. A small note about the bitcode emission for generated sources in contrib, using cube as example, currently it creates two dict entries in a list: bc_seg

Re: dblink query interruptibility

2025-03-12 Thread Andreas Karlsson
On 3/12/25 12:48 AM, Noah Misch wrote: The CREATE DATABASE hang is indeed new in v15. The general dblink missed interrupt processing (e.g. pg_cancel_backend response delay) is an old bug. Aha, that was what you were referring to! My apologies, was reading your mail a bit too quickly. :) Co

Re: Parallel heap vacuum

2025-03-12 Thread Amit Kapila
On Wed, Mar 12, 2025 at 11:24 AM Dilip Kumar wrote: > > On Wed, Mar 12, 2025 at 3:17 AM Masahiko Sawada wrote: > > > > On Tue, Mar 11, 2025 at 5:51 AM Amit Kapila wrote: > > > > > Some thoughts/questions on the idea > > I notice that we are always considering block-level parallelism for > heaps

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

2025-03-12 Thread Alvaro Herrera
On 2025-Mar-12, Ashutosh Bapat wrote: > The 002_pg_upgrade test passes with and without my patches now. But > then the tests added here do not leave behind any parent-child table. > Previously we have found problems in dumping and restoring constraints > in an inheritance hierarchy. I think the te

Re: [PoC] Reducing planning time when tables have many partitions

2025-03-12 Thread newtglobal postgresql_contributors
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: tested, failed Documentation:tested, failed Hi Yuya, Tested this patch and noted that this patch signific

Re: Test mail for pgsql-hackers

2025-03-12 Thread David G. Johnston
On Wednesday, March 12, 2025, Ashutosh Bapat wrote: > Hi Blessy, > > On Tue, Mar 11, 2025 at 6:03 PM BharatDB wrote: > >> > >> Hi , > > > > > >> > >> I’ve been exploring logical replication and noticed that if the column > datatypes don’t match between the publisher and subscriber, PostgreSQL >

Re: Document NULL

2025-03-12 Thread Marcos Pegoraro
Em ter., 11 de mar. de 2025 às 17:43, Tom Lane escreveu: > I think that idea (changing all the docs) is a complete nonstarter > because people would not understand why the results they get don't > look like what it says in the docs. Of course, we could fix that > by changing the factory default

Re: per backend WAL statistics

2025-03-12 Thread Tom Lane
Michael Paquier writes: > And I guess that we're OK here, so applied. That should be the last > one. Quite a few buildfarm members are not happy about the initialization that 9a8dd2c5a added to PendingBackendStats. For instance [1]: gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -W

Re: RFC: Additional Directory for Extensions

2025-03-12 Thread Matheus Alcantara
On Tue, Mar 11, 2025 at 12:59 PM Peter Eisentraut wrote: > Yes, that structure looks ok. But you can remove one level of block in > get_extension_control_directories(). > Sorry, missed during debugging. Fixed > I found a bug that was already present in my earlier patch versions: > > @@ -423,7 +4

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

2025-03-12 Thread Ashutosh Bapat
On Wed, Mar 12, 2025 at 3:52 PM Rushabh Lathia wrote: > > > Hi Alvaro, > > Here are the latest patches, which includes the regression fix. > The 002_pg_upgrade test passes with and without my patches now. But then the tests added here do not leave behind any parent-child table. Previously we have

RE: Selectively invalidate caches in pgoutput module

2025-03-12 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > Thanks, the patch looks mostly good to me. I have made few cosmetic > changes in the attached and combined both the patches. Thanks, it looks good to me. > The existing > Alter Publication ... Rename tests don't test invalidations arising > from that command. As this patch changes t

Re: Question about duplicate JSONTYPE_JSON check

2025-03-12 Thread Amit Langote
On Wed, Mar 12, 2025 at 7:09 PM Álvaro Herrera wrote: > On 2025-Mar-12, Amit Langote wrote: > > > I was able to construct a test case that crashes due to this bug: > > > > CREATE TYPE mood AS ENUM ('happy', 'sad', 'neutral'); > > CREATE FUNCTION mood_to_json(mood) RETURNS json AS $$ > > SELECT t

Re: Change log level for notifying hot standby is waiting non-overflowed snapshot

2025-03-12 Thread torikoshia
Hi, After an off-list discussion with Fujii-san, I'm now trying to modify the following message that is output when a client attempts to connect instead of changing the log level as the original proposal: $ psql: error: connection to server at "localhost" (::1), port 5433 failed: FATAL: t

Re: Logical Replication of sequences

2025-03-12 Thread vignesh C
On Wed, 12 Mar 2025 at 09:14, vignesh C wrote: > > The patch was not applying on top of HEAD because of recent commits, > here is a rebased version. I have moved this to the next CommitFest since it will not be committed in the current release. This also allows reviewers to focus on the remaining

Re: Bypassing cursors in postgres_fdw to enable parallel plans

2025-03-12 Thread Andy Fan
Rafia Sabih writes: Hi, > > At present, in postgres_fdw, if a query which is using a parallel plan is > fired from the remote end fails to use the > parallel plan locally because of the presence of CURSORS. Consider the > following example, ... > > Now, to overcome this limitation, I have wor

Re: Document NULL

2025-03-12 Thread David G. Johnston
On Wednesday, March 12, 2025, Marcos Pegoraro wrote: > Em ter., 11 de mar. de 2025 às 17:43, Tom Lane > escreveu: > >> I think that idea (changing all the docs) is a complete nonstarter >> because people would not understand why the results they get don't >> look like what it says in the docs.

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

2025-03-12 Thread Rushabh Lathia
Hi Alvaro, Here are the latest patches, which includes the regression fix. Thanks, On Wed, Mar 12, 2025 at 3:38 PM Ashutosh Bapat wrote: > On Wed, Mar 12, 2025 at 3:20 PM Alvaro Herrera > wrote: > > > > On 2025-Mar-12, Ashutosh Bapat wrote: > > > > > If the test passes for you, can you ple

Re: Parallel safety docs for CTEs

2025-03-12 Thread James Coleman
On Tue, Nov 19, 2024 at 2:16 PM James Coleman wrote: > > Hello, > > A colleague noticed today that the docs still say that "Scans of > common table expressions (CTEs)" are "always parallel restricted". > > While I think that strictly remains true at the implementation level, > from a user's perspe

Re: Statistics import and export: difference in statistics of materialized view dumped

2025-03-12 Thread Ashutosh Bapat
On Wed, Mar 12, 2025 at 4:08 AM Jeff Davis wrote: > > On Tue, 2025-03-11 at 11:26 -0400, Tom Lane wrote: > > Right, that was what I was thinking, but hadn't had time to look in > > detail. The postDataBound dependency isn't real helpful here, we > > could lose that if we had the data dependency.

Re: AIO v2.5

2025-03-12 Thread Andres Freund
Hi, On 2025-03-11 20:57:43 -0700, Noah Misch wrote: > > I think we'll really need to do something about this for BSD users > > regardless > > of AIO. Or maybe those OSs should fix something, but somehow I am not having > > high hopes for an OS that claims to have POSIX confirming unnamed semaphor

001_rep_changes.pl succeeds after a long time

2025-03-12 Thread Álvaro Herrera
Hello, I noticed that the test file 001_repo_changes.pl finished successfully after having taken 180s to run. This seems pretty suspicious -- normally that step takes around one second. The problem is seen in this step: [19:44:49.572](0.262s) ok 24 - update works with dropped subscriber column

Rename functions to alloc/free things in reorderbuffer.c

2025-03-12 Thread Heikki Linnakangas
I noticed some weird naming conventions in reorderbuffer.c which are leftovers from a long time ago when reorderbuffer.c maintained its own small memory pools to reduce palloc/pfree overhead. For example: extern Oid *ReorderBufferGetRelids(ReorderBuffer *rb, int nrelids); extern void ReorderBuf

Re: Test to dump and restore objects left behind by regression

2025-03-12 Thread Alvaro Herrera
On 2025-Mar-12, Ashutosh Bapat wrote: > Does the test pass for you if you don't apply my patches? Yes. It also passes if I keep PG_TEST_EXTRA empty. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

Re: Index AM API cleanup

2025-03-12 Thread Mark Dilger
On Wed, Mar 12, 2025 at 7:25 AM Tom Lane wrote: > Peter Eisentraut writes: > > 0002: Add get_opfamily_member_for_cmptype(). This was called > > get_opmethod_member() in your patch set, but I think that name wasn't > > quite right. I also removed the opmethod argument, which was rarely > > used

Re: Primary and standby setting cross-checks

2025-03-12 Thread Kirill Reshke
On Thu, 29 Aug 2024 at 23:52, Heikki Linnakangas wrote: > > Currently, if you configure a hot standby server with a smaller > max_connections setting than the primary, the server refuses to start up: > > LOG: entering standby mode > FATAL: recovery aborted because of insufficient parameter setti

Re: Replace IN VALUES with ANY in WHERE clauses during optimization

2025-03-12 Thread Alena Rybakina
Hi, Alexander! On 06.03.2025 11:23, Alexander Korotkov wrote: Hi, Alena! On Sat, Mar 1, 2025 at 1:39 PM Alena Rybakina wrote: On 09.02.2025 18:38, Alexander Korotkov wrote: Also, aren't we too restrictive while requiring is_simple_values_sequence()? For instance, I believe cases like this (c

  1   2   >