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

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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: [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: 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: Huge commitfest app update upcoming: Tags, Draft CF, Help page, and automated commitfest creat/open/close

2025-06-25 Thread Aleksander Alekseev
Hi, > Ugh... Turns out it was a bug, there definitely should be a "New > patch" button on both the 19-1 and on the Drafts page. And there > was... but only if you were logged in as a staff user. There is now a "New patch" button on the CF entry page. Many thanks! > I had changed a field name to

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

2025-06-25 Thread Alexander Korotkov
On Wed, Jun 25, 2025 at 11:25 AM Dilip Kumar wrote: > On Wed, Jun 25, 2025 at 1:18 PM Hayato Kuroda (Fujitsu) > wrote: > > Another idea is to call ReplicationSlotsComputeRequiredLSN() when at least > > one > > of the restart_lsn is updated, like attached. I feel this could reduce the > > comput

Re: Making Row Comparison NULL row member handling more robust during skip scans

2025-06-25 Thread Peter Geoghegan
On Wed, Jun 18, 2025 at 8:41 PM Peter Geoghegan wrote: > In general, when we end a primitive index scan, the code that sets > continuescan=false (any such code, not just _bt_check_rowcompare NULL > row member code) has to make sure that starting the next primitive > index scan will actually allow

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

Decompression bug in astreamer_lz4

2025-06-25 Thread Mikhail Gribkov
Hi hackers, While developing my extension, I faced some problems in using pg_basebackup/pg_verifybackup on a cluster with additional custom files saved. The extension saves its own format files, which may have a variety of sizes and usually quite low compression potential. The same situation can

Re: Unnecessary scan from non-overlapping range predicates

2025-06-25 Thread Tom Lane
Ajit Awekar writes: > EXPLAIN (costs off) > select * from products where price < 100 AND price > 300; > Seq Scan on products > Filter: ((price < '100'::numeric) AND (price > '300'::numeric)) > Since this condition is false and result will always be empty. Despite > this, we still perform unnece

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

2025-06-25 Thread Jelte Fennema-Nio
On Wed, 25 Jun 2025 at 20:29, Aleksander Alekseev wrote: > > 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

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

Re: pg_dump --with-* options

2025-06-25 Thread Greg Sabino Mullane
On Wed, Jun 25, 2025 at 10:36 AM Nathan Bossart wrote: > > This is so close to ideal. It's just that the first bullet should be > "off by default" :) > > If we did that, the only way to dump statistics would be > --statistics-only, right? You wouldn't be able to include statistics along > with o

Re: Per-role disabling of LEAKPROOF requirements for row-level security?

2025-06-25 Thread Yugo Nagata
On Mon, 23 Jun 2025 09:56:19 +0200 Jelte Fennema-Nio wrote: > On Mon, 23 Jun 2025 at 09:43, Andreas Lind > wrote: > > > > Thanks for your replies! > > > > Tom Lane wrote: > > > Yugo Nagata writes: > > > > I'm not sure whether multi-tenant applications fall into the category > > > > where > >

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

2025-06-25 Thread Bertrand Drouvot
Hi, On Wed, Jun 25, 2025 at 09:15:04AM +0530, shveta malik wrote: > On Wed, Jun 25, 2025 at 9:12 AM shveta malik wrote: > > > > On Tue, Jun 24, 2025 at 2:12 PM Bertrand Drouvot > > wrote: > > > > > > Yeah, I think that sounds reasonable and that would avoid users to use > > > the slot created wi

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: display hot standby state in psql prompt

2025-06-25 Thread Greg Sabino Mullane
On Wed, Jun 25, 2025 at 4:02 AM Jim Jones wrote: > if (pset.db && PQparameterStatus(pset.db, "in_hot_standby")) > 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, w

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: 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: queryId constant squashing does not support prepared statements

2025-06-25 Thread Álvaro Herrera
Hello I spent a much longer time staring at this patch than I wanted to, and at a point I almost wanted to boot the whole thing to pg19, but because upthread we already had an agreement that we should get it in for this cycle, I decided that the best course of action was to just move forward with

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

2025-06-25 Thread Greg Sabino Mullane
On Wed, Jun 25, 2025 at 3:26 AM Ale Rox wrote: > - A JDBC driver (and ideally other drivers as well) that accepts a list of > nodes in the connection string and can automatically detect the current > primary node for write operations — similar to how MongoDB drivers handle > replica sets. > This

Re: pgsql: Introduce pg_shmem_allocations_numa view

2025-06-25 Thread Christoph Berg
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 suggested patch draft, but this should probably inclu

Re: SQL:2023 JSON simplified accessor support

2025-06-25 Thread jian he
On Wed, Jun 25, 2025 at 1:56 PM jian he wrote: > > hi. CREATE TABLE test_jsonb_dot_notation AS SELECT '{"a": [1, 2, {"b": "c"}, {"b": "d", "e": "f", "x": {"y": "yyy", "z": "zzz"}}], "b": [3, 4, {"b": "g", "x": {"y": "YYY", "z": "ZZZ"}}]}'::jsonb jb; CREATE VIEW v1 AS SELECT (jb).a[3].x.y FROM tes

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

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

Re: Minor patch; missing comment update in worker.c

2025-06-25 Thread Amit Kapila
On Mon, Jun 23, 2025 at 8:56 AM Amit Kapila wrote: > > On Mon, Jun 23, 2025 at 8:22 AM Hayato Kuroda (Fujitsu) > wrote: > > > > But this is not correct anymore, 1462aad2 allows to alter two_phase option. > > I was an original author, but I did oversight. > > > > I feel it can be fixed by referrin

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: 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: [PATCH] Fix OAuth feature detection on OpenBSD+Meson

2025-06-25 Thread Jacob Champion
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 HAVE_SYS_EVENT_H is working fine

Re: Add \pset options for boolean value display

2025-06-25 Thread David G. Johnston
On Wed, Jun 25, 2025 at 11:03 AM Daniel Verite wrote: > 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 t

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

2025-06-25 Thread Greg Sabino Mullane
On Wed, Jun 25, 2025 at 3:26 AM Ale Rox wrote: > Specifically, it would be extremely useful to have: > (snip wishlist) > Are there any plans to introduce such functionality in the core > PostgreSQL project in the future? Getting failover to work, and work CORRECTLY[1], is an extremely compli

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

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

[PATCH] Correct src/backend/lib/README

2025-06-25 Thread Aleksander Alekseev
Hi, I noticed that src/backend/lib/README references binaryheap.c and stringinfo.c. These files were moved to src/backend/lib. Thus mentioning them here doesn't look right. Also README tries to explain the difference between binary heap and pairing heap. Not sure whether we should keep this text

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

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

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

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

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

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

  1   2   >