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

2025-06-25 Thread Peter Eisentraut
On 24.06.25 22:39, Jacob Champion wrote: 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 compil

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-06-25 Thread Tatsuo Ishii
> BTW I am still not satisfied by the performance improvement for window > functions for frames, that was only 40%. I will study the code to look > for more optimization. So I come up with more optimization for window functions working on frames (i.e. first_value, last_value and nth_value). Attach

Proposal: Native High Availability and Automatic Failover in PostgreSQL

2025-06-25 Thread Ale Rox
Dear all, I've been using PostgreSQL for a long time and consider it a solid and reliable database. However, I believe there is room for improvement in the area of high availability and automatic failover, inspired by features already available in MongoDB. Specifically, it would be extremely usef

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Jakub Wartak
On Tue, Jun 24, 2025 at 5:30 PM 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? >

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

2025-06-25 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Wed, 25 Jun 2025 00:48:46 +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 u

display hot standby state in psql prompt

2025-06-25 Thread Jim Jones
Hi, Some weeks ago we briefly discussed in the discord channel the possibility of introducing a psql prompt display option to identify if the connected database is in hot standby mode, which can be useful when using multiple hosts in the connection string. Right now, it's using the in_hot_standby

Re: BackendKeyData is mandatory?

2025-06-25 Thread Jelte Fennema-Nio
On Tue Jun 24, 2025 at 5:07 PM CEST, 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? That sounds reasonable to me. Attached is an attempt at implementing the above. I di

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

2025-06-25 Thread Dilip Kumar
On Wed, Jun 25, 2025 at 1:18 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Dilip, > > Another idea is to call ReplicationSlotsComputeRequiredLSN() when at least one > of the restart_lsn is updated, like attached. I feel this could reduce the > computation > bit more. Right, that makes sense, if the

Re: Issue with custom operator in simple case

2025-06-25 Thread Maxim Orlov
On Mon, 23 Jun 2025 at 19:28, Tom Lane wrote: > Maxim Orlov writes: > > 1) Can this behaviour, in the case described above, when after dump and > > recovery we receive different data, be considered correct? > > It's undesirable, for sure. > > > 4) Does it make sense to extend the "simple case" g

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Tomas Vondra
On 6/25/25 11:00, Christoph Berg wrote: > Re: Bertrand Drouvot >> +/* >> + * Work around Linux kernel bug in 32-bit compat mode: do_pages_stat() has >> + * incorrect pointer arithmetic for more than DO_PAGES_STAT_CHUNK_NR pages. >> + */ >> +#if SIZEOF_SIZE_T == 4 > > I was also missing it in my su

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Tomas Vondra
On 6/25/25 09:15, Jakub Wartak wrote: > On Tue, Jun 24, 2025 at 5:30 PM 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 chun

Re: SCRAM pass-through authentication for postgres_fdw

2025-06-25 Thread Alexander Pyhalov
Matheus Alcantara писал(а) 2025-01-16 16:07: Em qua., 15 de jan. de 2025 às 14:03, Peter Eisentraut escreveu: On 14.01.25 15:14, Matheus Alcantara wrote: >> Attached is a fixup patch where I have tried to expand the documentation >> a bit in an attempt to clarify how to use this. Maybe check

Re: Logical Replication of sequences

2025-06-25 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: IPC/MultixactCreation on the Standby server

2025-06-25 Thread Andrey Borodin
> On 25 Jun 2025, at 11:11, Dmitry wrote: > > #6 GetMultiXactIdMembers (multi=45559845, members=0x7ffdaedc84b0, > from_pgupgrade=, isLockOnly=) > at > /usr/src/postgresql-17-17.5-1.pgdg24.04+1/build/../src/backend/access/transam/multixact.c:1483 Hi Dmitry! This looks to be rela

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Fujii Masao
On 2025/06/19 11:38, jian he wrote: On Wed, Jun 18, 2025 at 11:05 PM Álvaro Herrera wrote: I agree that this is roughly the right approach, but I think you're doing it harder than it needs to be -- it might be easier to add a JOIN to pg_description to the big query in getTableAttrs(), and a

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Fujii Masao
On 2025/06/19 20:53, Fujii Masao wrote: On 2025/06/19 14:42, jian he wrote: On Wed, Jun 18, 2025 at 10:21 AM Fujii Masao wrote: I ran into another issue related to comments on NOT NULL constraints. When using CREATE TABLE ... (LIKE ... INCLUDING ALL), the NOT NULL constraints are copied,

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

