BRIN: Prevent the heapblk overflow during index summarization on very large tables resulting in an infinite loop

2025-10-18 Thread sunil s
Previously, *heapBlk* was defined as an unsigned 32-bit integer. When incremented by *pagesPerRange *on very large tables, it could wrap around, causing the condition *heapBlk < nblocks* to remain true indefinitely — resulting in an *infinite loop*. This could cause the PostgreSQL backend to ha

gzgetc() is hazardous to your health

2025-10-18 Thread Tom Lane
In the gift-that-keeps-on-giving department: I noticed a few days ago while fooling with pg_dump's compression logic that our regression tests were not reaching any of the getc_func methods. It turns out that that's only used when reading a manually-compressed TOC file in a directory-format dump,

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

2025-10-18 Thread Tatsuo Ishii
>> On Oct 16, 2025, at 18:17, Tatsuo Ishii wrote: >> >> Thanks for the report. >> >>> Coverity thinks that this code has still some incorrect bits, and I >>> think that it is right to think so even on today's HEAD at >>> 02c171f63fca. >>> >>> In WinGetFuncArgInPartition()@nodeWindowAgg.c, we ha

Re: pg_createsubscriber --dry-run logging concerns

2025-10-18 Thread Peter Smith
On Sat, Oct 4, 2025 at 3:50 AM Neeraj Shah wrote: > > Hello Peter, > > Your suggestion makes sense to me, if it's fine with you then I can submit a > patch for this change :). > Thanks, but I already had some local patches ready to go I was just waiting for more feedback before posting them.

Re: Sending unflushed WAL in physical replication

2025-10-18 Thread Rahila Syed
Hi, > > Please find attached a POC patch that introduces changes to the WAL > sender and > > receiver, allowing WAL records to be sent to standbys before they are > flushed > > to disk on the primary during physical replication. [..] > > I didn't look at the code but your description of the desi

Re: Support getrandom() for pg_strong_random() source

2025-10-18 Thread Masahiko Sawada
On Thu, Oct 9, 2025 at 5:11 PM Jacob Champion wrote: > > On Thu, Oct 9, 2025 at 4:53 PM Masahiko Sawada wrote: > > Does it mean that we introduce something like pg_fast_random() and > > packagers can select it as the random number generation function > > instead of pg_strong_random()? Or can pack

Re: bug, ALTER TABLE call ATPostAlterTypeCleanup twice for the same relation

