Re: Simplify VM counters in vacuum code

2025-06-24 Thread Nazir Bilal Yavuz
Hi, On Tue, 24 Jun 2025 at 18:12, Melanie Plageman wrote: > > On Tue, Jun 24, 2025 at 9:17 AM Melanie Plageman > wrote: > > > > On Tue, Jun 24, 2025 at 4:01 AM Nazir Bilal Yavuz > > wrote: > > > > > I think we do not need to check visibility of the page here, as we > > > already know that page

Re: Conflict detection for update_deleted in logical replication

2025-06-24 Thread shveta malik
> > Here is the V41 patch set which includes the following changes: > Thanks for the patches. Few trivial things: 1) In ReplicationSlotAcquire(), does it make more sense to move the error after checking the slot's existence first? If a user is trying to use a slot which does not exist, he should

Re: Logical Replication of sequences

2025-06-24 Thread Shlok Kyal
On Sun, 22 Jun 2025 at 08:05, vignesh C wrote: > > On Thu, 19 Jun 2025 at 11:26, Nisha Moond wrote: > > > > Hi, > > > > Here are my review comments for v20250610 patches: > > > > Patch-0005:sequencesync.c > > > > 1) report_error_sequences() > > > > In case there are both missing and mismatched se

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Bertrand Drouvot
Hi, On Tue, Jun 24, 2025 at 10:32:25PM +0200, Tomas Vondra wrote: > > Attached is a minor tweak of the valgrind suppresion rules, Thanks! > to add the > two places touching the memory. I was hoping I could add a single rule > for pg_numa_touch_mem_if_required, but that does not work - it's a >

Re: Logrep launcher race conditions leading to slow tests