2025-06-25 Thread Nazir Bilal Yavuz
Hi, On Tue, 24 Jun 2025 at 23:46, Jacob Champion wrote: > > 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

Re: Proposal: Native High Availability and Automatic Failover in PostgreSQL

2025-06-25 Thread wenhui qiu
HI Ale Rox I've been thinking like you for a long time, But it's not so easy to realise this, there are more oppositions than approvals,You can search for this title (Re: Built-in Raft replication) On Wed, Jun 25, 2025 at 3:26 PM Ale Rox wrote: > Dear all, > > I've been using PostgreSQL for a

Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions

2025-06-25 Thread Michael Paquier
On Wed, Jun 25, 2025 at 07:47:27AM +, Andy Fan wrote: > When I am reading the code, I first thought I can do something in > HeapTupleheaderSetXminCommitted, then I realized we have SetHintBits. > After some research, I find HeapTupleHeaderSetXminCommitted is never > used and it looks not safe t

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Álvaro Herrera
On 2025-Jun-25, Álvaro Herrera wrote: > Yeah, I think in this case we need to extract the constraint name so > that we have it available to print the COMMENT command, rather than > making any assumptions about it. In fact I suspect this would fail if > the table or column names are very long. Fo

Re: Adding OLD/NEW support to RETURNING

2025-06-25 Thread Dean Rasheed
On Thu, 16 Jan 2025 at 15:28, Dean Rasheed wrote: > > I went over this again in detail and didn't find any problems, so I > have committed it. Thanks for all the review comments. > Looking at the doc pages for UPDATE and MERGE, I realise that I missed a paragraph in the "Description" section that

Re: No error checking when reading from file using zstd in pg_dump

2025-06-25 Thread Daniel Gustafsson
> On 16 Jun 2025, at 22:49, Tom Lane wrote: > > Tomas Vondra writes: >> For a moment I was worried about breaking ABI when fixing this in the >> backbranches, but I guess that's not an issue for tools like pg_dump. > > Yeah, I think it'd be okay to change compress_io.h APIs in the back > branch

Re: pg_dump --with-* options

2025-06-25 Thread Nathan Bossart
On Tue, Jun 24, 2025 at 06:14:55PM -0400, Greg Sabino Mullane wrote: > 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-o

Remove HeapTupleheaderSetXmin{Committed,Invalid} functions

2025-06-25 Thread Andy Fan
Hi, When I am reading the code, I first thought I can do something in HeapTupleheaderSetXminCommitted, then I realized we have SetHintBits. After some research, I find HeapTupleHeaderSetXminCommitted is never used and it looks not safe to use after comparing with SetHintBits. So to avoid future c

Re: Logrep launcher race conditions leading to slow tests

2025-06-25 Thread Ashutosh Bapat
On Tue, Jun 24, 2025 at 9:53 PM Tom Lane wrote: > > BTW, it strikes me that if we're going to leave > process_syncing_tables_for_apply() ignoring the result of > logicalrep_worker_launch, it'd be smart to insert an explicit > (void) cast to show that that's intentional. Otherwise Coverity > is li

Re: SCRAM pass-through authentication for postgres_fdw

2025-06-25 Thread Matheus Alcantara
Hi, thanks for testing and reporting the issue! On 25/06/25 11:37, Alexander Pyhalov wrote: > Hi. > I've started to look at this feature and found an issue - MyProcPort > can be not set if connection is initiated > by some bgworker. (Internally we use one for statistics collection.) > In other pla

Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions

2025-06-25 Thread Andy Fan
Michael Paquier writes: > On Wed, Jun 25, 2025 at 07:47:27AM +, Andy Fan wrote: >> When I am reading the code, I first thought I can do something in >> HeapTupleheaderSetXminCommitted, then I realized we have SetHintBits. >> After some research, I find HeapTupleHeaderSetXminCommitted is never

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Álvaro Herrera
On 2025-Jun-25, Tomas Vondra wrote: > Not sure. I thought NUMA doesn't matter very much on 32-bit systems too, > exactly because those systems tend to use small amounts of memory. But > then while investigating this issue I realized even rpi5 has NUMA, in > fact it has a whopping 8 nodes: > > deb

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Tomas Vondra
On 6/25/25 14:42, Álvaro Herrera wrote: > On 2025-Jun-25, Tomas Vondra wrote: > >> Not sure. I thought NUMA doesn't matter very much on 32-bit systems too, >> exactly because those systems tend to use small amounts of memory. But >> then while investigating this issue I realized even rpi5 has NU

