Re: [PATCH] Add get_bytes() and set_bytes() functions

2025-03-07 Thread Dean Rasheed
On Sat, 1 Mar 2025 at 11:30, Dean Rasheed wrote: > > With those updates, I think this is ready for commit, which I'll do in > a day or two, if there are no further comments. > Committed. Regards, Dean

Re: Log connection establishment timings

2025-03-07 Thread Bertrand Drouvot
Hi, On Thu, Mar 06, 2025 at 11:41:03AM -0500, Melanie Plageman wrote: > > I still need to do some more manual testing and validation. > > On Thu, Mar 6, 2025 at 9:56 AM Bertrand Drouvot > wrote: > > > + /* If an empty string was passed, we're done. */ > > + if (list_length(elemlist

RE: Selectively invalidate caches in pgoutput module

2025-03-07 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thanks for the comment! PSA new version. > > Few comments: > 1. Why do we need to invalidate relsync entries when owner of its > publication changes? > > I think the owner change will impact the future Alter Publication ... > Add/Drop/Set/Rename operations as that will be allowed onl

Re: Trigger more frequent autovacuums

2025-03-07 Thread wenhui qiu
Sorry ,A wrong version of debug pcnt_visibletuples ,kindly please check the v3 attachment On Fri, Mar 7, 2025 at 5:37 PM wenhui qiu wrote: > Hi >The more accurate data I've found is tabentry->live_tuples; provides > the second version > > #Here's a simple test I did > > test=# select count(*

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Laurenz Albe
On Fri, 2025-02-28 at 19:16 +0100, Michael Banck wrote: > New version 3 attached. I am fine with v3, and I'll mark it "ready for committer". I have been wondering about regression tests. We cannot have them in the core tests, because we cannot rely on any extension being available. We could shove

Re: strange valgrind reports about wrapper_handler on 64-bit arm

2025-03-07 Thread Nathan Bossart
On Fri, Mar 07, 2025 at 12:03:47AM +0100, Tomas Vondra wrote: > while running check-world on 64-bit arm (rpi5 with Debian 12.9), I got a > couple reports like this: > > ==64550== Use of uninitialised value of size 8 > ==64550==at 0xA62FE0: wrapper_handler (pqsignal.c:107) > ==64550==by 0x5

Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)

2025-03-07 Thread Shayon Mukherjee
On Sun, Feb 23, 2025 at 3:41 PM Shayon Mukherjee wrote: > I have rebased the patch on top of master (resolving some merge > conflicts), along with the meson changes (thank you for that). > Rebased against the latest master and attaching the v13 patch. Thank you Shayon v13-0001-Introduce-the-a

Re: dblink: Add SCRAM pass-through authentication

2025-03-07 Thread Peter Eisentraut
On 06.03.25 22:58, Jacob Champion wrote: On Thu, Mar 6, 2025 at 12:33 PM Peter Eisentraut wrote: AFAICT, in pgfdw_security_check(), if SCRAM has been used for the outgoing server connection, then PQconnectionUsedPassword() is true, and then this check should fail if no "password" parameter was

Re: Statistics Import and Export

2025-03-07 Thread Andres Freund
Hi, On 2025-03-06 17:42:30 -0800, Jeff Davis wrote: > At minimum, we would need to at least add the option "--with- > statistics", because right now the only way to explicitly request stats > is to say "--statistics-only". +1, this has been annoying me while testing. I did get confused for a whi

Re: TOAST versus toast

2025-03-07 Thread Robert Treat
On Mon, Feb 17, 2025 at 6:27 PM David G. Johnston wrote: > > On Wed, Jan 15, 2025 at 10:38 PM Peter Smith wrote: >> >> On Thu, Jan 16, 2025 at 3:26 PM Tom Lane wrote: >> > >> > Peter Smith writes: >> > > During some recent reviews, I came across some comments mentioning >> > > "toast" ... >> >

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Tom Lane
Jelte Fennema-Nio writes: > The reason why I walked back my comment was that cloud providers can > simply choose which extensions they actually add to the image. If an > extension is marked as not trusted by the author, then with this role > they can still choose to add it without having to make c

Re: AIX support

2025-03-07 Thread Robert Haas
On Fri, Mar 7, 2025 at 9:11 AM Srirama Kucherlapati wrote: > Our team has identified couple of issues with the meson build on AIX, > primarily focusing on the following areas: > > Symbol extraction and resolution in object files during binary creation. > Dynamic runtime library path resolution in

Re: new commitfest transition guidance

2025-03-07 Thread jian he
hi. It seems we don't have much info about "Patch Triage" in 2025. but 2023, 2024 we do have. like: https://wiki.postgresql.org/wiki/FOSDEM/PGDay_2024_Developer_Meeting#v17_Patch_Triage and https://wiki.postgresql.org/wiki/FOSDEM/PGDay_2023_Developer_Meeting#v16_Patch_Triage

RE: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET

2025-03-07 Thread Bykov Ivan
Hello! Last time, I forgot to attach the patches. The problem still persists in the 17.3 release. Solution One The simplest way to fix the problem is to place the scalar field used in the query ID calculation between similar subnodes. A patch for this solution is attached below (00

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Tom Lane
Robert Haas writes: > On Fri, Mar 7, 2025 at 9:37 AM Michael Banck wrote: >> Also, I think there is case to be made that a cloud provider (or site >> admin) would like to delegate the decision whether users with CREATE >> rights on a particular database are allowed to install some extensions >> o

Re: doc: expand note about pg_upgrade's --jobs option

2025-03-07 Thread Magnus Hagander
On Wed, Mar 5, 2025 at 5:28 PM Nathan Bossart wrote: > On Wed, Mar 05, 2025 at 09:35:27AM -0600, Nathan Bossart wrote: > > On Wed, Mar 05, 2025 at 01:52:40PM +0100, Magnus Hagander wrote: > >> Another option that I think would also work is to just cut down the > details > >> to just "The --jobs o

Re: per backend WAL statistics

2025-03-07 Thread Michael Paquier
On Fri, Mar 07, 2025 at 08:33:04AM +, Bertrand Drouvot wrote: > But when it's time to flush, then pgstat_backend_have_pending_cb() checks > for zeros in PendingBackendStats *without* any check on the backend type. > > I think the issue is "masked" on HEAD because PendingBackendStats is > proba

Re: strange valgrind reports about wrapper_handler on 64-bit arm

2025-03-07 Thread Andres Freund
Hi, On 2025-03-07 00:03:47 +0100, Tomas Vondra wrote: > while running check-world on 64-bit arm (rpi5 with Debian 12.9), I got a > couple reports like this: > > ==64550== Use of uninitialised value of size 8 > ==64550==at 0xA62FE0: wrapper_handler (pqsignal.c:107) > ==64550==by 0x580BB9E7

Re: Add contrib/pg_logicalsnapinspect

2025-03-07 Thread Masahiko Sawada
On Fri, Mar 7, 2025 at 2:42 AM Bertrand Drouvot wrote: > > Hi, > > On Fri, Mar 07, 2025 at 10:26:23AM +0530, Amit Kapila wrote: > > On Fri, Mar 7, 2025 at 3:19 AM Masahiko Sawada > > wrote: > > > > > > On Wed, Mar 5, 2025 at 4:05 AM Bertrand Drouvot > > > wrote: > > > > > > > > Hi, > > > > > >

Re: Simplify the logic a bit (src/bin/scripts/reindexdb.c)

2025-03-07 Thread Álvaro Herrera
Hello I find that this is still quite broken -- both the original, and your patch. I have already complained about a fundamental bug in the original in [1]. In addition to what I reported there, in the unpatched code I noticed that we're wasting memory and CPU by comparing the qualified table na

Re: Add column name to error description

2025-03-07 Thread Tom Lane
jian he writes: > On Fri, Mar 7, 2025 at 11:05 AM Tom Lane wrote: >> Do others agree Erik's version improves readability? > i think so. Pushed v4, then. regards, tom lane

Re: Statistics Import and Export

2025-03-07 Thread Jeff Davis
On Fri, 2025-03-07 at 12:41 -0500, Robert Treat wrote: > Ugh... this feels like a bit of the combinatorial explosion, > especially if we ever need to add another option. Not quite that bad, because ideally the yes/no/only would not be expanding as well. But I agree that it feels like a lot of opt

Re: Simplify the logic a bit (src/bin/scripts/reindexdb.c)

2025-03-07 Thread Álvaro Herrera
On 2025-Mar-07, Álvaro Herrera wrote: > Anyway, my version of this is attached. It fixes the problems with your > patch, but not Orlov's fundamental bug. And of course I forgot to actually attach the patch. Good grief. -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseD

Re: pg_atomic_compare_exchange_*() and memory barriers

2025-03-07 Thread Alexander Korotkov
On Fri, Mar 7, 2025 at 7:07 PM Andres Freund wrote: > On 2025-03-07 18:39:42 +0200, Alexander Korotkov wrote: > > On Fri, Mar 7, 2025 at 6:02 PM Andres Freund wrote: > > > > > > On 2025-03-07 17:47:08 +0200, Alexander Korotkov wrote: > > > > While investigating a bug in the patch to get rid of WA

Re: Statistics Import and Export

2025-03-07 Thread Hari Krishna Sunder
To improve the performance of pg_dump can we add a new sql function that can operate more efficiently than the pg_stats view? It could also take in an optional list of oids to filter on. This will help speed up the dump and restore within pg18 and future upgrades to higher pg versions. Thanks Hari

Re: Parallel heap vacuum

2025-03-07 Thread Masahiko Sawada
On Thu, Mar 6, 2025 at 5:33 PM Peter Smith wrote: > > Some minor review comments for patch v10-0001. > > == > src/include/access/tableam.h > > 1. > struct IndexInfo; > +struct ParallelVacuumState; > +struct ParallelContext; > +struct ParallelWorkerContext; > struct SampleScanState; > > Use a

RE: Selectively invalidate caches in pgoutput module

2025-03-07 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > Don't we need to call this invalidation function from > InvalidateSystemCachesExtended()? Hmm. I did not call relsync callback functions in InvalidateSystemCachesExtended() intentionally, but added now. Please see my analysis below and let me know how you think. In the first place,

Re: per backend WAL statistics

2025-03-07 Thread Michael Paquier
On Thu, Mar 06, 2025 at 10:33:52AM +, Bertrand Drouvot wrote: > Indeed, there is no reason for pgstat_backend_have_pending_cb() to return > true if > pgstat_tracks_backend_bktype() is not satisfied. > > So it deserves a dedicated patch to fix this already existing issue: > 0001 attached. p

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Robert Haas
On Fri, Mar 7, 2025 at 11:21 AM Tom Lane wrote: > While I'm all for chipping away at what superuser privilege is > needed for, we have to tread VERY carefully about chipping away > at things that allow any outside-the-database access. I agree, but I also don't want the security decisions that the

Re: Commitfest app release on Feb 17 with many improvements

2025-03-07 Thread Tom Lane
Jelte Fennema-Nio writes: > On Fri, 7 Mar 2025 at 17:42, Tom Lane wrote: >> Hm, don't you *want* a failure if the patch is already applied? > It's pretty common that in a larger patchset the first 1-2 > small/trivial patches get committed before the rest. Having to then > send an additional emai

Re: Simplify the logic a bit (src/bin/scripts/reindexdb.c)

2025-03-07 Thread Ranier Vilela
Em sex., 7 de mar. de 2025 às 15:54, Álvaro Herrera escreveu: > Hello > > I find that this is still quite broken -- both the original, and your > patch. I have already complained about a fundamental bug in the > original in [1]. In addition to what I reported there, in the unpatched > code I no

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

2025-03-07 Thread Joel Jacobson
On Wed, Mar 5, 2025, at 03:32, Andreas Karlsson wrote: > On 3/4/25 10:24 AM, Andreas Karlsson wrote: >> Rebased the patch to add support for OLD.* and NEW.*. > > Apparently the CI did not like that version. > > Andreas > > Attachments: > * v6-0001-Add-support-for-ON-CONFLICT-DO-SELECT-FOR.patch +1

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-03-07 Thread Jacob Champion
On Thu, Mar 6, 2025 at 9:13 PM Thomas Munro wrote: > I don't see that behaviour on my Mac with a simple program, and that > seems like it couldn't possibly be intended. What version of macOS? Just to make sure I'm not chasing ghosts, I've attached my test program. Here are my CI results for runn

Re: Add Pipelining support in psql

2025-03-07 Thread Daniel Verite
Jelte Fennema-Nio wrote: > As an example you can copy paste this tiny script: > > \startpipeline > select pg_sleep(5) \bind \g > \endpipeline > > And then it will show these "extra argument ... ignored" warnings > > \startpipeline: extra argument "select" ignored > \startpipeline: extra

Re: Log connection establishment timings

2025-03-07 Thread Jacob Champion
On Fri, Mar 7, 2025 at 2:17 PM Melanie Plageman wrote: > Yea, "auth_id" is too ambiguous for a GUC option. I went with > "authorization" because it sounds a bit less like a stage while also > being a recognizable word. It achieves symmetry -- though it doesn't > match the prefix used in the logs.

Re: Expanding HOT updates for expression and partial indexes

2025-03-07 Thread Matthias van de Meent
On Thu, 6 Mar 2025 at 13:40, Burd, Greg wrote: > > > On Mar 5, 2025, at 6:39 PM, Matthias van de Meent > > wrote: > > > > On Wed, 5 Mar 2025 at 18:21, Burd, Greg wrote: > >> * augments IndexInfo only when needed for testing expressions and only once > > > > ExecExpressionIndexesUpdated seems to

Re: Log connection establishment timings

2025-03-07 Thread Melanie Plageman
On Fri, Mar 7, 2025 at 10:09 AM Bertrand Drouvot wrote: > > Given that conn_timing.ready_for_use is only used here: > > + if (!reported_first_ready_for_query && > + (log_connections & > LOG_CONNECTION_READY_FOR_USE) && > +

RE: Selectively invalidate caches in pgoutput module

2025-03-07 Thread Hayato Kuroda (Fujitsu)
Dear Amit, hackers, > Yeah, this is a good improvement and the patch looks safe to me, so I > pushed with minor changes in the comments. Thanks! PSA rebased patch. While considering more about 0002, I found a conceptual bug - when relsync cache could not be re-built when SQL interfaces are used.

Re: jsonb_strip_nulls with arrays?

2025-03-07 Thread Andrew Dunstan
On 2025-03-06 Th 9:17 AM, Shinoda, Noriyoshi (SXD Japan FSI) wrote: Hi, Thanks for developing the good feature. I've attached a small patch for the documentation of the json_strip_nulls function. The data type of the 'target' parameter is different between the implementation and the documenta

Re: Statistics Import and Export

2025-03-07 Thread Corey Huinker
> > I tried to generalize that requirement to all of > {schema|data|statistics} for consistency, but that resulted in 9 > options. > 9 options that resolve to 3 boolean variables. It's not that hard. And if we add a fourth option set, then we have 12 options. So it's O(3N), not O(N^2). People ha

Re: Statistics Import and Export

2025-03-07 Thread Corey Huinker
> > > if you want everything --include=schema,data,statistics (presumably > redundant with the default behavior) > if you want schema only --include=schema > if you want "everything except schema" --include=data,statistics > Until we add a fourth option, and then it becomes completely ambiguous as

Re: [Patch] remove duplicated smgrclose

2025-03-07 Thread Masahiko Sawada
Hi, On Sun, Oct 27, 2024 at 12:05 PM Kirill Reshke wrote: > > On Wed, 14 Aug 2024 at 11:35, Steven Niu wrote: > > > > Junwang, Kirill, > > > > The split work has been done. I created a new patch for removing redundant > > smgrclose() function as attached. > > Please help review it. > > > > Than

Re: support virtual generated column not null constraint

2025-03-07 Thread Xuneng Zhou
Hi, jian he 于2025年3月6日周四 21:44写道: > On Wed, Feb 26, 2025 at 3:01 PM ego alter wrote: > > > > Hi, I’ve had a chance to review the patch. As I am still getting > familiar with executor part, questions and feedbacks could be relatively > trivial. > > > > There are two minor issues i want to discu

Re: support virtual generated column not null constraint

2025-03-07 Thread Xuneng Zhou
Hi, forget to add hackers to cc. Xuneng Zhou 于2025年3月8日周六 12:10写道: > > > Navneet Kumar 于2025年3月8日周六 02:09写道: > >> >> >>> This scenario fails >>> 1. CREATE TABLE person ( >>> id INT GENERATED BY DEFAULT AS IDENTITY, >>> first_name VARCHAR(50) NOT NULL, >>> last_name VARCHAR(50) NOT

Re: Statistics Import and Export

2025-03-07 Thread Corey Huinker
On Sat, Mar 8, 2025 at 12:52 AM Hari Krishna Sunder wrote: > To improve the performance of pg_dump can we add a new sql function that > can operate more efficiently than the pg_stats view? It could also take in > an optional list of oids to filter on. > This will help speed up the dump and restor

Re: per backend WAL statistics

2025-03-07 Thread Bertrand Drouvot
Hi, On Sat, Mar 08, 2025 at 10:57:38AM +0900, Michael Paquier wrote: > On Fri, Mar 07, 2025 at 08:33:04AM +, Bertrand Drouvot wrote: > > But when it's time to flush, then pgstat_backend_have_pending_cb() checks > > for zeros in PendingBackendStats *without* any check on the backend type. > >

Re: Statistics Import and Export

2025-03-07 Thread Corey Huinker
Updated and rebase patches. 0001 is the same as v6-0002, but with proper ACL checks on schemas after cache lookup 0002 attempts to replace all possible ERRORs in the restore/clear functions with WARNINGs. This is done with an eye towards reducing the set of things that could potentially cause an

Re: Add contrib/pg_logicalsnapinspect

2025-03-07 Thread Bertrand Drouvot
Hi, On Fri, Mar 07, 2025 at 12:09:35PM -0800, Masahiko Sawada wrote: > Thank you for updating the patch. It looks mostly good to me. I've > made some cosmetic changes and attached the updated version. LGTM, thanks! Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Datab

Re: pg_dump, pg_dumpall, pg_restore: Add --no-policies option

2025-03-07 Thread Jim Jones
Hi On 27.02.25 15:37, vignesh C wrote: > Here is a rebased version along with the test failure fixes, please > accept the change if you are ok with it. Patch LGTM. +1 It applies cleanly and works as described: == pg_dump == $ /usr/local/postgres-dev/bin/pg_dump db > dump.out $ grep "POLICY"

Re: Log connection establishment timings

2025-03-07 Thread Bertrand Drouvot
Hi, On Thu, Mar 06, 2025 at 02:10:47PM -0500, Andres Freund wrote: > On 2025-01-20 15:01:38 +, Bertrand Drouvot wrote: > > /* If start_time is in the future or now, no time has elapsed */ > > if (start_time >= stop_time) > > return 0; > > " > > > > I think that it can happen d

Re: Separate GUC for replication origins

2025-03-07 Thread Euler Taveira
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. Similar to max_replication_slots. I will make sure the GUC

Re: Refactoring postmaster's code to cleanup after child exit

2025-03-07 Thread Tomas Vondra
On 3/7/25 15:53, Andres Freund wrote: > Hi, > > On 2025-03-06 22:49:20 +0200, Heikki Linnakangas wrote: >> In short, all the 4 patches look good to me. Thanks for picking this up! >> >> On 06/03/2025 22:16, Andres Freund wrote: >>> On 2025-03-05 20:49:33 -0800, Noah Misch wrote: > This behavio

Re: making EXPLAIN extensible

2025-03-07 Thread Tom Lane
Robert Haas writes: > On Fri, Mar 7, 2025 at 9:38 AM Peter Eisentraut wrote: >> Also, benign typedef redefinitions are a C11 feature. In practice, all >> compilers currently in play support it, and the only problem you'll get >> is from the buildfarm members that are explicitly set up to warn ab

Re: pg_atomic_compare_exchange_*() and memory barriers

2025-03-07 Thread Andres Freund
Hi, On 2025-03-07 17:47:08 +0200, Alexander Korotkov wrote: > While investigating a bug in the patch to get rid of WALBufMappingLock, I > found that the surrounding pg_atomic_compare_exchange_u64() fixes the > problem for me. That sounds more likely to be due to slowing down things enough to make

Re: Add Postgres module info

2025-03-07 Thread Andrei Lepikhov
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 bug fixes. Also, use TAP tests instead of re

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Robert Haas
On Fri, Mar 7, 2025 at 9:37 AM Michael Banck wrote: > Also, I think there is case to be made that a cloud provider (or site > admin) would like to delegate the decision whether users with CREATE > rights on a particular database are allowed to install some extensions > or not. Or rather, assign so

Re: zstd failing on mipsel (PG 15.12, pg_verifybackup/t/010_client_untar.pl)

2025-03-07 Thread Christoph Berg
Re: To PostgreSQL Hackers > ... and the file is just fine. The blame is now on the kernel side for > any machine-level problems. (The kernel on the porter box where I > tried to reproduce the problem is much older than on the actual > buildds. A new version that hopefully fixes the problem is being

Re: Trigger more frequent autovacuums

2025-03-07 Thread wenhui qiu
Hi The more accurate data I've found is tabentry->live_tuples; provides the second version #Here's a simple test I did test=# select count(*) from join1; count - 2289001 (1 row) test=# update join1 set name=md5(now()::text) where id<100; UPDATE 1938700 test=# select 1938700/22

Re: Draft for basic NUMA observability

2025-03-07 Thread Jakub Wartak
On Fri, Mar 7, 2025 at 11:20 AM Jakub Wartak wrote: > > Hi, > On Wed, Mar 5, 2025 at 10:30 AM Jakub Wartak > wrote: > >Hi, > > > > Yeah, that's why I was mentioning to use a "shared" > > > populate_buffercache_entry() > > > or such function: to put the "duplicated" code in it and then use this >

Re: Add contrib/pg_logicalsnapinspect

2025-03-07 Thread Bertrand Drouvot
Hi, On Fri, Mar 07, 2025 at 10:26:23AM +0530, Amit Kapila wrote: > On Fri, Mar 7, 2025 at 3:19 AM Masahiko Sawada wrote: > > > > On Wed, Mar 5, 2025 at 4:05 AM Bertrand Drouvot > > wrote: > > > > > > Hi, > > > > > > On Wed, Mar 05, 2025 at 02:42:15PM +0530, Amit Kapila wrote: > > > > On Wed, Mar

Re: Commitfest app release on Feb 17 with many improvements

2025-03-07 Thread Jelte Fennema-Nio
On Fri, 7 Mar 2025 at 11:26, Andreas Karlsson wrote: > Out of curiosity: do you track which method works? I would expect > everything to be applied with either git am or patch which can be > applied with git apply making git apply technically unnecessary. I think we need all of them... - git appl

Re: Draft for basic NUMA observability

2025-03-07 Thread Jakub Wartak
Hi, On Wed, Mar 5, 2025 at 10:30 AM Jakub Wartak wrote: >Hi, > > Yeah, that's why I was mentioning to use a "shared" > > populate_buffercache_entry() > > or such function: to put the "duplicated" code in it and then use this > > shared function in pg_buffercache_pages() and in the new numa relat

Re: POC: make mxidoff 64 bits

2025-03-07 Thread Maxim Orlov
Here is a rebase, v14. -- Best regards, Maxim Orlov. From ee4b3b3c3ad3293460eb1f0418d87a065b9a589b Mon Sep 17 00:00:00 2001 From: Maxim Orlov Date: Wed, 4 May 2022 15:53:36 +0300 Subject: [PATCH v14 5/7] TEST: initdb option to initialize cluster with non-standard xid/mxid/mxoff To date testing

Re: speedup COPY TO for partitioned table.

2025-03-07 Thread jian he
hi. rebased and polished patch attached, test case added. However there is a case (the following) where ``COPY(partitioned_table)`` is much slower (around 25% in some cases) than ``COPY (select * from partitioned_table)``. If the partition attribute order is not the same as the partitioned table,

Re: PoC. The saving of the compiled jit-code in the plan cache

2025-03-07 Thread Vladlen Popolitov
Matheus Alcantara писал(а) 2025-03-07 05:02: Hi! Thank for interest to the patch. 1. Changes in jit-code generation. a) the load of the absolute address (as const) changed to the load of this address from a struct member: If I understood correctly, this change is required to avoid making

Re: Selectively invalidate caches in pgoutput module

2025-03-07 Thread Amit Kapila
On Fri, Mar 7, 2025 at 4:28 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Amit, > > Thanks for the comment! PSA new version. > Don't we need to call this invalidation function from InvalidateSystemCachesExtended()? -- With Regards, Amit Kapila.

Re: strange valgrind reports about wrapper_handler on 64-bit arm

2025-03-07 Thread Nathan Bossart
On Fri, Mar 07, 2025 at 11:32:28AM -0500, Andres Freund wrote: > Is it possible that the signal number we're getting called for is above > PG_NSIG? That'd explain why the source value is something fairly random? > > ISTM that we should add an Assert() to wrapper_handler() that ensures that the > s

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2025-03-07 Thread Andres Freund
Hi, On 2025-03-06 15:39:44 -0800, Jacob Champion wrote: > I've reattached the wait event patches, to get the cfbot back to where it was. FWIW, I continue to think that this is a misuse of wait events. We shouldn't use them as a poor man's general purpose tracing framework. Greetings, Andres Fre

Re: pg_atomic_compare_exchange_*() and memory barriers

2025-03-07 Thread Alexander Korotkov
Hi, Andres. Thank you for reply. On Fri, Mar 7, 2025 at 6:02 PM Andres Freund wrote: > > On 2025-03-07 17:47:08 +0200, Alexander Korotkov wrote: > > While investigating a bug in the patch to get rid of WALBufMappingLock, I > > found that the surrounding pg_atomic_compare_exchange_u64() fixes the

Re: strange valgrind reports about wrapper_handler on 64-bit arm

2025-03-07 Thread Andres Freund
Hi, On 2025-03-07 10:36:35 -0600, Nathan Bossart wrote: > On Fri, Mar 07, 2025 at 11:32:28AM -0500, Andres Freund wrote: > > Is it possible that the signal number we're getting called for is above > > PG_NSIG? That'd explain why the source value is something fairly random? > > > > ISTM that we sh

Re: Commitfest app release on Feb 17 with many improvements

2025-03-07 Thread Tom Lane
Jelte Fennema-Nio writes: > On Fri, 7 Mar 2025 at 11:26, Andreas Karlsson wrote: >> Out of curiosity: do you track which method works? I would expect >> everything to be applied with either git am or patch which can be >> applied with git apply making git apply technically unnecessary. > I think

Re: support virtual generated column not null constraint

2025-03-07 Thread Navneet Kumar
Hi I encountered an issue when trying to add a virtual column to an existing table using the ALTER command. The operation fails even though the existing data ensures that the virtual column's value will never be NULL. However, if I define the same virtual column while creating the table and then i

Re: strange valgrind reports about wrapper_handler on 64-bit arm

2025-03-07 Thread Nathan Bossart
On Fri, Mar 07, 2025 at 11:41:38AM -0500, Andres Freund wrote: > On 2025-03-07 10:36:35 -0600, Nathan Bossart wrote: >> On Fri, Mar 07, 2025 at 11:32:28AM -0500, Andres Freund wrote: >> > Is it possible that the signal number we're getting called for is above >> > PG_NSIG? That'd explain why the so

Re: Add column name to error description

2025-03-07 Thread jian he
On Fri, Mar 7, 2025 at 11:05 AM Tom Lane wrote: > > Erik Wienhold writes: > > But I don't see the point in keeping variables atttypid and atttypmod > > around when those values are now available via outatt. Removing these > > two variables makes the code easier to read IMO. Done so in the > > a

Re: Refactoring postmaster's code to cleanup after child exit

2025-03-07 Thread Andres Freund
Hi, On 2025-03-06 22:49:20 +0200, Heikki Linnakangas wrote: > In short, all the 4 patches look good to me. Thanks for picking this up! > > On 06/03/2025 22:16, Andres Freund wrote: > > On 2025-03-05 20:49:33 -0800, Noah Misch wrote: > > > > This behaviour makes it really hard to debug problems. I

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

2025-03-07 Thread Anthonin Bonnefoy
Hi, While running some tests with logical replication, I've run in a situation where a walsender process was stuck in an infinite loop with the following backtrace: #0 in MemoryContextDelete (...) at ../src/backend/utils/mmgr/mcxt.c:474 #1 in exec_replication_command (cmd_string=... "BEGIN") at

Re: making EXPLAIN extensible

2025-03-07 Thread Robert Haas
On Thu, Mar 6, 2025 at 4:24 PM Robert Haas wrote: > On Thu, Mar 6, 2025 at 4:16 PM Tom Lane wrote: > > I find a good deal of attraction in getting rid of the IDs and > > just using names. Nor do I believe we need a hash table. > > (1) Surely there will not be so many extensions using this within

Re: Get rid of WALBufMappingLock

2025-03-07 Thread Alexander Korotkov
On Sun, Mar 2, 2025 at 1:58 PM Alexander Korotkov wrote: > > On Fri, Feb 28, 2025 at 3:13 PM Álvaro Herrera > wrote: > > On 2025-Feb-28, Michael Paquier wrote: > > > > > Saying that, I have also done similar tests with your v12 for a couple > > > of hours and this looks stable under installcheck

Re: Log connection establishment timings

2025-03-07 Thread Bertrand Drouvot
Hi, On Thu, Mar 06, 2025 at 06:16:07PM -0500, Melanie Plageman wrote: > Attached v12 does this (uses timestamps instead of instr_time). Thanks for the new version! > I've done some assorted cleanup. Most notably: > > I removed LOG_CONNECTION_NONE because it could lead to wrong results > to have

Re: making EXPLAIN extensible

2025-03-07 Thread Robert Haas
On Fri, Mar 7, 2025 at 9:38 AM Peter Eisentraut wrote: > Just to clarify this: Nobody has gone through and used IWYU to clean up > indirect includes, as you appear to imagine here. My recent IWYU work > was, besides putting some infrastructure in place, to clean up includes > that are completely

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2025-03-07 Thread Jacob Champion
On Wed, Mar 5, 2025 at 8:08 PM Michael Paquier wrote: > Honestly, I don't see a reason not to introduce that, like in the > attached. This new code races against the session timeout. I see this on timer expiration: [14:19:55.224](0.000s) # issuing query 34 via background psql: SELECT state F

Re: what's going on with lapwing?

2025-03-07 Thread Greg Sabino Mullane
On Fri, Mar 7, 2025 at 8:52 AM Robert Haas wrote: > There is no "what we'd like them to do" -- we have no policy or preference > or anything as a group. Everybody's just guessing what other people want > and care about, and then sometimes we're all grumpy at each other. > This is a great point.

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Jelte Fennema-Nio
On Fri, 7 Mar 2025 at 15:37, Michael Banck wrote: > On Fri, Mar 07, 2025 at 09:17:46AM -0500, Robert Haas wrote: > > Why wouldn't the cloud provider just change add 'trusted = true' to > > the relevant control files instead of doing this? > > That would be possible, but maybe the cloud provider i

Re: ZStandard (with dictionaries) compression support for TOAST compression

2025-03-07 Thread Aleksander Alekseev
Hi Robert, > I think that solving the problems around using a dictionary is going > to be really hard. Can we see some evidence that the results will be > worth it? Compression dictionaries give a good compression ratio (~50%) and also increase TPS a bit (5-10%) due to better buffer cache utiliza

Re: Add contrib/pg_logicalsnapinspect

2025-03-07 Thread Amit Kapila
On Fri, Mar 7, 2025 at 4:12 PM Bertrand Drouvot wrote: > > On Fri, Mar 07, 2025 at 10:26:23AM +0530, Amit Kapila wrote: > > > Your proposed change in the test sounds better than what we have now > > but I think we should also avoid autovacuum to perform analyze as that > > may add additional count

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Dagfinn Ilmari Mannsåker
Laurenz Albe writes: > On Fri, 2025-02-28 at 19:16 +0100, Michael Banck wrote: >> New version 3 attached. > > I am fine with v3, and I'll mark it "ready for committer". > > I have been wondering about regression tests. > We cannot have them in the core tests, because we cannot rely on any > exten

pg_atomic_compare_exchange_*() and memory barriers

2025-03-07 Thread Alexander Korotkov
Hi all, While investigating a bug in the patch to get rid of WALBufMappingLock, I found that the surrounding pg_atomic_compare_exchange_u64() fixes the problem for me. That doesn't feel right because, according to the comments, both pg_atomic_compare_exchange_u32() and pg_atomic_compare_exchange_

Re: Trigger more frequent autovacuums

2025-03-07 Thread Melanie Plageman
On Fri, Mar 7, 2025 at 6:19 AM wenhui qiu wrote: > > Sorry ,A wrong version of debug pcnt_visibletuples ,kindly please check the > v3 attachment I looked at v3. I think I need more than the logging message to understand your goal here. Could you explain the algorithm and why you think it makes s

Re: Refactoring postmaster's code to cleanup after child exit

2025-03-07 Thread Andres Freund
Hi, On 2025-03-07 16:25:09 +0100, Tomas Vondra wrote: > FWIW I keep running into this (and skink seems unhappy too). I ended up > just adding a sleep(1), right before > > push(@sessions, background_psql_as_user('regress_superuser')); > > and that makes it work on all my machines (including rpi5)

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Jelte Fennema-Nio
On Fri, 7 Mar 2025 at 14:58, Robert Haas wrote: > I see that Jelte walked this comment back, but I think this issue > needs more discussion. I'm not intrinsically against having a role > like pg_execute_server_programs that allows escalation to superuser, > but I don't see how it would help a clou

RE: AIX support

2025-03-07 Thread Srirama Kucherlapati
Hi Team, Our team has identified couple of issues with the meson build on AIX, primarily focusing on the following areas: 1. Symbol extraction and resolution in object files during binary creation. 2. Dynamic runtime library path resolution in shared libraries. We have resolved them and we

Re: Add arbitrary xid and mxid to pg_resetwal

2025-03-07 Thread Aleksander Alekseev
Hi Daniil, Thanks for the patch. > main idea of this patch (for REL_17_STABLE) Your patch should target the `master` branch. Also please add a corresponding entry to the nearest open commitfest [1]. > In my opinion, this will be useful primarily to simplify testing, since at > the moment you h

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Laurenz Albe
On Fri, 2025-03-07 at 09:17 -0500, Robert Haas wrote: > On Fri, Mar 7, 2025 at 9:02 AM Jelte Fennema-Nio wrote: > > The reason why I walked back my comment was that cloud providers can > > simply choose which extensions they actually add to the image. If an > > extension is marked as not trusted b

Re: what's going on with lapwing?

2025-03-07 Thread Julien Rouhaud
On Fri, Mar 07, 2025 at 08:52:26AM -0500, Robert Haas wrote: > On Thu, Mar 6, 2025 at 7:03 PM Julien Rouhaud wrote: > > Honestly, it's been years of people complaining on one thing or another > > about > > lapwing without ever asking for a change. Was it really hard to ask "can > > you > > remo

Re: [PATCH] New predefined role pg_manage_extensions

2025-03-07 Thread Michael Banck
Hi, On Fri, Mar 07, 2025 at 09:17:46AM -0500, Robert Haas wrote: > Why wouldn't the cloud provider just change add 'trusted = true' to > the relevant control files instead of doing this? That would be possible, but maybe the cloud provider is using distribution packages and does not want to muck

Re: encode/decode support for base64url

2025-03-07 Thread Aleksander Alekseev
Hi, > > Sometimes support for base64url from RFC 4648 would be useful. > > Does anyone else need a patch like this? > > While not a frequent ask, it has been mentioned in the past. I think it would > make sense to add so please do submit a patch for it for consideration. IMO it would be nice to

Re: making EXPLAIN extensible

2025-03-07 Thread Peter Eisentraut
On 06.03.25 21:23, Robert Haas wrote: On Wed, Mar 5, 2025 at 4:38 PM Tom Lane wrote: v4 has addressed most of my nitpicks, but you still have typedefs for ExplainState in both header files. My bet is that at least one buildfarm animal will complain about that. I could be wrong though, maybe a

Re: Separate GUC for replication origins

2025-03-07 Thread Peter Eisentraut
On 07.03.25 04:51, Amit Kapila wrote: I agree that the originally proposed name max_replication_origins is not good, because you can "create" (using pg_replication_origin_create()) more than the configured maximum. What is the term for what the setting actually controls? How many are "active"?

Re: AIO v2.5

2025-03-07 Thread Jakub Wartak
On Thu, Mar 6, 2025 at 2:13 PM Andres Freund wrote: > On 2025-03-06 12:36:43 +0100, Jakub Wartak wrote: > > On Tue, Mar 4, 2025 at 8:00 PM Andres Freund wrote: > > > Questions: > > > > > > - My current thinking is that we'd set io_method = worker initially - so > > > we > > > actually get som

Re: Commitfest app release on Feb 17 with many improvements

2025-03-07 Thread Andreas Karlsson
On 3/7/25 12:48 AM, Jelte Fennema-Nio wrote: Okay, I went for the approach of just trying everything until one works. Starting with "git am", then patch(1), and as a final attempt "git apply". Patch 5272 applies correctly now. I've removed any backoff caused by repeated failures for all existing

  1   2   >