2025-06-24 Thread Ashutosh Bapat
On Tue, Jun 24, 2025 at 5:26 AM Tom Lane wrote: > > I've been annoyed for awhile because, while a parallel check-world > run usually takes a bit over a minute on my machine, sometimes it > takes between three and four minutes. I was finally able to > track down what is happening, and it's this: s

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Andres Freund
Hi, On 2025-06-24 03:43:19 +0200, Tomas Vondra wrote: > FWIW while looking into this, I tried running this under valgrind (on a > regular 64-bit system, not in the chroot), and I get this report: > > ==65065== Invalid read of size 8 > ==65065==at 0x113B0EBE: pg_buffercache_numa_pages > (pg_bu

Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly

2025-06-24 Thread Dilip Kumar
On Wed, Jun 25, 2025 at 10:57 AM Zhijie Hou (Fujitsu) wrote: > > Hi, > > After commit ca307d5, I noticed another crash when testing > some other logical replication features. > > The server with max_replication_slots set to 0 would crash when executing > CHECKPOINT. > > TRAP: failed Assert("Repli

IPC/MultixactCreation on the Standby server

2025-06-24 Thread Dmitry
Hi, hackers The problem is as follows. A replication cluster includes a primary server and one hot-standby replica. The workload on the primary server is represented by multiple requests generating multixact IDs, while the hot-standby replica performs reading requests. After some time, all re

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Bertrand Drouvot
Hi, On Tue, Jun 24, 2025 at 05:30:02PM +0200, Christoph Berg wrote: > Re: Tomas Vondra > > If it's a reliable fix, then I guess we can do it like this. But won't > > that be a performance penalty on everyone? Or does the system split the > > array into 16-element chunks anyway, so this makes no di

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Bertrand Drouvot
Hi, On Tue, Jun 24, 2025 at 04:41:33PM +0200, Christoph Berg wrote: > Re: Bertrand Drouvot > > Yes, I think compat_uptr_t usage is missing in do_pages_stat() (while it's > > used > > in do_pages_move()). > > I was also reading the kernel source around that place but you spotted > the problem bef

Re: Logrep launcher race conditions leading to slow tests

2025-06-24 Thread Dilip Kumar
On Tue, Jun 24, 2025 at 9:53 PM Tom Lane wrote: > > Amit Kapila writes: > > On Tue, Jun 24, 2025 at 5:26 AM Tom Lane wrote: > >> 1. WaitForReplicationWorkerAttach sometimes has to clear a process > >> latch event so that it can keep waiting for the worker to launch. > >> It neglects to set the l

Re: SQL:2023 JSON simplified accessor support

2025-06-24 Thread jian he
hi. in src/backend/catalog/sql_features.txt should we mark any T860, T861, T862, T863, T864 items as YES? typedef struct SubscriptingRef { /* expressions that evaluate to upper container indexes */ List *refupperindexpr; } SubscriptingRef.refupperindexpr meaning changed, So the abo

Re: Safeguards against incorrect fd flags for fsync()

2025-06-24 Thread Michael Banck
Hi, On Wed, Jun 25, 2025 at 08:36:01AM +0900, Michael Paquier wrote: > On Tue, Jun 24, 2025 at 07:51:08AM +0200, Michael Banck wrote: > > I got it working, I had to rebuild gnumach with --enable-apic in order > > to get HPET. With that, the regular build-farm checks (check/ > > installcheck in con

Improve pg_sync_replication_slots() to wait for primary to advance

2025-06-24 Thread Ajin Cherian
Hello, Creating this thread for a POC based on discussions in thread [1]. Hou-san had created this patch, and I just cleaned up some documents, did some testing and now sharing the patch here. In this patch, the pg_sync_replication_slots() API now waits indefinitely for the remote slot to catch u

Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them

2025-06-24 Thread Peter Eisentraut
On 23.06.25 18:11, jian he wrote: seems we didn't check the ALTER TABLE case. CREATE TYPE double_int as (a int, b int); CREATE TABLE y (a int); alter table y add column b double_int GENERATED ALWAYS AS ((a * 2, a * 3)) VIRTUAL; in ATExecAddColumn, we can change it to: CheckAttributeType(Na

RE: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly

2025-06-24 Thread Zhijie Hou (Fujitsu)
Hi, After commit ca307d5, I noticed another crash when testing some other logical replication features. The server with max_replication_slots set to 0 would crash when executing CHECKPOINT. TRAP: failed Assert("ReplicationSlotCtl != NULL"), File: "slot.c", Line: 1162, PID: 577315 postgres: che

Re: queryId constant squashing does not support prepared statements

2025-06-24 Thread Michael Paquier
On Tue, Jun 24, 2025 at 07:45:15PM +0200, Alvaro Herrera wrote: > + /* > +* If we have an external param at this location, but no lists are > +* being squashed across the query, then we skip here; this will make > +* us print print the characters found in the original

Re: Logical Replication of sequences

2025-06-24 Thread shveta malik
On Tue, Jun 24, 2025 at 6:44 PM Shlok Kyal wrote: > > > 1. Initially, I have created a publication on sequence s1. > postgres=# CREATE PUBLICATION pub1 FOR ALL SEQUENCES; > CREATE PUBLICATION > postgres=# ALTER PUBLICATION pub1 SET TABLE t1; > ALTER PUBLICATION > postgres=# \d s1 >

Re: Logrep launcher race conditions leading to slow tests

2025-06-24 Thread Amit Kapila
On Tue, Jun 24, 2025 at 9:53 PM Tom Lane wrote: > > Amit Kapila writes: > > On Tue, Jun 24, 2025 at 5:26 AM Tom Lane wrote: > >> 1. WaitForReplicationWorkerAttach sometimes has to clear a process > >> latch event so that it can keep waiting for the worker to launch. > >> It neglects to set the l

Re: Logical Replication of sequences

2025-06-24 Thread Nisha Moond
On Tue, Jun 24, 2025 at 3:07 PM Nisha Moond wrote: > > On Sun, Jun 22, 2025 at 8:05 AM vignesh C wrote: > > > > Thanks for the comment, the attached v20250622 version patch has the > > changes for the same. > > > > Thanks for the patches, please find my review comments for patches 001 and > 002:

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-06-24 Thread shveta malik
On Wed, Jun 25, 2025 at 9:12 AM shveta malik wrote: > > On Tue, Jun 24, 2025 at 2:12 PM Bertrand Drouvot > wrote: > > > > Hi, > > > > On Tue, Jun 24, 2025 at 12:13:32AM +0900, Masahiko Sawada wrote: > > > On Mon, Jun 23, 2025 at 7:01 PM Bertrand Drouvot > > > wrote: > > > > > > > > Hi, > > > > >

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-06-24 Thread shveta malik
On Tue, Jun 24, 2025 at 2:12 PM Bertrand Drouvot wrote: > > Hi, > > On Tue, Jun 24, 2025 at 12:13:32AM +0900, Masahiko Sawada wrote: > > On Mon, Jun 23, 2025 at 7:01 PM Bertrand Drouvot > > wrote: > > > > > > Hi, > > > > > > On Mon, Jun 23, 2025 at 05:10:37PM +0900, Masahiko Sawada wrote: > > > >

Re: [WIP]Vertical Clustered Index (columnar store extension) - take2

2025-06-24 Thread Peter Smith
On Fri, Jun 20, 2025 at 4:09 AM Timur Magomedov wrote: > > Hello Peter! > > Thank you for working on VCI updates. > Here are some proposals for small improvements: Hi Timur, Thanks for your feedback! The newly posted v9-0002 addresses some of your comments. Details are below. > > Since hothash

Re: Logrep launcher race conditions leading to slow tests

2025-06-24 Thread Tom Lane
Ashutosh Bapat writes: > On Tue, Jun 24, 2025 at 5:26 AM Tom Lane wrote: >> 4. In process_syncing_tables_for_apply (the other caller of >> logicalrep_worker_launch), it seems okay to ignore the >> result of logicalrep_worker_launch, but I think it should >> fill hentry->last_start_time before not

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

2025-06-24 Thread Masahiko Sawada
On Tue, Jun 24, 2025 at 2:11 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Tue, 24 Jun 2025 11:59:17 +0900, > Masahiko Sawada wrote: > > >> 1. This provides 2 registration APIs > >>(RegisterCopy{From,To}Routine(nam

Re: Simplify VM counters in vacuum code

2025-06-24 Thread Melanie Plageman
Thanks for the review! On Tue, Jun 24, 2025 at 12:12 AM Masahiko Sawada wrote: > > On Tue, Jun 24, 2025 at 4:21 AM Melanie Plageman > wrote: > > The flags is initialized as: > > uint8 flags = VISIBILITYMAP_ALL_VISIBLE; > > so the new if-condition is always true. Yep, this was a mi

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-06-24 Thread Mahendra Singh Thalor
On Fri, 11 Apr 2025 at 20:17, Nathan Bossart wrote: > > On Thu, Apr 10, 2025 at 11:58:41PM +0530, Mahendra Singh Thalor wrote: > > As per above discussions, for v18, we will not do any change to server > > side to fix the issue of \n\r in database names. But as a cleanup > > patch, we can give an

Re: Logical Replication of sequences

2025-06-24 Thread Nisha Moond
On Sun, Jun 22, 2025 at 8:05 AM vignesh C wrote: > > Thanks for the comment, the attached v20250622 version patch has the > changes for the same. > Thanks for the patches, please find my review comments for patches 001 and 002: 1) patch-001 :pg_sequence_state() + /* open and lock sequence */ +

Re: Remove unneeded check for XLH_INSERT_ALL_FROZEN in heap_xlog_insert

2025-06-24 Thread Tomas Vondra
On 6/24/25 19:41, Melanie Plageman wrote: > Hi, > > I noticed that 8e03eb92e9a forgot one line when reverting 39b66a91bd. > There is an extraneous check for XLH_INSERT_ALL_FROZEN_SET in > heap_xlog_insert() -- even though heap_insert() never freezes tuples. > It doesn't hurt anything, but I found

Re: [PATCH] Fix hostaddr crash during non-blocking cancellation

2025-06-24 Thread Greg Sabino Mullane
01 looks sensible to me. I like 02 as well. Only quibble would be the name (tcp) as it doesn't really describe a class of things to be tested like the other things in PG_TEST_EXTRA. Something indicating a lack of socket? Just more verbose somehow? "tcp_only" perhaps? Cheers, Greg -- Crunchy Dat

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Jacob Champion
On Tue, Jun 24, 2025 at 1:27 AM Nazir Bilal Yavuz wrote: > I think this is a good idea. Another point is that CI images and their > packages are updated automatically, so it would be easier to catch if > something breaks when the VM is updated. Yes, that's a great point too. Okay, sounds like the

Re: problems with toast.* reloptions

2025-06-24 Thread Nathan Bossart
On Tue, Jun 24, 2025 at 02:10:55PM +0900, Michael Paquier wrote: > On Mon, Jun 23, 2025 at 03:59:56PM -0500, Nathan Bossart wrote: >> Here is a very rough proof-of-concept patch set for this. AFAICT there are >> a few options we cannot fix on the back-branches because there is no way to >> tell wh

Re: Fixes inconsistent behavior in vacuum when it processes multiple relations

2025-06-24 Thread Michael Paquier
On Tue, Jun 24, 2025 at 11:30:13AM -0500, Nathan Bossart wrote: > On Tue, Jun 24, 2025 at 10:18:18AM +0900, Michael Paquier wrote: > > Knowing that I'm indirectly responsible for this mess, I would like to > > take care of that myself. Would that be OK for you? > > I would be grateful if you took

Re: array_in sub function ReadArrayDimensions error message

2025-06-24 Thread David G. Johnston
On Tue, Jul 9, 2024 at 10:31 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > > That said, it isn’t making it back to us if our users are actually having > this confusion and would benefit meaningfully from such a hint. > > None of us ever put forth an actual patch for this so it seems

Re: Huge commitfest app update upcoming: Tags, Draft CF, Help page, and automated commitfest creat/open/close

2025-06-24 Thread David G. Johnston
On Mon, Jun 16, 2025 at 5:47 AM Jelte Fennema-Nio wrote: > The new PG19 development cycle is starting soon. So that seemed like a > good excuse to make some big improvements to the commitfest app. My > plan is to deploy these changes on the 30th of June. So that we can > start the new cycle fresh

Re: Safeguards against incorrect fd flags for fsync()

2025-06-24 Thread Michael Paquier
On Tue, Jun 24, 2025 at 07:51:08AM +0200, Michael Banck wrote: > I got it working, I had to rebuild gnumach with --enable-apic in order > to get HPET. With that, the regular build-farm checks (check/ > installcheck in contrib, src/test/regress and src/test/isolation) pass > without patches to tests

Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin

2025-06-24 Thread Melanie Plageman
On Mon, Jun 23, 2025 at 11:49 PM John Naylor wrote: > > On Tue, Jun 24, 2025 at 5:30 AM Melanie Plageman > wrote: > > Attached v3 has all of the above. I think the only thing that is > > needed to be changed for the backpatch to 17 is removing > > io_combine_limit. > > Looks good to me. Okay, pu

Re: Introduce New Command Processing Chapter to Documentation

2025-06-24 Thread David G. Johnston
On Tue, Mar 11, 2025 at 3:52 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > The attached patch implements the above. The WindowAgg code is just my > proposal from the other thread and wouldn't be part of the initial commit. > Just the mechanical refactoring bits. > > I've added this

Re: pg_dump --with-* options

2025-06-24 Thread Fujii Masao
On 2025/06/25 5:07, Robert Haas wrote: On Tue, Jun 24, 2025 at 12:48 PM Nathan Bossart wrote: On Mon, Jun 23, 2025 at 01:38:10PM -0400, Robert Haas wrote: I had thought we had a consensus that pg_upgrade should preserve stats but regularly pg_dump shouldn't include them; perhaps I misunders

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Tom Lane
Jacob Champion writes: > On Tue, Jun 24, 2025 at 2:50 PM Tom Lane wrote: >> Can't say that I find this to be impressive software engineering: >> rather than having only one probe failure mode to worry about, >> we have two, depending on whether the compiler knows __has_include(). >> Pretty close

Re: Periodic FSM vacuum doesn't happen in one-pass strategy vacuum.

2025-06-24 Thread Melanie Plageman
On Mon, Jun 9, 2025 at 6:22 PM Melanie Plageman wrote: > > Reviewing your patch, I think there might be an issue still. You > replaced has_lpdead_items with ndeleted. While ndeleted will count > those items we set LP_UNUSED (which is what we want), it also counts > LP_NORMAL items that vacuum sets

Re: pg_dump --with-* options

2025-06-24 Thread Nathan Bossart
On Mon, Jun 23, 2025 at 01:38:10PM -0400, Robert Haas wrote: > I had thought we had a consensus that pg_upgrade should preserve stats > but regularly pg_dump shouldn't include them; perhaps I misunderstood > or that changed. I think it's a bit of both. I skimmed through the past discussions and f

Re: Add \pset options for boolean value display

2025-06-24 Thread David G. Johnston
On Tue, Jun 24, 2025 at 3:30 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Thu, Mar 20, 2025 at 8:24 PM David G. Johnston < > > david.g.johns...@gmail.com> wrote: > >> It's \pset null for boolean values > > > v1, Ready aside from bike-shedding the name. > > Do we really want this? It'

Re: Add \pset options for boolean value display

2025-06-24 Thread Tom Lane
"David G. Johnston" writes: > On Thu, Mar 20, 2025 at 8:24 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: >> It's \pset null for boolean values > v1, Ready aside from bike-shedding the name. Do we really want this? It's the sort of thing that has a strong potential to break anythin

Re: pg_dump --with-* options

2025-06-24 Thread Robert Haas
On Tue, Jun 24, 2025 at 12:48 PM Nathan Bossart wrote: > On Mon, Jun 23, 2025 at 01:38:10PM -0400, Robert Haas wrote: > > I had thought we had a consensus that pg_upgrade should preserve stats > > but regularly pg_dump shouldn't include them; perhaps I misunderstood > > or that changed. > > I thin

Re: Add \pset options for boolean value display

2025-06-24 Thread David G. Johnston
On Thu, Mar 20, 2025 at 8:24 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > It's \pset null for boolean values > v1, Ready aside from bike-shedding the name. David J. From c897e53577d433c374e51619405a5c2b8bd4151c Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Wed, 18 Jun

Re: pg_dump --with-* options

2025-06-24 Thread Greg Sabino Mullane
On Wed, Jun 18, 2025 at 11:43 AM Nathan Bossart wrote: > IIUC the current proposal is to: > > * Dump/restore stats by default. > * Keep the --no-statistics, --no-schema, and --no-data options. > * Keep the --statistics-only, --schema-only, and --data-only options. > * Remove the --with-statistics

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Jacob Champion
On Tue, Jun 24, 2025 at 2:50 PM Tom Lane wrote: > Can't say that I find this to be impressive software engineering: > rather than having only one probe failure mode to worry about, > we have two, depending on whether the compiler knows __has_include(). > Pretty close to the worst of all possible w

Re: add function for creating/attaching hash table in DSM registry

2025-06-24 Thread Nathan Bossart
Here is what I have staged for commit. -- nathan >From e344a2757838e6b99168d4aa1093fee4da18d8a8 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 24 Jun 2025 16:32:00 -0500 Subject: [PATCH v11 1/1] Add GetNamedDSA() and GetNamedDSHash(). MIME-Version: 1.0 Content-Type: text/plain; charset

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Tom Lane
Jacob Champion writes: > On Tue, Jun 24, 2025 at 2:03 PM Tom Lane wrote: >> I confirm Jacob's result that our meson.build fails to think >> that is available, so we do need to do something. > (To clarify for other readers: it's the OAuth feature test I added > that fails. The existing test for

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Tom Lane
Peter Eisentraut writes: > Note that Autoconf uses a compilation test, not a preprocessor test, for > its AC_CHECK_HEADERS, so it uses .check_header() semantics. And this > was the result of a long transition, because the compile test was > ultimately deemed to be better. So in general, I wou

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Jacob Champion
On Tue, Jun 24, 2025 at 1:29 PM Peter Eisentraut wrote: > Note that Autoconf uses a compilation test, not a preprocessor test, for > its AC_CHECK_HEADERS, so it uses .check_header() semantics. And this > was the result of a long transition, because the compile test was > ultimately deemed to be b

Re: like pg_shmem_allocations, but fine-grained for DSM registry ?

2025-06-24 Thread Nathan Bossart
I think this will need some rework to deal with the addition of GetNamedDSA() and GetNamedDSHash() [0]. We probably want to add a "type" column to show whether the entry is for a DSM, DSA, or dshash table. And for DSAs and dshash tables, we probably want to use dsa_get_total_size() for the "size"

Re: Remove unneeded check for XLH_INSERT_ALL_FROZEN in heap_xlog_insert

2025-06-24 Thread Melanie Plageman
On Tue, Jun 24, 2025 at 1:53 PM Tomas Vondra wrote: > > Thanks for noticing this. I'd probably be +0.5 to backpatch this, even > if it's ultimately harmless, just to keep the code not confusing. Okay, I can backpatch this (to 14, I believe). I'll wait until the thread has been around for closer t

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Jacob Champion
On Mon, Jun 23, 2025 at 5:19 PM Tom Lane wrote: > As far as I recall, we've always thought that autoconf's approach > of "explicitly specify the features you expect to get" is the > right way to do things. I don't love meson's default you-get- > whatever-seems-available approach at all, though ma

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Tomas Vondra
On 6/24/25 17:30, Christoph Berg wrote: > Re: Tomas Vondra >> If it's a reliable fix, then I guess we can do it like this. But won't >> that be a performance penalty on everyone? Or does the system split the >> array into 16-element chunks anyway, so this makes no difference? > > There's still the

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Peter Eisentraut
On 24.06.25 01:36, Jacob Champion wrote: I noticed that the OpenBSD build in CI wasn't running the libcurl tests. Turns out the feature test I added in b0635bfda is subtly broken, because it uses cc.check_header() rather than cc.has_header(). On OpenBSD, apparently, the header can't be compiled

Re: regdatabase

2025-06-24 Thread Nathan Bossart
Here is what I have staged for commit. -- nathan >From 41168622a142ae40e43f9d71b8ed1e992fe4e4a2 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 24 Jun 2025 14:57:31 -0500 Subject: [PATCH v7 1/1] Add new OID alias type regdatabase. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-

Fix some inconsistencies with open-coded visibilitymap_set() callers

2025-06-24 Thread Melanie Plageman
Hi, visibilitymap_set() arguably breaks a few of the coding rules for modifying and WAL logging buffers set out in src/backend/access/transam/README. In 4 of visibilitymap_set()'s 5 non-recovery callers, we set PD_ALL_VISIBLE and mark the heap buffer dirty outside of the critical section in which

Re: Add Option To Check All Addresses For Matching target_session_attr

2025-06-24 Thread Navrotskiy Artem
Hi Andrey! I would like to add that from my point of view the current behavior directly contradicts the documentation (https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-MULTIPLE-HOSTS):When multiple hosts are specified, or when a single host name is translated to multiple addresses,

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

2025-06-24 Thread Masahiko Sawada
On Tue, Jun 24, 2025 at 4:10 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Tue, 24 Jun 2025 15:24:23 +0900, > Masahiko Sawada wrote: > > >> It's natural to add more related APIs with this > >> approach. The single regi

Allow ON CONFLICT DO UPDATE to return EXCLUDED values

2025-06-24 Thread Dean Rasheed
The attached patch allows EXCLUDED values to appear in the RETURNING list of INSERT ... ON CONFLICT DO UPDATE. For example: CREATE TABLE t (a int PRIMARY KEY, b text); INSERT INTO t VALUES (1, 'old value'); INSERT INTO t VALUES (1, 'excluded value') ON CONFLICT (a) DO UPDATE SET b = 'new value'

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Christoph Berg
Re: Bertrand Drouvot > Yes, something like: > > diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c > index c9ae3b45b76..070ad2f13e7 100644 > --- a/src/backend/storage/ipc/shmem.c > +++ b/src/backend/storage/ipc/shmem.c > @@ -689,8 +689,17 @@ pg_get_shmem_allocations_num

Remove unneeded check for XLH_INSERT_ALL_FROZEN in heap_xlog_insert

2025-06-24 Thread Melanie Plageman
Hi, I noticed that 8e03eb92e9a forgot one line when reverting 39b66a91bd. There is an extraneous check for XLH_INSERT_ALL_FROZEN_SET in heap_xlog_insert() -- even though heap_insert() never freezes tuples. It doesn't hurt anything, but I found it confusing, so I think it is worth removing. I don't

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Christoph Berg
Re: Bertrand Drouvot > Yes, I think compat_uptr_t usage is missing in do_pages_stat() (while it's > used > in do_pages_move()). I was also reading the kernel source around that place but you spotted the problem before me. This patch resolves the issue here: diff --git a/mm/migrate.c b/mm/migrate

Re: Logrep launcher race conditions leading to slow tests

2025-06-24 Thread Tom Lane
Amit Kapila writes: > On Tue, Jun 24, 2025 at 5:26 AM Tom Lane wrote: >> 1. WaitForReplicationWorkerAttach sometimes has to clear a process >> latch event so that it can keep waiting for the worker to launch. >> It neglects to set the latch again, allowing ApplyLauncherMain >> to miss events. >

Re: Fixes inconsistent behavior in vacuum when it processes multiple relations

2025-06-24 Thread Nathan Bossart
On Tue, Jun 24, 2025 at 10:18:18AM +0900, Michael Paquier wrote: > Knowing that I'm indirectly responsible for this mess, I would like to > take care of that myself. Would that be OK for you? I would be grateful if you took care of it. > Another approach that we could use is an injection point w

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Christoph Berg
Re: Tomas Vondra > If it's a reliable fix, then I guess we can do it like this. But won't > that be a performance penalty on everyone? Or does the system split the > array into 16-element chunks anyway, so this makes no difference? There's still the overhead of the syscall itself. But no idea how

Re: Improve the performance of Unicode Normalization Forms.

2025-06-24 Thread Alexander Borisov
20.06.2025 20:20, Jeff Davis wrote: On Fri, 2025-06-20 at 17:51 +0300, Alexander Borisov wrote: I don't quite see how this compares to the implementation on Rust. In the link provided, they use perfect hash, which I get rid of and get a x2 boost. If you take ICU implementations in C++, I have al

Re: BackendKeyData is mandatory?

2025-06-24 Thread Tom Lane
Jacob Champion writes: > So that's > 1) return an (empty) cancellation object even if the server has not > sent a key, and > 2) error out when trying to cancel with an empty object? > That sounds reasonable to me. +1. > Are there any reading along who want us to continue sending an > all-zeroes

Re: Simplify VM counters in vacuum code

2025-06-24 Thread Melanie Plageman
On Tue, Jun 24, 2025 at 9:17 AM Melanie Plageman wrote: > > On Tue, Jun 24, 2025 at 4:01 AM Nazir Bilal Yavuz wrote: > > > I think we do not need to check visibility of the page here, as we > > already know that page was not all-visible due to LP_DEAD items. We > > can simply increment the vacrel

Re: BackendKeyData is mandatory?

2025-06-24 Thread Jelte Fennema-Nio
On Tue, 24 Jun 2025 at 17:07, Jacob Champion wrote: > So that's > 1) return an (empty) cancellation object even if the server has not > sent a key, and > 2) error out when trying to cancel with an empty object? Yes (and empty being non-NULL obviously) > That sounds reasonable to me. Alright, le

Re: BackendKeyData is mandatory?

2025-06-24 Thread Jacob Champion
On Tue, Jun 24, 2025 at 1:36 AM Jelte Fennema-Nio wrote: > Okay, that sounds widely used enough to continue that we should > probably change the new PG18 behaviour of PQgetCancel and > PQcancelCreate like I suggested. Failing all psycopg2 connection > attempts against AWS its proxy service doesn't

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Tomas Vondra
On 6/24/25 16:41, Christoph Berg wrote: > Re: Bertrand Drouvot >> Yes, I think compat_uptr_t usage is missing in do_pages_stat() (while it's >> used >> in do_pages_move()). > > I was also reading the kernel source around that place but you spotted > the problem before me. This patch resolves the

Re: Safeguards against incorrect fd flags for fsync()

2025-06-24 Thread Tom Lane
Michael Banck writes: > Is removing the debug_parallel_query=on configuration for HEAD a valid > mode of operation for a buildfarm animal? I ran the tests 10 times in a > row without issues today. Sure, especially on slower machines. It's pretty much owner's option whether to use that.

Re: SQL:2023 JSON simplified accessor support

2025-06-24 Thread jian he
hi. I have applied for 0001 to 0006. static void jsonb_subscript_transform(SubscriptingRef *sbsref, List **indirection, ParseState *pstate, bool isSlice, bool isAssignment) { List *up

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Bertrand Drouvot
Hi, On Tue, Jun 24, 2025 at 02:33:59PM +0200, Tomas Vondra wrote: > > > On 6/24/25 13:10, Bertrand Drouvot wrote: > > So, if we look at do_pages_stat() ([1]), we can see that it uses an > > hardcoded > > "#define DO_PAGES_STAT_CHUNK_NR 16UL" and that this pointers arithmetic: > > > > " > >

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Tomas Vondra
On 6/24/25 13:10, Andres Freund wrote: > Hi, > > On 2025-06-24 03:43:19 +0200, Tomas Vondra wrote: >> FWIW while looking into this, I tried running this under valgrind (on a >> regular 64-bit system, not in the chroot), and I get this report: >> >> ==65065== Invalid read of size 8 >> ==65065==

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Tomas Vondra
On 6/24/25 13:10, Bertrand Drouvot wrote: > Hi, > > On Tue, Jun 24, 2025 at 11:20:15AM +0200, Tomas Vondra wrote: >> On 6/24/25 10:24, Bertrand Drouvot wrote: >>> Yeah, same for me with pg_get_shmem_allocations_numa(). It works if >>> pg_numa_query_pages() is done on chunks <= 16 pages but fail

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-24 Thread Bertrand Drouvot
Hi, On Tue, Jun 24, 2025 at 11:20:15AM +0200, Tomas Vondra wrote: > On 6/24/25 10:24, Bertrand Drouvot wrote: > > Yeah, same for me with pg_get_shmem_allocations_numa(). It works if > > pg_numa_query_pages() is done on chunks <= 16 pages but fails if done on > > more > > than 16 pages. > > > > I

Re: Improve doc on parallel stream changes for Stream Abort message

2025-06-24 Thread Amit Kapila
On Tue, Jun 24, 2025 at 11:58 AM Anthonin Bonnefoy wrote: > > On Tue, Jun 24, 2025 at 7:26 AM Amit Kapila wrote: > > How about a slightly modified version like: (a) The LSN of the abort > > operation, present only when the change stream can be applied in > > parallel. This field is available sinc

Re: split func.sgml to separated individual sgml files

2025-06-24 Thread jian he
On Thu, Mar 20, 2025 at 10:16 AM David G. Johnston wrote: > > In short, ready to commit (see last paragraph below however), but the > committer will need to run the python script at the time of commit on the > then-current tree. > hi. more explanation, since the python script seems quite large.

Re: Improve doc on parallel stream changes for Stream Abort message

2025-06-24 Thread Amit Kapila
On Mon, Jun 23, 2025 at 2:10 PM Anthonin Bonnefoy wrote: > > While adding parsing of logical replication to Wireshark[1], I've > found the Stream Abort description possibly misleading. Stream Abort > will have the Abort LSN and TS when parallel streaming is enabled. > However, the documentation on

Hooks or another better way to track session objects

2025-06-24 Thread Roman Khapov
Hi all! I am working on a new type of pooling mechanism for Postgresconnection managers. In this mode, the client connection isdetached from server between transactions only if no temporaryobjects were created in that session(temporary tables, prepared statements, and advisory locks). Currently, I

Re: Logical Replication of sequences

2025-06-24 Thread shveta malik
> > Thanks for the comment, the attached v20250622 version patch has the > changes for the same. > Thanks for the patches, I am not done with review yet, but please find the feedback so far: 1) + if (!OidIsValid(seq_relid)) + ereport(ERROR, + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), +

Re: Improve doc on parallel stream changes for Stream Abort message

2025-06-24 Thread Anthonin Bonnefoy
On Tue, Jun 24, 2025 at 7:26 AM Amit Kapila wrote: > How about a slightly modified version like: (a) The LSN of the abort > operation, present only when the change stream can be applied in > parallel. This field is available since protocol version 4. (b) Abort > timestamp of the transaction, prese

Re: Things I don't like about \du's "Attributes" column

2025-06-24 Thread Pavel Luzanov
On 11.04.2025 20:09, David G. Johnston wrote: However, I do think we are at something committable, though I'd make one, maybe two, changes to v8. Let's return to this topic. Valid until -> Password valid until: the timestamp value already forces a wide column, adding the word Password to the

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-06-24 Thread Bertrand Drouvot
Hi, On Tue, Jun 24, 2025 at 12:13:32AM +0900, Masahiko Sawada wrote: > On Mon, Jun 23, 2025 at 7:01 PM Bertrand Drouvot > wrote: > > > > Hi, > > > > On Mon, Jun 23, 2025 at 05:10:37PM +0900, Masahiko Sawada wrote: > > > On Thu, Jun 19, 2025 at 6:00 PM Bertrand Drouvot > > > wrote: > > > > > > >

Re: BackendKeyData is mandatory?

2025-06-24 Thread Jelte Fennema-Nio
On Tue, 24 Jun 2025 at 01:44, Tatsuo Ishii wrote: > One example is Amazon RDS Proxy. Okay, that sounds widely used enough to continue that we should probably change the new PG18 behaviour of PQgetCancel and PQcancelCreate like I suggested. Failing all psycopg2 connection attempts against AWS its

Re: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-24 Thread Nazir Bilal Yavuz
Hi, On Tue, 24 Jun 2025 at 02:37, Jacob Champion wrote: > As a potential follow-up, is there any interest in switching the > Cirrus Meson setup to explicitly enable the features that we expect to > test? That would match what we do for Autoconf, I think; it would have > helped me catch my mistake

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-06-24 Thread jian he
hi. + /* Sort array of lower bounds. */ + qsort_arg(lower_bounds, nparts, sizeof(PartitionRangeBound *), + qsort_partition_rbound_cmp, (void *) key); here, we don't need ``(void *)`` +ALTER TABLE [ IF EXISTS ] name +MERGE PARTITIONS (partition_name1, partition_name2 [, ...]) +INTO p

Re: Allow to collect statistics on virtual generated columns

2025-06-24 Thread Yugo Nagata
On Tue, 17 Jun 2025 10:43:41 -0400 Andres Freund wrote: > Hi, > > On 2025-04-22 18:10:06 +0900, Yugo Nagata wrote: > > With your feedback, I would like to progress or rework the patch. > > Right now the tests seem to always fail: > https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F5

Re: Safeguards against incorrect fd flags for fsync()

2025-06-24 Thread Michael Banck
Hi, another update: On Wed, Jun 11, 2025 at 09:24:24PM +0200, Michael Banck wrote: > So it seems the low-resolution timer is the only functional issue right > now. I upgraded my VM to current Debian unstable, but unfortunately that > did not increase the timer resolution is hoped, maybe some more

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

2025-06-24 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Tue, 24 Jun 2025 15:24:23 +0900, Masahiko Sawada wrote: >> It's natural to add more related APIs with this >> approach. The single registration API provides one feature >> by one operation. If we use the Re