Re: Logical Replication of sequences

2025-06-25 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: Fixes inconsistent behavior in vacuum when it processes multiple relations

2025-06-25 Thread shihao zhong
> Attached is the remaining patch for HEAD, planned once v19 opens, and > the tests I have used on the back-branches as a txt to not confuse the > CI, for reference. Just want to make sure, are we not going to include my original test to catch the future regression? Also, could someone please let

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Álvaro Herrera
On 2025-Jun-25, Fujii Masao wrote: > From 516e647e7d1fdafc64dba092389963f32cd688e5 Mon Sep 17 00:00:00 2001 > From: Fujii Masao > Date: Wed, 25 Jun 2025 10:02:56 +0900 > Subject: [PATCH v2] Make CREATE TABLE LIKE copy comments on NOT NULL > constraints when requested. > > Commit 14e87ffa5c5 int

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Álvaro Herrera
On 2025-Jun-25, Fujii Masao wrote: > > however, in determineNotNullFlags we have: > > > > char *default_name; > > /* XXX should match ChooseConstraintName better */ > > default_name = psprintf("%s_%s_not_null", > > tbinfo->dobj.name, > >

Re: Read-Write optimistic lock (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-06-25 Thread Sergey Shinderuk
On 16.06.2025 17:41, Andres Freund wrote: TBH, I don't see a point in continuing with this thread without something that others can test. I rather doubt that the right fix here is to just change the lock model over, but without a repro I can't evaluate that. Hello, I think I can reproduce th

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

2025-06-25 Thread Hayato Kuroda (Fujitsu)
Dear Dilip, Another idea is to call ReplicationSlotsComputeRequiredLSN() when at least one of the restart_lsn is updated, like attached. I feel this could reduce the computation bit more. Best regards, Hayato Kuroda FUJITSU LIMITED tmp.diffs Description: tmp.diffs

Re: IPC/MultixactCreation on the Standby server

2025-06-25 Thread Dmitry
On 25.06.2025 12:34, Andrey Borodin wrote: On 25 Jun 2025, at 11:11, Dmitry wrote: #6 GetMultiXactIdMembers (multi=45559845, members=0x7ffdaedc84b0, from_pgupgrade=, isLockOnly=) at /usr/src/postgresql-17-17.5-1.pgdg24.04+1/build/../src/backend/access/transam/multixact.c:1483

Re: doc pg_constraint.convalidated column description need update

2025-06-25 Thread Peter Eisentraut
On 09.06.25 16:32, Robert Treat wrote: On Mon, Jun 9, 2025 at 12:00 AM jian he wrote: On Thu, Jun 5, 2025 at 4:47 AM Robert Treat wrote: I think some of those changes are worth a second stab, so here is an updated patch which removes the ancillary tagging and corresponding line wrappings an

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

2025-06-25 Thread Dean Rasheed
On Mon, 12 May 2025 at 19:33, Andreas Karlsson wrote: > > I have fixed that one and some other issues locally and will submit a > new version in a while after I have added more tests because you are > very correct in that a big issue with my last version of the patch was > the big lack of tests an

Re: MERGE docs: indentation in synopsis section

2025-06-25 Thread Nathan Bossart
On Wed, Jun 25, 2025 at 03:12:43PM +0100, Dean Rasheed wrote: > Looking at the docs for MERGE, I realised that the "Synopsis" is not > indented consistently with other pages -- the convention on almost > every other page seems to be to indent continuation lines and options > by 4 spaces. So I think

DOCS: ALTER PUBLICATION - Synopsis for DROP is a bit misleading

2025-06-25 Thread Peter Smith
I noticed that the ALTER PUBLICATION synopsis is misleading for the DROP part. CURRENTLY [1] -- ALTER PUBLICATION name ADD publication_object [, ...] ALTER PUBLICATION name SET publication_object [, ...] ALTER PUBLICATION name DROP publication_object [, ...] ... where publication_object i

Optimize LWLock scalability via ReadBiasedLWLock for heavily-shared locks

2025-06-25 Thread Zhou, Zhiguo
Hi Hackers, This patch addresses severe LWLock contention observed on high-core systems where hundreds of processors concurrently access frequently-shared locks. Specifically for ProcArrayLock (exhibiting 93.5% shared-mode acquires), we implement a new ReadBiasedLWLock mechanism to eliminate the

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Bertrand Drouvot
Hi, On Wed, Jun 25, 2025 at 11:00:38AM +0200, Christoph Berg wrote: > Re: Bertrand Drouvot > > +/* > > + * Work around Linux kernel bug in 32-bit compat mode: do_pages_stat() has > > + * incorrect pointer arithmetic for more than DO_PAGES_STAT_CHUNK_NR pages. > > + */ > > +#if SIZEOF_SIZE_T == 4 >

Re: Extend COPY FROM with HEADER to skip multiple lines

2025-06-25 Thread Shinya Kato
> > So it seems better for you to implement the patch at first and then > > check the performance overhead etc if necessary. > > Thank you for your advice. I will create a patch. I created a patch. As you can see from the patch, I believe the performance impact is negligible. The only changes wer

Re: Removing unneeded self joins

2025-06-25 Thread Michael Paquier
On Sat, Apr 26, 2025 at 11:05:27PM +0300, Alexander Korotkov wrote: >> I did some improvements to PHVs patch: revised comments and commit >> message. I'm going to push it if no objections. > > Uh, v2 was there already. That should be v3. I was doing some work on pg_hint_plan, evaluating the amo

Re: [PATCH] Proposal: Improvements to PDF stylesheet and table column widths

2025-06-25 Thread Tatsuo Ishii
Dear Saito-san, >> Dear Ishii-san, >> >>> I wonder how your patches apply to non A4 format (letter). Can you >>> please share the PDF file in letter format after patching? >> >> I had not mentioned the US letter format before, but the patch also >> affects the US letter version. >> I attach a P

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Bertrand Drouvot
Hi, On Tue, Jun 24, 2025 at 10:32:25PM +0200, Tomas Vondra wrote: > 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

RE: Conflict detection for update_deleted in logical replication

2025-06-25 Thread Zhijie Hou (Fujitsu)
On Wed, Jun 25, 2025 at 2:57 PM shveta malik wrote: > > > > > 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

Re: Adding OLD/NEW support to RETURNING

2025-06-25 Thread Robert Treat
On Wed, Jun 25, 2025 at 7:42 AM Dean Rasheed wrote: > > On Thu, 16 Jan 2025 at 15:28, Dean Rasheed wrote: > > > > I went over this again in detail and didn't find any problems, so I > > have committed it. Thanks for all the review comments. > > > > Looking at the doc pages for UPDATE and MERGE, I

Re: Unnecessary scan from non-overlapping range predicates

2025-06-25 Thread Ajit Awekar
Hi Tom, Thanks a lot for sharing. The GUC constraint_exclusion setting is helpful, especially for handling poorly written queries. Thanks & Best Regards, Ajit On Wed, 25 Jun 2025 at 21:58, Tom Lane wrote: > Ajit Awekar writes: > > EXPLAIN (costs off) > > select * from products where price <

Re: pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages

2025-06-25 Thread Michael Paquier
On Wed, Jun 25, 2025 at 10:19:55PM +0530, vignesh C wrote: > Currently, the logic attempts to read the complete WAL record based on > the size obtained before the crash—even though only a partial record > was written. It then checks the page header to determine whether the > XLP_FIRST_IS_OVERWRITE_

Re: display hot standby state in psql prompt

2025-06-25 Thread Greg Sabino Mullane
On Wed, Jun 25, 2025 at 11:50 AM Jim Jones wrote: > Since I cannot get the value of transaction_read_only via > PQparameterStatus. Hmmm... we can at least get default_transaction_read_only. As fe-connect.c points out: /* * "transaction_read_only = on" pr

RE: Suggestion to add --continue-client-on-abort option to pgbench

2025-06-25 Thread Hayato Kuroda (Fujitsu)
Dear Nagata-san, > As I understand it, the current patch aims to allow continuation only after > SQL-level > errors, such as constraint violations. That seems reasonable, as it can > simulate > the > behavior of applications that ignore or retry such errors (even though > retries are > not > imp

RE: [PATCH] Proposal: Improvements to PDF stylesheet and table column widths

2025-06-25 Thread Hayato Kuroda (Fujitsu)
Dear Ishii-san, Actually Saito-san has already been registered [1]. And cfbot said OK. [1]: https://commitfest.postgresql.org/patch/5775/ Best regards, Hayato Kuroda FUJITSU LIMITED

Re: pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages

2025-06-25 Thread Michael Paquier
On Thu, Jun 26, 2025 at 08:48:32AM +0530, Dilip Kumar wrote: > On Thu, Jun 26, 2025 at 6:22 AM Michael Paquier wrote: >> So you are suggesting the addition of an extra ReadPageInternal() that >> forces a read of only the read, perform the checks on the header, then >> read the rest. After reading

Re: Decompression bug in astreamer_lz4

2025-06-25 Thread Michael Paquier
On Wed, Jun 25, 2025 at 11:07:32PM +0300, Mikhail Gribkov wrote: > The same situation can be reproduced using randomly filled files. Let’s > imagine the extension saves its own statistics in pg_stat: > dd if=/dev/urandom of=$PGDATA/pg_stat/junk bs=1M count=16 Original, I like that. It's not hard

Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions

2025-06-25 Thread Andy Fan
Nathan Bossart writes: > On Wed, Jun 25, 2025 at 09:28:50AM +, Andy Fan wrote: >> Michael Paquier writes: >>> On Wed, Jun 25, 2025 at 07:47:27AM +, Andy Fan wrote: When I am reading the code, I first thought I can do something in HeapTupleheaderSetXminCommitted, then I realized

Re: speedup COPY TO for partitioned table.

2025-06-25 Thread torikoshia
On 2025-06-05 09:45, jian he wrote: hi. In the V10 patch, there will be some regression if the partition column ordering is different from the root partitioned table. because in V10 CopyThisRelTo + while (table_scan_getnextslot(scandesc, ForwardScanDirection, slot)) + { + if (map != NULL) + { +

Re: Inefficient nbtree behavior with row-comparison quals

2025-06-25 Thread Peter Geoghegan
On Sat, May 11, 2024 at 3:19 PM Tom Lane wrote: > showing that we are reading practically the whole index, which > is pretty sad considering the index conditions are visibly > mutually contradictory. What's going on? I find that: > > 1. _bt_preprocess_keys, which is responsible for detecting > m

RE: pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages

2025-06-25 Thread Hayato Kuroda (Fujitsu)
Dear Michael, Vignesh, > On Wed, Jun 25, 2025 at 10:19:55PM +0530, vignesh C wrote: > > Currently, the logic attempts to read the complete WAL record based on > > the size obtained before the crash—even though only a partial record > > was written. It then checks the page header to determine wheth

Re: Skipping schema changes in publication

2025-06-25 Thread Peter Smith
Hi Shlok. Below are some review comments for v14-0003 == 1. GENERAL Since the new syntax uses EXCEPT, then, in my opinion, you should try to use that same term where possible when describing things. I understand it is hard to do this in text and I agree often it makes more sense to say "excl

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

2025-06-25 Thread Michael Paquier
On Wed, Jun 25, 2025 at 01:12:02PM -0400, shihao zhong wrote: > Just want to make sure, are we not going to include my original test > to catch the future regression? Also, could someone please let me know > how to check if the test is stable or not? On stable branches, you could reuse the patch I

Re: [PATCH] Correct src/backend/lib/README

2025-06-25 Thread Michael Paquier
On Wed, Jun 25, 2025 at 08:58:05PM +0300, Aleksander Alekseev wrote: >> These files were moved to src/backend/lib > > That is - src/common. Sorry for the confusion. No problem, good catches. Agreed to remove these references in the README of backend/lib/. Will fix if there are no objections. --

Re: pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages

2025-06-25 Thread Dilip Kumar
On Thu, Jun 26, 2025 at 6:22 AM Michael Paquier wrote: > > On Wed, Jun 25, 2025 at 10:19:55PM +0530, vignesh C wrote: > > Currently, the logic attempts to read the complete WAL record based on > > the size obtained before the crash—even though only a partial record > > was written. It then checks

Re: Virtual generated columns

2025-06-25 Thread Richard Guo
On Mon, Jun 2, 2025 at 2:31 PM jian he wrote: > On Thu, May 29, 2025 at 11:06 AM Richard Guo wrote: > > Yeah, ATPrepAlterColumnType does seem like a better place. But we > > need to ensure that ATColumnChangeRequiresRewrite sees the expanded > > version of the expression — your proposed change f

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

2025-06-25 Thread Hayato Kuroda (Fujitsu)
Dear Alexander, > > Good idea. But I think we should associate the "updated" flag > directly to the fact that one slot (no matter logical or physical) > changed its last_saved_restart_lsn. See the attached patch. I'm > going to push it if no objections. + /* +* Tr

Re: [PATCH] Proposal: Improvements to PDF stylesheet and table column widths

2025-06-25 Thread Tatsuo Ishii
Dear Kuroda-san, > Dear Ishii-san, > > Actually Saito-san has already been registered [1]. And cfbot said OK. > > [1]: https://commitfest.postgresql.org/patch/5775/ Thank you for pointing it out. Also I see Peter has been already registered as a committer. Great. Best regards, -- Tatsuo Ishii

Re: Removing unneeded self joins

2025-06-25 Thread Andrei Lepikhov
On 26/6/2025 07:40, Michael Paquier wrote: Anyway, it seems to me that we may need to do something here before the release. Note that if the consensus is "you should update your module and not rely on the past behavior", I'm OK with that. I just wanted to raise the issue before this goes GA. A

PG18 protocol version

2025-06-25 Thread Tatsuo Ishii
In the PG18 docs, I see: https://www.postgresql.org/docs/18/protocol-message-formats.html StartupMessage (F) : Int32(196608) The protocol version number. The most significant 16 bits are the major version number (3 for the protocol described here). The least significant 16 bits are th

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

2025-06-25 Thread Nathan Bossart
On Wed, Jun 25, 2025 at 10:31:35AM +0900, Michael Paquier wrote: > 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 m

Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions

2025-06-25 Thread Nathan Bossart
On Wed, Jun 25, 2025 at 09:28:50AM +, Andy Fan wrote: > Michael Paquier writes: >> On Wed, Jun 25, 2025 at 07:47:27AM +, Andy Fan wrote: >>> When I am reading the code, I first thought I can do something in >>> HeapTupleheaderSetXminCommitted, then I realized we have SetHintBits. >>> After

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Fujii Masao
On 2025/06/25 20:46, Álvaro Herrera wrote: On 2025-Jun-25, Fujii Masao wrote: From 516e647e7d1fdafc64dba092389963f32cd688e5 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Wed, 25 Jun 2025 10:02:56 +0900 Subject: [PATCH v2] Make CREATE TABLE LIKE copy comments on NOT NULL constraints wh

Re: display hot standby state in psql prompt

2025-06-25 Thread Jim Jones
Hi Greg On 25.06.25 17:17, Greg Sabino Mullane wrote: > Seems transaction_read_only might be a more useful thing to examine? > That's the side-effect, if you will, that people really care about > when in hot standby mode (and of course, we can get into TRO other ways). Good point. But wouldn't it

Re: No error checking when reading from file using zstd in pg_dump

2025-06-25 Thread Tom Lane
Daniel Gustafsson writes: > I spent a little bit of time reading over all the implementations and cross > referencing the API for conformity, and came up with the attached. The 0001 > patch is the one from upstream, and each subsequent commit is fixing one > function for all the implementations.

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Fujii Masao
On 2025/06/25 22:36, Álvaro Herrera wrote: On 2025-Jun-25, Álvaro Herrera wrote: Yeah, I think in this case we need to extract the constraint name so that we have it available to print the COMMENT command, rather than making any assumptions about it. In fact I suspect this would fail if the

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Álvaro Herrera
On 2025-Jun-26, Fujii Masao wrote: > CREATE TABLE ctlt1_inh (LIKE ctlt1 INCLUDING CONSTRAINTS INCLUDING COMMENTS) > INHERITS (ctlt1); > \d+ ctlt1_inh > -SELECT description FROM pg_description, pg_constraint c WHERE classoid = > 'pg_constraint'::regclass AND objoid = c.oid AND c.conrelid = > '

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Álvaro Herrera
On 2025-Jun-26, Fujii Masao wrote: > However, with the patch applied, I encountered a segmentation fault in pg_dump > as follows: Ah, thanks for the test case. Yeah, I removed one 'if' condition too many from Jian's patch. We just need to test the constraint name for nullness and then things se

Re: Simplify VM counters in vacuum code

2025-06-25 Thread Nazir Bilal Yavuz
Hi, On Tue, 24 Jun 2025 at 07:13, Masahiko Sawada wrote: > Thank you for working on this! > On Tue, Jun 24, 2025 at 4:21 AM Melanie Plageman > wrote: > > > > Hi, > > > > In dc6acfd910b8, I added some counters to track and log in > > autovacuum/vacuum output the number of pages newly set > > al

pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages

2025-06-25 Thread vignesh C
Hi, Buildfarm identified one issue at [1] where it could not identify a partial WAL record spanning across 2 pages was written due to immediate shutdown. Consider a scenario where a WAL record is split across multiple WAL pages. If the server crashes before the entire WAL record is written, the r

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread jian he
On Wed, Jun 25, 2025 at 11:04 PM Fujii Masao wrote: > >> > >> This commit corrects the behavior by ensuring CREATE TABLE LIKE to also > >> copy > >> the comments on NOT NULL constraints when INCLUDING COMMENTS is specified. > > > > LGTM. I'd add a line in the test showing that these comments are

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Tomas Vondra
On 6/24/25 10:24, Bertrand Drouvot wrote: > Hi, > > On Tue, Jun 24, 2025 at 03:43:19AM +0200, Tomas Vondra wrote: >> On 6/23/25 23:47, Tomas Vondra wrote: >>> ... >>> >>> Or maybe the 32-bit chroot on 64-bit host matters and confuses some >>> calculation. >>> >> >> I think it's likely something li

Re: pg_dump --with-* options

2025-06-25 Thread Nathan Bossart
On Wed, Jun 25, 2025 at 08:18:28AM +0900, Fujii Masao wrote: > For pg_dump and pg_dumpall, I agree with Jeff's idea in [1], > but if the statistics is skipped by default, I don't think > we need a --no-statistics option. So, here's how I think > the options should work: > > * Keep: --schema-on

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Bertrand Drouvot
Hi, On Tue, Jun 24, 2025 at 03:43:19AM +0200, Tomas Vondra wrote: > On 6/23/25 23:47, Tomas Vondra wrote: > > ... > > > > Or maybe the 32-bit chroot on 64-bit host matters and confuses some > > calculation. > > > > I think it's likely something like this. I think the same. > I noticed that if

Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.

2025-06-25 Thread Peter Eisentraut
On 23.06.25 05:48, Hayato Kuroda (Fujitsu) wrote: Thanks for posting the patch. Largely it seems OK. Thanks, I have committed this. One comment: I feel most of the word "remove" can be changed to "dropped", in pg_createsubscriber.c and 040_pg_createsubscriber.pl. E.g., ``` # Confirm the phy

Re: problems with toast.* reloptions

2025-06-25 Thread Nathan Bossart
On Mon, Jun 23, 2025 at 10:59:51AM -0500, Nathan Bossart wrote: > On Sat, Jun 21, 2025 at 11:45:25PM -0400, shihao zhong wrote: >> 2) When updating a table's relopt, also update the relopt of its >> associated TOAST table if it's not already set. Similarly, when >> creating a new TOAST table, it wo

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

2025-06-25 Thread David G. Johnston
On Wed, Jun 25, 2025 at 10:56 AM Aleksander Alekseev < aleksan...@timescale.com> wrote: > Hi, > > > > The new PG19 development cycle is starting soon. So that seemed like a > > > good excuse to make some big improvements to the commitfest app. > > > > These changes have now been deployed to produc

Re: Conflict detection for update_deleted in logical replication

2025-06-25 Thread shveta malik
On Mon, Jun 23, 2025 at 4:20 PM Zhijie Hou (Fujitsu) wrote: > > > Here is the V40 patch set Thanks for the patches. Few comments: 1) In get_subscription_info(), we are doing COUNT of rci-subscriptions using below query: SELECT count(*) AS nsub, COUNT(CASE WHEN subretainconflictinfo THEN 1 END) A

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

2025-06-25 Thread Aleksander Alekseev
Hi, > Fourth link down from the top of the link section - "Create a new commitfest > entry" > > Adds it to 19-1; need to move it to Drafts if that is where it belongs. Found it. It was moved to the "Your personal dashboard" page. Previously I used the CF page thus I couldn't find it. Many thank

Re: pg_dump misses comments on NOT NULL constraints

2025-06-25 Thread Álvaro Herrera
On 2025-Jun-25, Álvaro Herrera wrote: > Ah, thanks for the test case. Yeah, I removed one 'if' condition too > many from Jian's patch. We just need to test the constraint name for > nullness and then things seem to work: One more thing was missing, which I noticed as I added the tests. Apparent

Re: [PATCH] Correct src/backend/lib/README

2025-06-25 Thread Aleksander Alekseev
Hi, > These files were moved to src/backend/lib That is - src/common. Sorry for the confusion. -- Best regards, Aleksander Alekseev

pg_dumpall dumps global objects with --statistics-only or --no-schema

2025-06-25 Thread Fujii Masao
Hi, While testing pg_dumpall in v18, I noticed that it still dumps global objects such as roles and tablespaces even when --statistics-only or --no-schema is specified. This seems unexpected. Since pg_dumpall treats global objects as schema-level content, it currently includes them with --schema

Re: Simplify VM counters in vacuum code

2025-06-25 Thread Melanie Plageman
On Tue, Jun 24, 2025 at 4:01 AM Nazir Bilal Yavuz wrote: > > > Thank you for the patch! I could not understand the following change: > > > > + /* We know the page should not have been all-visible */ > > + Assert((old_vmbits & VISIBILITYMAP_VALID_BITS) == 0); > > + (void) old_vmbi

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

2025-06-25 Thread Peter Eisentraut
On 23.06.25 15:13, Peter Eisentraut wrote: Your CheckAttributeType() change is conditional on TYPTYPE_BASE, but if you remove that and check it for all types, then you get the right error in both cases. I have attached a patch that is similar to yours but with that change. I've also written t

MERGE docs: indentation in synopsis section

2025-06-25 Thread Dean Rasheed
Looking at the docs for MERGE, I realised that the "Synopsis" is not indented consistently with other pages -- the convention on almost every other page seems to be to indent continuation lines and options by 4 spaces. So I think we should do the same for MERGE, as in the attached. Regards, Dean d

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-06-25 Thread Ajin Cherian
Sorry, I attached the wrong file. Attaching the correct file now. regards, Ajin Cerian Fujitsu Australia 0001-Improve-initial-slot-synchronization-in-pg_sync_repl.patch Description: Binary data

Re: Add \pset options for boolean value display

2025-06-25 Thread Daniel Verite
David G. Johnston wrote: > > It's \pset null for boolean values > > > > v1, Ready aside from bike-shedding the name. An annoying weakness of this approach is that it cannot detect booleans inside arrays or composite types or COPY output, meaning that the translation of t/f is incomplete.

Unnecessary scan from non-overlapping range predicates

2025-06-25 Thread Ajit Awekar
Hi Team, Please find below an observation regarding query planning that leads to unnecessary table scan when the WHERE clause contains non-overlapping conditions. EXPLAIN (costs off) select * from products where price < 100 AND price > 300; Seq Scan on products Filter: ((price < '100'::numeri

Re: Logrep launcher race conditions leading to slow tests

2025-06-25 Thread Amit Kapila
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: Conflict detection for update_deleted in logical replication

2025-06-25 Thread Amit Kapila
On Wed, Jun 25, 2025 at 8:38 AM Zhijie Hou (Fujitsu) wrote: > > Here is the V41 patch set which includes the following changes: > Few comments on 0004 === 1. + +# Remember the next transaction ID to be assigned +my $next_xid = $node_A->safe_psql('postgres', "SELECT txid_current()

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

2025-06-25 Thread Aleksander Alekseev
Hi, > > The new PG19 development cycle is starting soon. So that seemed like a > > good excuse to make some big improvements to the commitfest app. > > These changes have now been deployed to production. Please report any > problems, either as a reply or as a github issue. Firstly, many thanks fo

Re: SCRAM pass-through authentication for postgres_fdw

2025-06-25 Thread Alexander Pyhalov
Matheus Alcantara писал(а) 2025-06-25 14:36: Hi, thanks for testing and reporting the issue! On 25/06/25 11:37, Alexander Pyhalov wrote: Hi. I've started to look at this feature and found an issue - MyProcPort can be not set if connection is initiated by some bgworker. (Internally we use one fo

  1   2   >