2025-10-18 Thread David Rowley
On Sat, 27 Sept 2025 at 21:54, jian he wrote: > if (pass == AT_PASS_ALTER_TYPE || pass == AT_PASS_SET_EXPRESSION) > - ATPostAlterTypeCleanup(wqueue, tab, lockmode); > + { > + if (!list_member_oid(relids, tab->relid)) > + { > + ATPostAlterTypeCleanup(wqueue, tab, lockmode); > + relids = lappend_oi

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

2025-10-18 Thread Rintaro Ikeda
Hi, On 2025/09/22 11:56, Fujii Masao wrote: > On Sat, Sep 20, 2025 at 12:21 AM Yugo Nagata wrote: >>> While testing, I found that running pgbench with --continue-on-error and >>> pipeline mode triggers the following assertion failure. Could this be >>> a bug in the patch? >>> >>>

Re: IO in wrong state on riscv64

2025-10-18 Thread Greg Burd
On Sun, Oct 12, 2025, at 1:00 AM, Alexander Lakhin wrote: > Hello Thomas, > > 12.10.2025 06:35, Thomas Munro wrote: >> On Sun, Oct 12, 2025 at 2:00 AM Alexander Lakhin >> wrote: >>> 2025-10-11 11:34:46.793 GMT [1169773:1] PANIC: !!!pgaio_io_wait| >>> ioh->state changed from 0 to 1 at iteration

Re: Logical Replication of sequences

2025-10-18 Thread Amit Kapila
On Tue, Oct 7, 2025 at 4:52 PM vignesh C wrote: > > Thanks for the comments, the attached patch has the changes for the same. > parse_publication_options(ParseState *pstate, List *options, + bool allsequences, + bool alltables, bool *publish_given, PublicationActions *pubactions,

Mutable listen_addresses GUC

2025-10-18 Thread Ivan Kovmir
Hello. It is necessary to restart PostgreSQL to bind to a different network interface, thus breaking the active connections. This patch draft makes it no longer necessary, just assign the new value to `listen_addresses` GUC and send SIGHUP to Postmaster. Do you think it is useful? Is there any ch

Re: Adding basic NUMA awareness

2025-10-18 Thread Tomas Vondra
On 10/13/25 13:09, Tomas Vondra wrote: > On 10/13/25 01:58, Alexey Makhmutov wrote: >> Hi Tomas, >> >> Thank you very much for working on this problem and the entire line of >> patches prepared! I've tried to play with these patches a little and >> here are some my observations and suggestions.

Re: Fix bug with accessing to temporary tables of other sessions

2025-10-18 Thread Jim Jones
Hi Daniil, On 7/29/25 11:35, Daniil Davydov wrote: > I attach a v7 patch to this letter. No changes yet, just rebased on the newest > commit in master branch. A few days ago I reviewed one patch[1] that has a significant overlap with this one. Perhaps they should be merged? Here my first tests a

Re: Prevent internal error at concurrent CREATE OR REPLACE FUNCTION

2025-10-18 Thread Yugo Nagata
On Wed, 20 Aug 2025 17:01:56 +0900 Yugo Nagata wrote: > On Thu, 17 Jul 2025 14:09:14 +0900 > Yugo Nagata wrote: > > > On Fri, 4 Jul 2025 14:58:05 +0900 > > Yugo Nagata wrote: > > > > > On Fri, 4 Jul 2025 10:48:26 +0700 > > > Daniil Davydov <[email protected]> wrote: > > > > > > > Hi, > >

Re: Qual push down to table AM

2025-10-18 Thread Mark Dilger
Thanks for the patchset, Julien. v1-0001: All current callers of scan_rescan() pass NULL for the `key` parameter, making it unclear to Table AM authors if this is supposed to be a pointer to a single key, or an array. If an array, how is it terminated? None of this is addressed in the curr

Re: doc: Improve description of io_combine_limit and io_max_combine_limit GUCs

2025-10-18 Thread Xuneng Zhou
Hi, On Wed, Oct 8, 2025 at 7:38 PM Karina Litskevich wrote: > > Hi hackers, > > I noticed that GUCs io_combine_limit and io_max_combine_limit are marked > as GUC_UNIT_BLOCKS, but in the documentation nothing is said about that. > Other GUCs marked as GUC_UNIT_BLOCKS have a phrase "If this value i

Re: speedup COPY TO for partitioned table.

2025-10-18 Thread Masahiko Sawada
On Tue, Oct 14, 2025 at 6:53 PM jian he wrote: > > On Tue, Oct 14, 2025 at 4:08 AM Masahiko Sawada wrote: > > > > > > +-- Test COPY TO with a foreign table or when the foreign table is a > > > > partition > > > > +COPY async_p3 TO stdout; --error > > > > +ERROR: cannot copy from foreign table "

Re: Fix overflow of nbatch

2025-10-18 Thread Tomas Vondra
On 10/7/25 23:10, Melanie Plageman wrote: > On Wed, Sep 24, 2025 at 7:02 PM Tomas Vondra wrote: >> >> Here's a couple draft patches fixing the bug: >> >> - 0001 adds the missing size_t cast, to fix the overflow >> - 0002 fixes the balancing, by adjusting the hash table size limit >> - 0003 adds th

Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

2025-10-18 Thread Xuneng Zhou
Hi, On Thu, Aug 28, 2025 at 4:22 PM Xuneng Zhou wrote: > > Hi, > > Some changes in v3: > 1) Update the note of xlogwait.c to reflect the extending of its use > for flush waiting and internal use for both flush and replay waiting. > 2) Update the comment above logical_read_xlog_page which describe

Re: [PATCH] Fix pg_rewind false positives caused by shutdown-only WAL

2025-10-18 Thread BharatDB
*Dear Srinath,* *Subject:* [PATCH] pg_rewind: Ignore shutdown checkpoints when determining rewind necessity. While working with pg_rewind, I noticed that it can sometimes request a rewind even when no real changes exist after a failover. This happens because pg_rewind currently determines the end

Re: Fix overflow of nbatch

2025-10-18 Thread Melanie Plageman
On Wed, Oct 8, 2025 at 1:37 PM Melanie Plageman wrote: > > I have updated my patch to fix the mistakes above. I also noticed then > that I wasn't doubling space_allowed in the loop but instead setting > it to hash_table_bytes at the end. This doesn't produce a power of 2 > because we subtract skew

Re: The ability of postgres to determine loss of files of the main fork

2025-10-18 Thread Arseniy Mukhin
Hi, On Wed, Oct 1, 2025 at 10:02 AM Michael Banck wrote: > > Hi, > > wow, this is one of the most terrifying threads I've ever seen... > > On Tue, Sep 30, 2025 at 12:41:29PM -0400, Tom Lane wrote: > > Aleksander Alekseev writes: > > >> Therefore, I would like to request an enhancement: add an op

Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

2025-10-18 Thread Xuneng Zhou
Hi, The following is the split patch set. There are certain limitations to this simplification effort, particularly in patch 2. The read_local_xlog_page_guts callback demands more functionality from the facility than the WAIT FOR patch — specifically, it must wait for WAL flush events, though it d

Re: [BUG]: the walsender does not update its IO statistics until it exits

2025-10-18 Thread Bertrand Drouvot
Hi, On Wed, Feb 26, 2025 at 05:08:17AM -0500, Andres Freund wrote: > Hi, > > On 2025-02-26 15:37:10 +0900, Michael Paquier wrote: > > That's bad, worse for a logical WAL sender, because it means that we > > have no idea what kind of I/O happens in this process until it exits, > > and logical WAL

Re: Resetting recovery target parameters in pg_createsubscriber

2025-10-18 Thread Alena Vinter
HI Michael, Thank you for the review! > Why not just > switch recovery_params_set to false once ReplaceRecoveryConfig() is > called? Stupid me! > Why do we need to call again GenerateRecoveryConfig() when resetting > recovery.conf/postgresql.conf.sample with its original contents before > switc

Re: Should we update the random_page_cost default value?

2025-10-18 Thread Greg Sabino Mullane
Fascinating thread. As the author of the previous thread Bruce mentioned advocating a lower default rpc, I'm obviously highly invested in this. On Tue, Oct 7, 2025 at 11:38 AM Robert Treat wrote: > One of the interesting things about Tomas' work, if you look at the > problem from the other end,

Re: Logical Replication of sequences

2025-10-18 Thread Dilip Kumar
On Tue, Oct 7, 2025 at 3:51 PM Amit Kapila wrote: > > On Tue, Oct 7, 2025 at 2:21 PM Dilip Kumar wrote: > > > > On Mon, Oct 6, 2025 at 4:33 PM vignesh C wrote: > > > > > > On Mon, 6 Oct 2025 at 12:07, vignesh C wrote: > > > > > > > > On Sat, 4 Oct 2025 at 21:24, Amit Kapila > > > > wrote: > >

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

2025-10-18 Thread Tatsuo Ishii
> Thanks for the report. > >> Coverity thinks that this code has still some incorrect bits, and I >> think that it is right to think so even on today's HEAD at >> 02c171f63fca. >> >> In WinGetFuncArgInPartition()@nodeWindowAgg.c, we have the following >> loop (keeping only the relevant parts: >>

Re: Thoughts on a "global" client configuration?

2025-10-18 Thread Jacob Champion
On Wed, Oct 15, 2025 at 7:16 PM Chao Li wrote: > I am not convinced that the “=+defaults” approach is the best design. > > 1) Not self-documenting. Without documentation, hard to guess what it is > exactly for. > 2) Actually “default = true” will also causes earlier libpq to fail, but > “default

ci: Skip minfree file in the cores_backtrace.sh

2025-10-18 Thread Nazir Bilal Yavuz
Hi, Melanie mentioned on the Postgres Discord channel that the OpenBSD CI task’s 'Run cores' script fails [1] because it tries to process a file named minfree, which is not a valid core file. This patch updates the cores_backtrace.sh script to skip the minfree file across all CI operating systems

Re: Add support for specifying tables in pg_createsubscriber.

2025-10-18 Thread Shubham Khanna
On Thu, Sep 25, 2025 at 1:15 PM Chao Li wrote: > > > On Sep 25, 2025, at 15:07, Shubham Khanna wrote: > > > > 1. > ``` > + if (dbinfo->made_publication) > + drop_publication(conn, dbinfo->pubname, dbinfo->dbname, > + &dbinfo->made_publication); > + else > + pg_log_info("preserve existing publicat

Re: Import Statistics in postgres_fdw before resorting to sampling.

2025-10-18 Thread Corey Huinker
On Fri, Sep 12, 2025 at 1:17 AM Corey Huinker wrote: > Rebased. > Rebased again. From f44b3223c1a15fd7213b2227669ff400f8c01efa Mon Sep 17 00:00:00 2001 From: Corey Huinker Date: Thu, 7 Aug 2025 23:58:38 -0400 Subject: [PATCH v3] Add remote statistics fetching to postgres_fdw. This adds the abi

Re: make tsearch use the database default locale

2025-10-18 Thread Jeff Davis
On Fri, 2025-10-17 at 18:15 +0200, Peter Eisentraut wrote: > > This is indeed a bit mysterious.  AFAICT, the behavior you describe > is > conditional on if (prs->usewide), so it apparently depends also on > the > encoding?  I'm not sure if the new code covers this. I believe the new code does c

Re: anonymous unions (C11)

2025-10-18 Thread Ashutosh Bapat
On Tue, Sep 30, 2025 at 5:14 PM Álvaro Herrera wrote: > > On 2025-Sep-30, Ashutosh Bapat wrote: > > > Attached patch fixes those errors for me. > > > diff --git a/src/common/cryptohash.c b/src/common/cryptohash.c > > index fc0555d2f99..e8a35c2ec35 100644 > > --- a/src/common/cryptohash.c > > +++ b

Re: Fix overflow of nbatch

2025-10-18 Thread Tomas Vondra
On 9/22/25 22:45, David Rowley wrote: > On Tue, 23 Sept 2025 at 01:57, Vaibhav Jain wrote: >> With a1b4f28, to compute current_space, nbatch is being multiplied >> by BLCKSZ. nbatch is int and when multiplied with BLCKSZ, it can >> easily overflow the int limit.To keep the calculation safe for

Re: Add jsonb_translate(jsonb, from, to)

2025-10-18 Thread Andrew Dunstan
On 2025-09-27 Sa 1:16 PM, Florents Tselai wrote: This is a spur of the moment patch really, but while going through the process of translating some json data from Greek to English I found myself wishing for $subject. Inspired by the Unix tr utility. Here's a working v1 If others find it use

Re: Instability of phycodorus in pg_upgrade tests with JIT

2025-10-18 Thread Michael Paquier
On Thu, Oct 16, 2025 at 10:00:00PM +0300, Alexander Lakhin wrote: > I collected all of such failures here: > https://wiki.postgresql.org/wiki/Known_Buildfarm_Test_Failures#check-pg_upgrade_fails_on_LLVM-enabled_animals_due_to_double_free_or_corruption > > Masao-san was going to dig into that: > ht

Re: Remove custom redundant full page write description from GIN

2025-10-18 Thread Andrey Borodin
> On 9 Oct 2025, at 17:33, Kirill Reshke wrote: > > Should we remove them, reducing overall cognitive complexity of GIN > internals and reducing WAL footprint? The patch does not add a single line... that's impressive :) Why not wipe ginxlogSplit entirely? Will the code be clearer with XLog

Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values

2025-10-18 Thread [email protected]
(I realised I created a new thread by mistake, hopefully now I’ll get things back into the main one) On 7 Oct 2025 at 23:52 +0200, Dean Rasheed , wrote: On Tue, 7 Oct 2025 at 14:56, Viktor Holmberg wrote: I’ve looked through this patch. As far as I can tell, everything looks good, working and

Re: bt_index_parent_check and concurrently build indexes

2025-10-18 Thread Mihail Nikalayeu
Hello, everyone! Could someone please take a look? We have a confirmed bug, which happens in production [0], probably needs to be backported and has a simple patch to address for about 9 months already I am not trying to blame someone, just to highlight how it sometimes feels from the non-com

Re: Improve docs syntax checking and enable it in the meson build

2025-10-18 Thread Nazir Bilal Yavuz
Hi, On Tue, 7 Oct 2025 at 16:12, Nazir Bilal Yavuz wrote: > > The Meson build did not include tab and non-breaking space checks for > the docs. The attached patch adds these checks and includes a few > related improvements. I have updated v6 to use a stamp file, as Andres suggested [1], to ensur

Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs

2025-10-18 Thread Tom Lane
David Rowley writes: > I'm just considering the best fix and can think of two options: > 1) Move away from using varno==0 in generate_append_tlist(). Use varno==1, or; > 2) Add handling in setrefs.c for T_Result to adjust varno==0 Vars to > use varno==1 vars. > The attached v4-0001 does #2, but

Re: Problem with DEB packages

2025-10-18 Thread Michael Banck
Hi, On Tue, Sep 30, 2025 at 11:17:07AM +0200, Stefanie Janine Stölting wrote: > Am 30.09.25 um 10:50 schrieb Thom Brown: > > On Tue, 30 Sept 2025 at 09:12, Stefanie Janine Stölting > > wrote: > > > Hi there, > > > > > > I installed a fresh Debian 13 and added the packages > > > fromhttps://www.

Re: Adding REPACK [concurrently]

2025-10-18 Thread Antonin Houska
Álvaro Herrera wrote: > On 2025-Sep-26, Mihail Nikalayeu wrote: > > > Should we rename it to repack_context to be aligned with the calling side? > > Sure, done. > > > > cmd == REPACK_COMMAND_CLUSTER ? "CLUSTER" : "REPACK", > > > > May be changed to RepackCommandAsString > > Oh, of course. >

Re: [PATCH] GROUP BY ALL

2025-10-18 Thread Tom Lane
David Christensen writes: >> Here is v7 with a stab at docs; fairly minimal at this point, but >> touching the two areas that are likely to need adjusting. I did some more word-smithing on the docs and pushed it. >> When >> adjusting the docs for sql-select, I noticed that the grammar also >> su

Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

2025-10-18 Thread Philip Alger
Apologies, I forgot to add a new version of the patch with the documentation change. This is my first time doing this. > your documentation and the function's comment specifically say that the >> function take a trigger name and a table name, so it should not use >> regclass type, which allows O

Re: truncate_useless_pathkeys() doesn't account for window function queries

2025-10-18 Thread David Rowley
On Mon, 6 Oct 2025 at 16:42, David Rowley wrote: > Looking at truncate_useless_pathkeys(), it tries to be fairly liberal > and not truncate anything that might be useful for various operations > that require sorted Paths. However, it's not quite liberal enough to > consider WindowClause sort order

Re: Logical Replication of sequences

2025-10-18 Thread Dilip Kumar
On Tue, Oct 7, 2025 at 4:52 PM vignesh C wrote: > > On Tue, 7 Oct 2025 at 12:09, Amit Kapila wrote: > > I think the patch is mostly LGTM, I have 2 suggestions, see if you think this is useful. 1. postgres[1390699]=# CREATE PUBLICATION pub FOR ALL SEQUENCES, ALL TABLES WITH (publish = insert); N

Re: Improve docs for n_distinct_inherited

2025-10-18 Thread David G. Johnston
On Monday, October 13, 2025, David Rowley wrote: > On Mon, 13 Oct 2025 at 17:09, David G. Johnston > wrote: > > How about: > > > > n_distinct_inherited exists to allow the distinct value estimate to be > overwritten for the children-included statistics gathered for inheritance > parent tables, a

Re: ci: Skip minfree file in the cores_backtrace.sh

2025-10-18 Thread Nazir Bilal Yavuz
Hi, On Fri, 17 Oct 2025 at 12:15, Daniel Gustafsson wrote: > > > On 17 Oct 2025, at 10:26, Nazir Bilal Yavuz wrote: > > > This patch updates the cores_backtrace.sh script to skip the minfree > > file across all CI operating systems, since it is not expected to be a > > valid core file on any of

Re: Proposal: Exploring LSM Tree‑Based Storage Engine for PostgreSQL (Inspired by MyRocks)

2025-10-18 Thread Konstantin Osipov
* Manish Rai Jain [25/05/11 22:06]: > Hi hackers, >1. Does this direction make sense for experimentation within the Postgres >ecosystem? >2. Are there known architectural blockers or prior discussions/attempts in >this space worth revisiting? >3. Would such a project be best

Re: Optimize LISTEN/NOTIFY

2025-10-18 Thread Tom Lane
Matheus Alcantara writes: > 7. I'm wondering if we could add some TAP tests for this? async.c seems already moderately well covered by existing tests src/test/regress/sql/async.sql src/test/isolation/specs/async-notify.spec Do we need more? If there's something not covered, can we extend those

Re: Documentation fix on pgbench \aset command

2025-10-18 Thread Yugo Nagata
On Mon, 22 Sep 2025 16:19:14 +0900 Fujii Masao wrote: > On Fri, Jun 27, 2025 at 10:37 AM Yugo Nagata wrote: > > This will work if we assume that the query never returns the initial value. > > I've attached a updated patch that fix the documentation as below: > > > > If a query returns no rows,

Re: Making pg_rewind faster

2025-10-18 Thread John H
Hi, On Wed, Oct 15, 2025 at 7:27 AM Srinath Reddy Sadipiralla wrote: > > TBH first it seemed to me a good coding practice for future proofing, > then i checked if there's any place in postgres we are doing > something similar ,then found 1 in src/include/access/gist.h > > typedef struct GISTDele

Re: remove unnecessary include in src/backend/commands/policy.c

2025-10-18 Thread Shinya Kato
Hi, On Sun, Sep 14, 2025 at 3:38 PM jian he wrote: > > hi. > > in src/backend/commands/policy.c, i found that > #include "access/htup.h" > #include "access/htup_details.h" > #include "catalog/catalog.h" > #include "nodes/pg_list.h" > #include "parser/parse_node.h" > #include "utils/array.h" > > i

Re: Build failure with Meson >= 1.8.3 on Windows

2025-10-18 Thread Nazir Bilal Yavuz
Hi, On Mon, 13 Oct 2025 at 18:49, Dave Page wrote: > > On Mon, 13 Oct 2025 at 15:57, Nazir Bilal Yavuz wrote: >> >> I tested Meson 1.8.5 on the Postgres CI (on both VS 2019 and VS 2022), >> and there were no errors [1]. Also, Postgres CI uses Meson 1.9.1 >> without any failures. Could it be that

compiling pg_bsd_indent

2025-10-18 Thread Robert Haas
While $SUBJECT today -- using the sources from https://git.postgresql.org/git/pg_bsd_indent.git -- I ran into some problems. I got errors due to the replacement of pg_attribute_noreturn() with pg_return(), and warnings due to variable definitions with no previous extern declaration. Here's a quick

Re: Clarification on Role Access Rights to Table Indexes

2025-10-18 Thread Jeff Davis
On Mon, 2025-10-13 at 14:30 -0500, Nathan Bossart wrote: > * 0001 moves the code for stats clearing/setting to use > RangeVarGetRelidExtended().  The existing code looks up the relation, > locks > it, and then checks permissions.  There's no guarantee that the > relation > you looked up didn't conc

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

2025-10-18 Thread Amit Kapila
On Wed, Oct 15, 2025 at 9:50 PM Masahiko Sawada wrote: > > On Wed, Oct 15, 2025 at 3:56 AM Amit Kapila wrote: > > > > On Tue, Oct 14, 2025 at 11:40 PM Masahiko Sawada > > wrote: > > > > > > On Tue, Oct 14, 2025 at 2:24 AM shveta malik > > > wrote: > > > > > > > > Thanks. I was testing slot-sy

Re: Patch for migration of the pg_commit_ts directory

2025-10-18 Thread ls7777
Hi,I'll try to return it to the original thread. I absolutely agree with you. Data loss during migration is an unacceptable situation. And why it's still happening, I don't understand. But issuing messages will require translating it into other languages and complicate the patch.  I'm not a program

Re: Optimizing ResouceOwner to speed up COPY

2025-10-18 Thread Tomas Vondra
On 10/16/25 21:28, Tom Lane wrote: > Tomas Vondra writes: >> On 10/16/25 20:12, Tom Lane wrote: >>> Can you find evidence of this change being helpful for anything >>> except this specific scenario in COPY? > >> I went through the ResourceOwnerRemember() calls, looking for other >> cases that mig

Re: GNU/Hurd portability patches

2025-10-18 Thread Alexander Lakhin
Hello Thomas, Thank you for your attention to that anomaly! 10.10.2025 05:59, Thomas Munro wrote: [Using this as a general GNU/Hurd problem thread] An interesting fruitcrow failure: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=fruitcrow&dt=2025-09-30%2007%3A28%3A50 TRAP: failed As

Re: Optimize LISTEN/NOTIFY

2025-10-18 Thread Joel Jacobson
On Tue, Sep 23, 2025, at 18:27, Tom Lane wrote: > I concur that these are orthogonal issues, but I don't understand > why you withdrew your patches --- don't they constitute a solution > to the first scalability bottleneck? Thanks for getting back to this thread. I was unhappy with not finding a s

Improve docs syntax checking and enable it in the meson build

2025-10-18 Thread Nazir Bilal Yavuz
Hi, The Meson build did not include tab and non-breaking space checks for the docs. The attached patch adds these checks and includes a few related improvements. This topic was previously discussed towards end of the another thread [1], but it was decided that it would be better to have a separat

Re: issue with synchronized_standby_slots

2025-10-18 Thread Fabrice Chapuis
As Ashutosh suggests I will go more for the backpatching approach because the synchronized_standby_slots parameter impacts the last 2 major versions and this problem is critical on production environments. Best regards Fabrice On Fri, Sep 26, 2025 at 9:00 AM Ashutosh Sharma wrote: > Hi, > > On

Re: another autovacuum scheduling thread

2025-10-18 Thread Jeremy Schneider
On Wed, 8 Oct 2025 12:06:29 -0500 Sami Imseih wrote: > > One risk I see with this approach is that we will end up autovacuuming > tables that also take the longest time to complete, which could cause > smaller, quick-to-process tables to be neglected. > > It’s not always the case that the oldest

Re: remove unnecessary include in src/backend/commands/policy.c

2025-10-18 Thread Shinya Kato
On Sun, Oct 12, 2025 at 5:31 PM Álvaro Herrera wrote: > > On 2025-Sep-30, Shinya Kato wrote: > > > However, the changes make policy.c rely on transitive includes. For > > example, policy.c uses GETSTRUCT(), which is defined in > > access/htup_details.h. Instead of being included directly, that hea

Re: Invalid primary_slot_name triggers warnings in all processes on reload

2025-10-18 Thread Fujii Masao
On Thu, Oct 9, 2025 at 2:26 PM Fujii Masao wrote: > > Please note that since you're using already translated strings as > > arguments, you must use errmsg_internal() and errhint_internal(), to > > avoid doubly-translating these messages. > > I've updated the patch to use errmsg_internal() and errh

Re: Fix locking issue with fixed-size stats template in injection_points

2025-10-18 Thread Chao Li
> On Sep 29, 2025, at 08:48, Michael Paquier wrote: > > > The failure is not surprising, because the stats reports can happen in > a concurrent fashion when a point is run for example, contrary to > other fixed-sized stats kind where the reports are only done by a > single process (archiver, b

Re: using index to speedup add not null constraints to a table

2025-10-18 Thread Álvaro Herrera
Can you please rebase this? It stopped applying a week ago. Thanks! -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/ "Sallah, I said NO camels! That's FIVE camels; can't you count?" (Indiana Jones)

Re: another autovacuum scheduling thread

2025-10-18 Thread Jeremy Schneider
On Fri, 10 Oct 2025 16:24:51 -0400 Robert Haas wrote: > I don't think we > need something dramatically awesome to make a change to the status > quo, but if it's extremely easy to think up simple scenarios in which > a given idea will fail spectacularly, I'd be inclined to suspect that > there wil

Question about InvalidatePossiblyObsoleteSlot()

2025-10-18 Thread suyu.cmj
Hi, all, I have a question about a behavioral difference in InvalidatePossiblyObsoleteSlot() between PG15 (and earlier) and PG16 (and later): In PG15 and earlier: while attempting to acquire a slot, if the slot's restart_lsn advanced to be greater than oldestLSN during the process, the slot wou

Re: Why pg_dump overwrites dump file?

2025-10-18 Thread Daniel Gustafsson
> On 14 Oct 2025, at 07:42, Chao Li wrote: > Behaviors of the two types of pg_dump are inconsistent, I wonder if that’s by > design? It does admittedly seem odd that --file works differently for files and directories, but at this point it might be behavior that users expect and changing it migh

Re: pgstattuple: Use streaming read API in pgstatindex functions

2025-10-18 Thread Xuneng Zhou
Hi, On Mon, Oct 13, 2025 at 5:42 PM Nazir Bilal Yavuz wrote: > > Hi, > > On Mon, 13 Oct 2025 at 11:42, Xuneng Zhou wrote: > > > > Here is patch v3. The comments have been added, and the extra scope > > ({}) has been removed as suggested. > > Thanks, the code looks good to me! > > The benchmark r

Re: pg_stat_statements: faster search by queryid

2025-10-18 Thread Karina Litskevich
>> I do think having the ability to look up a specific entry based on a >> key (that is, hash_search instead of hash_seq_search) would be useful. > > That's a great idea, thanks! I'm going to try that and include it in > the next version of the patch if I succeed. Here is the second version of the

Re: [PATCH] Fix pg_rewind false positives caused by shutdown-only WAL

2025-10-18 Thread Robert Haas
On Tue, Sep 30, 2025 at 1:24 PM Srinath Reddy Sadipiralla wrote: > Can you please once confirm this, did you mean that this is not even an > actual problem to fix or only this patch's logic which I provided does not > make sense?, because i am trying out come up with another patch based on your

Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

2025-10-18 Thread Álvaro Herrera
On 2025-Oct-14, jian he wrote: > select pg_get_trigger_ddl(-1, 'h'); > ERROR: relation with OID 4294967295 does not exist > > this error obviously is not good. > we can follow the approach used by pg_get_viewdef(oid) Hmm. For pg_get_viewdef() we have two functions: { oid => '1640', descr =>

Re: [PATCH] Introduce unified support for composite GUC options

2025-10-18 Thread David G. Johnston
On Mon, Sep 22, 2025 at 10:33 PM Чумак Антон wrote: > Working with parameters is not limited to working within a session, > otherwise the PGC_INTERNAL, PGC_POSTMASTER, and PGC_SIGHUP contexts would > not be needed. My patch provides unified support for composite types and > within such contexts.

Re: Fix array access (src/bin/pg_dump/pg_dump.c)

2025-10-18 Thread Ranier Vilela
Em sáb., 11 de out. de 2025 às 02:24, Chao Li escreveu: > > On Oct 11, 2025, at 00:41, Ranier Vilela wrote: > > Em ter., 12 de nov. de 2024 às 19:13, Ranier Vilela > escreveu: > >> Em ter., 12 de nov. de 2024 às 16:11, Alvaro Herrera < >> [email protected]> escreveu: >> >>> On 2024-Nov-12

RE: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE

2025-10-18 Thread Aya Iwata (Fujitsu)
Hi Chao-san, Michael san Thank you for your comments! To accept your comment, I updated patch to v0008. > From: Chao Li > Sent: Wednesday, October 15, 2025 12:37 PM ... > By searching for “ByOid”, we can get some existing examples: > > ObjectAddress > RefreshMatViewByOid(Oid matviewOid, bool i

Re: Fix an unnecessary cast calling elog in ExecHashJoinImpl

2025-10-18 Thread Tender Wang
Richard Guo 于2025年10月16日周四 17:53写道: > On Thu, Oct 16, 2025 at 4:07 PM Xuneng Zhou wrote: > > On Mon, Sep 1, 2025 at 9:26 AM Chao Li wrote: > > > On Aug 30, 2025, at 14:09, Tender Wang wrote: > > > While debugging the HashJoin codes, I noticed below codes in > ExecHashJoinImpl(): > > > > > > el

Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values

2025-10-18 Thread Dean Rasheed
On Tue, 7 Oct 2025 at 14:56, Viktor Holmberg wrote: > > I’ve looked through this patch. As far as I can tell, everything looks good, > working and well commented. > The only nitpick I could find is a mispelling "EXLCUDED" → "EXCLUDED" in > src/test/regress/expected/returning.out:464. Thanks for

Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs

2025-10-18 Thread David Rowley
On Fri, 3 Oct 2025 at 10:02, Tom Lane wrote: > > David Rowley writes: > > An alternative way would be to propagate those during > > build_setop_child_paths() > > That answer works for me. I was expecting you to just document the > need for the extra check in is_dummy_rel ;-) ... but this way is

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

2025-10-18 Thread Tatsuo Ishii
> Probably I misunderstood what you said. Now I realize what you are > suggesting was, throwing an error *only* when a RESPECT/IGNORE NULLS > option is given and the function did not call > WinAllowNullTreatmentOption. If the option is not given, no error is > thrown even if WinAllowNullTreatmentOp

Re: Add support for specifying tables in pg_createsubscriber.

2025-10-18 Thread Peter Smith
Hi Shubham, Here are some v13 review comments. == src/bin/pg_basebackup/pg_createsubscriber.c 1. - /* - * In dry-run mode, we don't create publications, but we still try to drop - * those to provide necessary information to the user. - */ if (!drop_all_pubs || dry_run) - drop_publication(c

Make GiST waldump output more descriptive

2025-10-18 Thread Kirill Reshke
Hi hackers! pageinspect and pg_waldump are among my most favorite postgresql tools. I do often use them for my work. Recently I was busy working with GiST internals, and spotted a few places in GiST pg_waldump which can be enhanced to make output more descriptive. These changes helped me a lot to

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

2025-10-18 Thread Chao Li
> On Oct 11, 2025, at 13:42, Tatsuo Ishii wrote: > >>> Also the error is certainly user-facing, >>> so using elog() was quite inappropriate. It should be ereport with an >>> errcode of (probably) ERRCODE_FEATURE_NOT_SUPPORTED. Rolling your >>> own implementation of get_func_name() wasn't grea

Re: [BUG] temporary file usage report with extended protocol and unnamed portals

2025-10-18 Thread Michael Paquier
On Wed, Oct 15, 2025 at 05:58:37PM +0900, Michael Paquier wrote: > I did not really get the use of wait_for_log(). The query sequences > are well-timed, hence a set of log_contains() should be enough with > a correct offset to point to a position in the logs. Just a point of detail here. v13 and

Re: Should we say "wal_level = logical" instead of "wal_level >= logical"

2025-10-18 Thread Ashutosh Bapat
On Thu, Oct 16, 2025 at 5:36 AM Peter Smith wrote: > > Hi Hackers, > > While reviewing another LR thread [1] it saw multiple wal_level > messages that seem more complex than necessary. > > Background: There are three wal_level values [2], ranked as: > minimal < replica < logical > > Notice there i

RE: Supporting non-deterministic collations with tailoring rules.

2025-10-18 Thread Todd Lang
Ah, somehow I missed your email on this. This is, in fact, exactly what should happen. The ICU folks are updating their documentation to reflect this with https://github.com/unicode-org/icu/pull/3684/files . Is this small change a reasonable thing to include given the update in guidance from

Re: [PATCH] Add tests for Bitmapset

2025-10-18 Thread David Rowley
On Wed, 1 Oct 2025 at 12:37, Michael Paquier wrote: > > On Wed, Oct 01, 2025 at 12:00:39PM +1300, David Rowley wrote: > > 1. Added helper macros PG_ARG_GETBITMAPSET() and > > PG_RETURN_BITMAPSET_AS_TEXT(). These themselves save a few hundred > > lines of code and make the functions easier to read.

Re: plpython: Remove support for major version conflict detection

2025-10-18 Thread Mario González Troncoso
I'm attaching the same patch after rebasing from master. I had to just change this in src/pl/plpython/plpy_main.c - static bool PLy_procedure_is_trigger(Form_pg_proc procStruct); + static PLyTrigType PLy_procedure_is_trigger(Form_pg_proc procStruct); Now the function returns PLyTrigType instead o

Re: Clarification on Role Access Rights to Table Indexes

2025-10-18 Thread Nathan Bossart
On Thu, Oct 09, 2025 at 10:39:32AM -0500, Nathan Bossart wrote: > On Wed, Oct 08, 2025 at 08:28:01PM -0700, Jeff Davis wrote: >> Actually, now I'm unsure. v4-0001 is taking a lock on the table before >> checking privileges, whereas v4-0002 is going to some effort to avoid >> that. Is that because t

Re: split func.sgml to separated individual sgml files

2025-10-18 Thread Andrew Dunstan
On 2025-10-06 Mo 6:44 AM, Nazir Bilal Yavuz wrote: Hi, On Mon, 6 Oct 2025 at 11:54, Peter Eisentraut wrote: On 06.10.25 10:29, Nazir Bilal Yavuz wrote: I can work on this but I want to clarify it first. Which one do you prefer: 1- We won't have any command to do syntax checks (including ta

Re: [PATCH] Introduce unified support for composite GUC options

2025-10-18 Thread Tom Lane
Pavel Stehule writes: > Using GUC as session variables is a workaround because there is nothing > better. But it is not good solution Agreed, but we don't yet have a better one ... > The basic question is if variables should be typed or typeless - like > plpgsql or psql variables. I think it is

Re: Should we update the random_page_cost default value?

2025-10-18 Thread Tomas Vondra
On 10/6/25 11:02, Michael Banck wrote: > Hi, > > On Mon, Oct 06, 2025 at 02:59:16AM +0200, Tomas Vondra wrote: >> I started looking at how we calculated the 4.0 default back in 2000. >> Unfortunately, there's a lot of info, as Tom pointed out in 2024 [2]. >> But he outlined how the experiment work

Re: [PATCH] Add tests for Bitmapset

2025-10-18 Thread Greg Burd
On Oct 8 2025, at 11:47 pm, Michael Paquier wrote: > On Thu, Oct 09, 2025 at 04:35:55PM +1300, David Rowley wrote: >> On Thu, 9 Oct 2025 at 15:13, Michael Paquier wrote: >> > What do you think about the attached? >> >> Thanks. Looks pretty good. >> >> > + members = palloc(sizeof(int) * num

Re: GB18030-2022 Support in PostgreSQL

2025-10-18 Thread Chao Li
On Mon, Sep 29, 2025 at 12:03 PM John Naylor wrote: > On Wed, Sep 24, 2025 at 4:18 PM Chao Li wrote: > > I am not sure if you should also upgrade the UCM file to 2022 version, > but if we need, let’s do it with a separate commit. > > If they can all use the same file, we should just do that for

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

2025-10-18 Thread Ajin Cherian
On Mon, Oct 13, 2025 at 6:57 PM Ajin Cherian wrote: > > I have modified the patch to use the same wait logic as the slotsync > worker. I have also incorporated the document changes that you shared. > Attaching v16 with the above changes. > Updated the patch with a tap test. Attaching patch v17 w

Re: Optimize LISTEN/NOTIFY

2025-10-18 Thread Tom Lane
"Joel Jacobson" writes: > On Tue, Oct 7, 2025, at 22:15, Tom Lane wrote: >> 5. ChannelHashAddListener: "already registered" case is not reached, >> which surprises me a bit, and neither is the "grow the array" stanza. > I've added a test for the "grow the array" stanza. > The "already registered

  1   2   3   4   5   6   7   8   >