Re: Doc: Add note for running ANALYZE after ALTER TABLE ... SET EXPRESSION

2025-08-05 Thread Yugo Nagata
On Wed, 6 Aug 2025 13:20:18 +0900 Fujii Masao wrote: > On Tue, Aug 5, 2025 at 10:09 AM Yugo Nagata wrote: > > Thank you for looking at it. I overlooked that virtual generated columns > > don't have statistics currently (I'm working on this at [1], though). > > > > Your suggestion makes sense, so

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

2025-08-05 Thread shveta malik
Please find a few comments on v6: 1) +/* + * Initialize logical decoding status on shmem at server startup. This + * must be called ONCE during postmaster or standalone-backend startup, + * before initializing replication slots. + */ +void +StartupLogicalDecodingStatus(bool last_status) The comme

Enhance Makefiles to rebuild objects on map file changes

2025-08-05 Thread Chao Li
Hi Community,While working on the upgrade from GB18030 to GB18030-2022, I updated two GB18030-related map files. However, rebuilding PostgreSQL did not recompile anything, which led me to discover that the Makefiles under src/backend/utils/mb/conversion_procs were missing dependency rules between N

Re: Re: Enhance Makefiles to rebuild objects on map file changes

2025-08-05 Thread 厉超
Try again ... -Original Messages- From:"Chao Li" Send time:Wednesday, 06/08/2025 12:56:36 To: pgsql-hackers@lists.postgresql.org Subject: Re: Enhance Makefiles to rebuild objects on map file changes It looks weird. From https://www.postgresql.org/message-id/1CA8625F-AA41-4ED2-B

Re: Enhance Makefiles to rebuild objects on map file changes

2025-08-05 Thread Chao Li
It looks weird. From https://www.postgresql.org/message-id/1CA8625F-AA41-4ED2-B60F-E28AC71F37DC%40highgo.com, I don’t see the attachment of the patch file. However, the email in my Inbox has the attachment.Try to resend the attachment. Chao Li (Evan)HighGo Infra. Software Inc.ht

LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue

2025-08-05 Thread Alexandra Wang
Hi, I'm bringing up a bug that was reported multiple times [1][2][3] in the bugs list here, for a broader audience. The issue is that an ERROR like the one below occurs when trying to register any listener in the database. test=# listen c21; ERROR: 58P01: could not access status of transaction

Re: Bug in pg_dump --filter? - Invalid object types can be misinterpreted as valid

2025-08-05 Thread Fujii Masao
On Tue, Aug 5, 2025 at 4:52 PM Daniel Gustafsson wrote: > > > On 4 Aug 2025, at 17:18, Fujii Masao wrote: > > I missed this thread while being on vacation, thanks for finding and fixing > this! > > > This also got me thinking, if we simply define keywords as strings of > > non-whitespace characte

Re: Improve LWLock tranche name visibility across backends

2025-08-05 Thread Sami Imseih
> I'll fix this in the next rev. v5 fixes the above 2 issues found above. For the issue that was throwing " segment that has been freed", indeed we should be freeing LWLockTrancheNames.shmem->list_ptr, list_ptr is a dsa_pointer that stores an array of dsa_pointers, which then made me realize

Re: Doc: Add note for running ANALYZE after ALTER TABLE ... SET EXPRESSION

2025-08-05 Thread Fujii Masao
On Tue, Aug 5, 2025 at 10:09 AM Yugo Nagata wrote: > Thank you for looking at it. I overlooked that virtual generated columns > don't have statistics currently (I'm working on this at [1], though). > > Your suggestion makes sense, so I've attached an updated patch. > I also mentioned virtual gener

Re: Fixed a minor typo in code comment

2025-08-05 Thread Chao Li
I am fine with that, and thanks for the v2 patch. Chao Li (Evan) HighGo Infra. Software Inc. https://www.highgo.com/ > On Aug 6, 2025, at 12:11, Fujii Masao wrote: > > On Wed, Aug 6, 2025 at 8:11 AM Chao Li wrote: >> >> Hi, >> >> I didn’t intend to modify the module, b

Re: Fixed a minor typo in code comment

2025-08-05 Thread Fujii Masao
On Wed, Aug 6, 2025 at 8:11 AM Chao Li wrote: > > Hi, > > I didn’t intend to modify the module, but noticed the typo while searching > through the code. Submitting a patch to correct it. > > I ran a basic test of “make check” and the test passed. Thanks for the patch! LGTM. The comment doesn't

Re: analyze-in-stages post upgrade questions

2025-08-05 Thread Mircea Cadariu
Hi, On 30/07/2025 12:49, Fujii Masao wrote: I've started reviewing the patch since it's marked as ready for committer. Thanks! Overall, I like the change. But I have one question: should this be treated as a bug fix that we back-patch to supported branches, or is it more of an improvement that

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

2025-08-05 Thread shveta malik
On Wed, Aug 6, 2025 at 6:18 AM Masahiko Sawada wrote: > > > I've attached the updated version patch. > Thank You for the patch. The patch does not apply to the latest head due to conflict with slot-sync fix (commit-Id: 4614d53d). thanks Shveta

Re: More protocol.h replacements this time into walsender.c

2025-08-05 Thread Nathan Bossart
Okay, I think I've addressed all the latest feedback in v5. -- nathan >From 00540a80854d3fc598a4b99daddfe1e7c0817b5c Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 5 Aug 2025 22:18:11 -0500 Subject: [PATCH v5 1/1] Expand usage of protocol characters. MIME-Version: 1.0 Content-Type: tex

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

2025-08-05 Thread shveta malik
On Wed, Aug 6, 2025 at 7:35 AM Ajin Cherian wrote: > > On Tue, Aug 5, 2025 at 4:22 PM Amit Kapila wrote: > > > > On Tue, Aug 5, 2025 at 9:28 AM shveta malik wrote: > > > > > > On Mon, Aug 4, 2025 at 3:41 PM Amit Kapila > > > wrote: > > > > > > > > On Mon, Aug 4, 2025 at 12:19 PM shveta malik

Re: fix ancient typo in transformRelOptions()

2025-08-05 Thread Nathan Bossart
On Tue, Aug 05, 2025 at 06:10:54PM -0400, Tom Lane wrote: > =?utf-8?Q?=C3=81lvaro?= Herrera writes: >> On 2025-Aug-05, Nathan Bossart wrote: >>> I noticed that this function has a "namspace" parameter. The attached >>> patch adds the missing 'e'. > >> I have vague recollections of it being this

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

2025-08-05 Thread Ajin Cherian
On Tue, Aug 5, 2025 at 4:22 PM Amit Kapila wrote: > > On Tue, Aug 5, 2025 at 9:28 AM shveta malik wrote: > > > > On Mon, Aug 4, 2025 at 3:41 PM Amit Kapila wrote: > > > > > > On Mon, Aug 4, 2025 at 12:19 PM shveta malik > > > wrote: > > > > If we want to avoid continuously syncing newly added

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

2025-08-05 Thread Ajin Cherian
On Fri, Aug 1, 2025 at 4:32 PM shveta malik wrote: > > > Thanks for the patch. I tested it, please find a few comments: > > > 1) > it hits an assert > (slotsync_reread_config()-->Assert(sync_replication_slots)) when API > is trying to sync and is in wait loop while in another session, I > enable s

Re: Dead code with short varlenas in toast_save_datum()

2025-08-05 Thread Michael Paquier
On Tue, Aug 05, 2025 at 10:26:03AM -0700, Nikhil Kumar Veldanda wrote: > This code path is currently not covered by tests. It can be exercised > with the following SQL pattern > > CREATE TABLE temp_tbl (a text, b text); > ALTER TABLE temp_tbl SET (toast_tuple_target = 128); > ALTER TABLE temp_tbl

Re: Test to dump and restore objects left behind by regression

2025-08-05 Thread Michael Paquier
On Tue, Aug 05, 2025 at 08:11:41PM +0200, Alvaro Herrera wrote: > Cool, thanks, done. Now we need a volunteer to set up a buildfarm > animal with this flag ... Sure. I have added regress_dump_restore to the configuration of batta, hachi and gokiburi. -- Michael signature.asc Description: PGP s

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

2025-08-05 Thread Masahiko Sawada
On Tue, Aug 5, 2025 at 3:11 AM shveta malik wrote: > > On Tue, Aug 5, 2025 at 5:14 AM Masahiko Sawada wrote: > > > > On Mon, Aug 4, 2025 at 3:38 AM shveta malik wrote: > > > > > > On Sat, Aug 2, 2025 at 4:53 AM Masahiko Sawada > > > wrote: > > > > > > > > On Thu, Jul 31, 2025 at 5:00 AM Hayato

Re: Raw parse tree is not dumped to log

2025-08-05 Thread Chao Li
Updated the patch to v3 version. Chao Li (Evan) -- HighGo Software Inc. https://www.highgo.com/ Chao Li 于2025年8月5日周二 14:25写道: > CommitFests patch created: https://commitfest.postgresql.org/patch/5946/ > > 2025年8月4日 16:17,Chao Li 写道: > > I just noticed that my IDE a

Re: More protocol.h replacements this time into walsender.c

2025-08-05 Thread Euler Taveira
On Tue, Aug 5, 2025, at 4:58 PM, Nathan Bossart wrote: > Here is an updated patch that includes 1) added uses of PqMsg_* macros, 2) > new PqReplMsg_* macros, and 3) new PqBackupMsg_* macros. Thoughts? > -* 'd' means a standby reply wrapped in a CopyData packet. +*

Re: Add backup_type to pg_stat_progress_basebackup

2025-08-05 Thread Shinya Kato
On Wed, Aug 6, 2025 at 3:06 AM Masahiko Sawada wrote: > > On Mon, Aug 4, 2025 at 1:57 AM Yugo Nagata wrote: > > > > On Fri, 1 Aug 2025 16:12:15 -0700 > > Masahiko Sawada wrote: > > > > > The patch seems reasonably simple and looks good to me. I've updated > > > the comment in bbsink_progress_new

Re: index prefetching

2025-08-05 Thread Thomas Munro
On Wed, Aug 6, 2025 at 9:35 AM Peter Geoghegan wrote: > On Tue, Aug 5, 2025 at 4:56 PM Tomas Vondra wrote: > > True, the complex patch could prefetch the leaf pages. There must be a similar opportunity for parallel index scans. It has that "seize the scan" concept where parallel workers do one-

Re: Fixed a minor typo in code comment

2025-08-05 Thread 厉超
Looks like the attachment was missing from the original email, adding the attachment. -原始邮件- 发件人:"Chao Li" 发送时间:2025-08-06 07:10:32 (星期三) 收件人: pgsql-hack...@postgresql.org 主题: Fixed a minor typo in code comment Hi, I didn’t intend to modify the module, but noticed the typo while

Fixed a minor typo in code comment

2025-08-05 Thread Chao Li
Hi,I didn’t intend to modify the module, but noticed the typo while searching through the code. Submitting a patch to correct it.I ran a basic test of “make check” and the test passed. v1-0001-Fix-a-minor-typo-in-code-comment.patch Description: Binary data Chao Li (Evan)HighGo

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
On Tue, Aug 5, 2025 at 3:07 PM Masahiko Sawada wrote: > > On Tue, Aug 5, 2025 at 2:39 PM Tom Lane wrote: > > > > Masahiko Sawada writes: > > > On Tue, Aug 5, 2025 at 1:59 PM Tom Lane wrote: > > >> Maybe there's some strange cross-distro difference here, but > > >> what I'm wondering is if there

Re: fix ancient typo in transformRelOptions()

2025-08-05 Thread Álvaro Herrera
On 2025-Aug-05, Tom Lane wrote: > =?utf-8?Q?=C3=81lvaro?= Herrera writes: > > On 2025-Aug-05, Nathan Bossart wrote: > >> I noticed that this function has a "namspace" parameter. The attached > >> patch adds the missing 'e'. > > > I have vague recollections of it being this way because of "names

Re: fix ancient typo in transformRelOptions()

2025-08-05 Thread Tom Lane
=?utf-8?Q?=C3=81lvaro?= Herrera writes: > On 2025-Aug-05, Nathan Bossart wrote: >> I noticed that this function has a "namspace" parameter. The attached >> patch adds the missing 'e'. > I have vague recollections of it being this way because of "namespace" > being a C++ keyword. (commit is 3a5b

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
On Tue, Aug 5, 2025 at 2:39 PM Tom Lane wrote: > > Masahiko Sawada writes: > > On Tue, Aug 5, 2025 at 1:59 PM Tom Lane wrote: > >> Maybe there's some strange cross-distro difference here, but > >> what I'm wondering is if there's a difference in CFLAGS. > >> My build used > >> > >> CFLAGS = -Wal

Re: fix ancient typo in transformRelOptions()

2025-08-05 Thread Álvaro Herrera
On 2025-Aug-05, Nathan Bossart wrote: > I noticed that this function has a "namspace" parameter. The attached > patch adds the missing 'e'. I have vague recollections of it being this way because of "namespace" being a C++ keyword. (commit is 3a5b77371522, but I don't have energy to look for th

Re: More protocol.h replacements this time into walsender.c

2025-08-05 Thread Álvaro Herrera
On 2025-Aug-05, Nathan Bossart wrote: > Here is an updated patch that includes 1) added uses of PqMsg_* macros, 2) > new PqReplMsg_* macros, and 3) new PqBackupMsg_* macros. Thoughts? Hmm, I think if you're going to add the backup ones, then it'd be good to update ReceiveArchiveStreamChunk() to

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Tom Lane
Masahiko Sawada writes: > On Tue, Aug 5, 2025 at 1:59 PM Tom Lane wrote: >> Maybe there's some strange cross-distro difference here, but >> what I'm wondering is if there's a difference in CFLAGS. >> My build used >> >> CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith >> -Wdeclaration-after-

Re: index prefetching

2025-08-05 Thread Peter Geoghegan
On Tue, Aug 5, 2025 at 4:56 PM Tomas Vondra wrote: > Probably. It was hard to predict which values will be interesting, maybe > we can pick some subset now. I'll start by just doing larger steps, I > think. Maybe increase by 4x rather than 2x, that'll reduce the number of > combinations a lot. Als

Re: Function scan FDW pushdown

2025-08-05 Thread Álvaro Herrera
Hello, On 2024-Nov-05, g.kash...@postgrespro.ru wrote: > This is a long-overdue follow-up to the original patch. > Note that this patch contains only the changes required for > function scan pushdown, examples and code related to asymmetric > join are dropped. I've marked this as returned with f

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
4.2. > > > Hmm, I got the same warning with 14.3.1 (exact version shown below) so > > probably something is strange on my end: > > > % gcc --version > > gcc (GCC) 14.3.1 20250805 > > That's even more interesting. The specific late-model gcc versions > I ch

Re: index prefetching

2025-08-05 Thread Tomas Vondra
On 8/5/25 19:19, Peter Geoghegan wrote: > On Tue, Aug 5, 2025 at 10:52 AM Tomas Vondra wrote: >> I ran some more tests, comparing the two patches, using data sets >> generated in a way to have a more gradual transition between correlated >> and random cases. > > Cool. > >> So this fuzz is the

fix ancient typo in transformRelOptions()

2025-08-05 Thread Nathan Bossart
I noticed that this function has a "namspace" parameter. The attached patch adds the missing 'e'. -- nathan >From 3f1431517cee250f1280adca739de0d6b9c77080 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 5 Aug 2025 16:01:34 -0500 Subject: [PATCH v1 1/1] fix ancient typo in transformRelO

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Tom Lane
low) so > probably something is strange on my end: > % gcc --version > gcc (GCC) 14.3.1 20250805 That's even more interesting. The specific late-model gcc versions I checked were from Fedora 41: $ gcc --version gcc (GCC) 14.3.1 20250523 (Red Hat 14.3.1-1) and Fedora 42: gcc (GCC) 1

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
the culprit. FYI I'm using gcc 14.2.1. > > Interesting. I did not see such warnings with gcc 14.3.1, 15.1.1, > nor older gcc versions. Must be something peculiar to 14.2. Hmm, I got the same warning with 14.3.1 (exact version shown below) so probably something is strange on my end

Re: Bug in brin_minmax_multi_distance_numeric()

2025-08-05 Thread Tom Lane
Tomas Vondra writes: > On 8/5/25 20:11, Tom Lane wrote: >> Yes, I think it ought to be committed/backpatched separately. >> I was expecting Tomas to do that, but I can if he's busy ... > Sorry, I didn't realize that - it seemed you're handling this. I can > take care of this in the next couple da

Re: Bug in brin_minmax_multi_distance_numeric()

2025-08-05 Thread Tomas Vondra
On 8/5/25 20:11, Tom Lane wrote: > Peter Eisentraut writes: >> Do we want to make a separate commit for this issue that can be >> backpatched and have some user-facing information attached to it? > > Yes, I think it ought to be committed/backpatched separately. > I was expecting Tomas to do that

Re: Dead code with short varlenas in toast_save_datum()

2025-08-05 Thread Nikita Malakhov
Hi, Nikhil, thank you! This case should be added to regressions. On Tue, Aug 5, 2025 at 8:26 PM Nikhil Kumar Veldanda < veldanda.nikhilkuma...@gmail.com> wrote: > Hi all, > > On Sun, Aug 3, 2025 at 8:16 PM Michael Paquier > wrote: > > if (VARATT_IS_SHORT(dval)) > > { > > data_p

Re: More protocol.h replacements this time into walsender.c

2025-08-05 Thread Nathan Bossart
Here is an updated patch that includes 1) added uses of PqMsg_* macros, 2) new PqReplMsg_* macros, and 3) new PqBackupMsg_* macros. Thoughts? -- nathan >From 6a1d03725009837c5ce99dcfc283fa565d587d13 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 5 Aug 2025 14:53:42 -0500 Subject: [PAT

Re: [Patch] remove duplicated smgrclose

2025-08-05 Thread Álvaro Herrera
Hello, On 2024-Aug-09, Kirill Reshke wrote: > Hi all! > This change looks good to me. However, i have an objection to these > lines from v2: > > > /* Close the forks at smgr level */ > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++) > > - smgrsw[which].smgr_close(rels[i], forknum); > >

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-08-05 Thread Jacob Champion
On Fri, Jul 18, 2025 at 4:31 PM Jacob Champion wrote: > Your earlier mail made me worried I'd missed something, but is the > attached diff what Andres was asking for? A `ninja clean; ninja > install-quiet` now works for me with this applied. Ping. I'll plan to commit this by the beta3 cutoff but

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Tom Lane
Masahiko Sawada writes: > I got the following compiler warning: > % make -C src/backend/storage/large_object > inv_api.c: In function ‘inv_write’: > inv_api.c:565:29: warning: ‘workbuf’ may be used uninitialized > [-Wmaybe-uninitialized] > 565 | char *workb = VARDATA(&workbuf.hdr

Re: printtup.c: error: ‘VARSIZE_ANY’ makes pointer from integer when USE_VALGRIND is defined

2025-08-05 Thread Tom Lane
Dmitry Mityugov writes: > When USE_VALGRIND is defined, compilation started to fail with this > error message (-Werror is used; without it, a warning is observed > instead): > printtup.c:353:95: error: passing argument 1 of ‘VARSIZE_ANY’ makes > pointer from integer without a cast [-Wint-conver

Re: Test to dump and restore objects left behind by regression

2025-08-05 Thread Alvaro Herrera
On 2025-Aug-05, Tom Lane wrote: > Daniel Gustafsson writes: > > Thanks for reviving this. I am +1 on placing this behind PG_TEST_EXTRA as > > was > > discussed upthread. > > +1 here too. Cool, thanks, done. Now we need a volunteer to set up a buildfarm animal with this flag ... -- Álvaro H

Re: Bug in brin_minmax_multi_distance_numeric()

2025-08-05 Thread Tom Lane
Peter Eisentraut writes: > Do we want to make a separate commit for this issue that can be > backpatched and have some user-facing information attached to it? Yes, I think it ought to be committed/backpatched separately. I was expecting Tomas to do that, but I can if he's busy ...

headerscheck warnings with late-model gcc

2025-08-05 Thread Tom Lane
Using gcc 15.1.1 (from Fedora 42) I see these warnings that didn't appear with older gcc: $ src/tools/pginclude/headerscheck In file included from /tmp/headerscheck.xp0AI5/test.c:2: ./src/common/kwlist_d.h:1163:23: warning: no previous declaration for 'ScanKeywords' [-Wmissing-variable-declaratio

Re: Datum as struct

2025-08-05 Thread Peter Eisentraut
> diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c > index 25cff56c3d0..e640b48205b 100644 > --- a/src/backend/utils/adt/timestamp.c > +++ b/src/backend/utils/adt/timestamp.c > @@ -4954,7 +4954,7 @@ timestamptz_trunc_internal(text *units, TimestampTz timestamp,

Re: Add backup_type to pg_stat_progress_basebackup

2025-08-05 Thread Masahiko Sawada
On Mon, Aug 4, 2025 at 1:57 AM Yugo Nagata wrote: > > On Fri, 1 Aug 2025 16:12:15 -0700 > Masahiko Sawada wrote: > > > The patch seems reasonably simple and looks good to me. I've updated > > the comment in bbsink_progress_new() and attached the modified version > > patch (with the commit message

Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators

2025-08-05 Thread Jeff Davis
On Tue, 2025-08-05 at 14:15 +0200, Álvaro Herrera wrote: > Here's a rebased version of this patch.  I didn't review it or touch > it > in any way, just fixed conflicts from current master. James, Patch 0001 is doing too much. For a first step, I think it would be useful to create a new field for

printtup.c: error: ‘VARSIZE_ANY’ makes pointer from integer when USE_VALGRIND is defined

2025-08-05 Thread Dmitry Mityugov
When USE_VALGRIND is defined, compilation started to fail with this error message (-Werror is used; without it, a warning is observed instead): printtup.c:353:95: error: passing argument 1 of ‘VARSIZE_ANY’ makes pointer from integer without a cast [-Wint-conversion] Not sure if this is the b

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
Hi, On Tue, Aug 5, 2025 at 9:42 AM Peter Eisentraut wrote: > > On 03.08.25 22:20, Tom Lane wrote: > > It looks like the majority vote is still in favor of writing out > > DatumGetPointer instead of using "_D()" functions, so let's roll > > with that approach. > > > > I looked through our two vers

Re: cpluspluscheck vs ICU again

2025-08-05 Thread Tom Lane
John Naylor writes: > On Mon, Jul 7, 2025 at 11:06 PM Tom Lane wrote: >> John Naylor writes: >>> I see that now. If extensions follow the practice of including system >>> headers before Postgres headers, it should be fine. I've attached v2 >>> which removes the useless #undef and drafts an expla

Re: Dead code with short varlenas in toast_save_datum()

2025-08-05 Thread Nikhil Kumar Veldanda
Hi all, On Sun, Aug 3, 2025 at 8:16 PM Michael Paquier wrote: > if (VARATT_IS_SHORT(dval)) > { > data_p = VARDATA_SHORT(dval); > data_todo = VARSIZE_SHORT(dval) - VARHDRSZ_SHORT; > toast_pointer.va_rawsize = data_todo + VARHDRSZ;/* as if not > short */ >

Re: Bug in brin_minmax_multi_distance_numeric()

2025-08-05 Thread Peter Eisentraut
On 01.08.25 19:17, Tomas Vondra wrote: On 7/31/25 20:35, Tom Lane wrote: Tomas Vondra writes: On 7/31/25 19:33, Tom Lane wrote: ... It is certainly broken on 32-bit machines where the Datum result of numeric_float8 will be a pointer, so that we will convert the numeric pointer value to a fl

pgaio_io_get_id() type (was Re: Datum as struct)

2025-08-05 Thread Peter Eisentraut
On 31.07.25 19:17, Tom Lane wrote: Also I see a "// XXX" in pg_get_aios, which I guess is a note to confirm the data type to use for ioh_id? Yes, the stuff returned from pgaio_io_get_id() should be int, but some code uses uint32, and also UINT32_MAX as a special marker. Here is a patch that

Re: index prefetching

2025-08-05 Thread Peter Geoghegan
On Tue, Aug 5, 2025 at 10:52 AM Tomas Vondra wrote: > I ran some more tests, comparing the two patches, using data sets > generated in a way to have a more gradual transition between correlated > and random cases. Cool. > So this fuzz is the primary knob. Obviously, incrementing fuzz by "1" it >

Re: ReplicationSlotRelease() crashes when the instance is in the single user mode

2025-08-05 Thread Paul A Jungwirth
Mutaamba (cc'd) and I reviewed this patch together. To summarize the patch and thread so far: The patch adds a new function, CheckSlotIsInSingleUserMode. If true then we raise an error. Otherwise we would trip an assert in ReplicationSlotRelease requiring the slot to have an active_pid, which is n

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Tom Lane
Peter Eisentraut writes: > I committed this with the required prerequisite patches. That concludes > this thread, I think. I'll follow up on the remaining work in the > "Datum as struct" thread, and the work in the "8 byte Datums" thread can > also continue. Thanks! The "8 byte Datums" work

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Peter Eisentraut
On 03.08.25 22:20, Tom Lane wrote: It looks like the majority vote is still in favor of writing out DatumGetPointer instead of using "_D()" functions, so let's roll with that approach. I looked through our two versions of the varatt.h changes and merged them. The attached is only cosmetically d

Re: libpq-oauth: a mid-beta naming check

2025-08-05 Thread Christoph Berg
Re: Jacob Champion > On Tue, Aug 5, 2025 at 2:39 AM Jelte Fennema-Nio wrote: > > On Tue, 5 Aug 2025 at 01:20, Jacob Champion > > wrote: > > > So, as we approach Beta 3: can anyone think of a way that this plan will > > > fail? > > > > It's not entirely clear what plan exactly you talk about here

Re: Improve LWLock tranche name visibility across backends

2025-08-05 Thread Sami Imseih
Thanks for reviewing! > Issue 1 -- > > If I register enough tranches to go to: > > + /* Resize if needed */ > + if (LWLockTrancheNames.shmem->count >= > LWLockTrancheNames.shmem->allocated) > + { > + newalloc = > pg_nextpower2_32(Ma

Re: libpq-oauth: a mid-beta naming check

2025-08-05 Thread Jacob Champion
On Tue, Aug 5, 2025 at 2:39 AM Jelte Fennema-Nio wrote: > On Tue, 5 Aug 2025 at 01:20, Jacob Champion > wrote: > > So, as we approach Beta 3: can anyone think of a way that this plan will > > fail? > > It's not entirely clear what plan exactly you talk about here. Are you > saying you want to re

Re: IPC/MultixactCreation on the Standby server

2025-08-05 Thread Dmitry
On 31.07.2025 09:29, Andrey Borodin wrote: Here's an updated two patches, one for Postgres 17 and one for mater(with a test). I ran tests on PG17 with patch v9. I tried to reproduce it for three cases, the first when we explicitly use for key share, the second through subtransactions and the t

Re: Test to dump and restore objects left behind by regression

2025-08-05 Thread Tom Lane
Daniel Gustafsson writes: > Thanks for reviving this. I am +1 on placing this behind PG_TEST_EXTRA as was > discussed upthread. +1 here too. regards, tom lane

Re: don't include tableam.h in nbtree.h

2025-08-05 Thread Bertrand Drouvot
Hi, On Tue, Aug 05, 2025 at 01:09:57PM +0200, Álvaro Herrera wrote: > I noticed that nbtree.h includes tableam.h. This seems rather random > and unnecessary. This patch removes it and fixes fallout, which is > pretty minimal. We do need to add a forward declaration of struct > TM_IndexDeleteOp

Re: Test to dump and restore objects left behind by regression

2025-08-05 Thread Daniel Gustafsson
> On 5 Aug 2025, at 16:33, Alvaro Herrera wrote: > I happened to notice that this item was still open in the commitfest, > and rereading the thread I now have second thoughts about having it > enabled by default, giving your complaints about speed. How about > applying this to 18 and master? Th

Re: Test to dump and restore objects left behind by regression

2025-08-05 Thread Alvaro Herrera
Hello, On 2025-Apr-04, Andres Freund wrote: > FWIW, with cassert and -O2, it's: > > 17: > real0m53.981s > user3m22.837s > sys 3m24.237s > > HEAD: > real1m19.749s > user4m54.526s > sys 4m15.657s > > so this isn't just due to me using

Re: Implement waiting for wal lsn replay: reloaded

2025-08-05 Thread Álvaro Herrera
On 2025-Apr-29, Alexander Korotkov wrote: > > 11) WaitLSNProcInfo / WaitLSNState > > > > Does this need to be exposed in xlogwait.h? These structs seem private > > to xlogwait.c, so maybe declare it there? > > Hmm, I don't remember why I moved them to xlogwait.h. OK, moved them > back to xlogwai

Re: Dead code with short varlenas in toast_save_datum()

2025-08-05 Thread Nikita Malakhov
Hi! Michael, as far as I understand while externalizing tuple we always check tuple size with toast_tuple_find_biggest_attribute(), where biggest attribute size is always >= MAXALIGN(TOAST_POINTER_SIZE) so currently I cannot see how it is possible to get into VARATT_IS_SHORT branch. I've commente

Re: [PING] fallocate() causes btrfs to never compress postgresql files

2025-08-05 Thread Thomas Munro
On Tue, Jul 29, 2025 at 6:52 PM Magnus Hagander wrote: > Not just to throw a wrench in there, but... Should this perhaps be a > tablespace option? ISTM having different filesystems for them is a good > reason to use tablespaces in the first place, and then being able to pick > different options

Re: Showing applied extended statistics in explain Part 2

2025-08-05 Thread Álvaro Herrera
I rebased this patch series; here it applies to current master. I didn't review it or change anything. -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/ "Hay que recordar que la existencia en el cosmos, y particularmente la elaboración de civilizaciones dentro de é

Proposal: Conflict log history table for Logical Replication

2025-08-05 Thread Dilip Kumar
Currently we log conflicts to the server's log file and updates, this approach has limitations, 1) Difficult to query and analyze, parsing plain text log files for conflict details is inefficient. 2) Lack of structured data, key conflict attributes (table, operation, old/new data, LSN, etc.) are no

Kernel AIO on FreeBSD, macOS and a couple of other Unixen

2025-08-05 Thread Thomas Munro
Hi, Here is a proof-of-concept patch for io_method=posix_aio. It works pretty well on FreeBSD, making good use of a couple of extensions. It's working better than all my previous attempts on macOS, but I guess it's more of a curiosity for developers, and scan performance is also affected by the

Re: amcheck support for BRIN indexes

2025-08-05 Thread Álvaro Herrera
On 2025-Jul-08, Tomas Vondra wrote: > On 7/8/25 14:40, Arseniy Mukhin wrote: > > Thank you for the feedback! I agree with the benefits. Speaking of > > (с), it seems most of the time to be really trivial to build such a > > ScanKey, but not every opclass supports '=' operator. amcheck should > >

Re: Dropping publication breaks logical replication

2025-08-05 Thread vignesh C
On Mon, 4 Aug 2025 at 09:47, Ashutosh Bapat wrote: > > Hi Vignesh, > Thanks for the patches. > > On Sat, Aug 2, 2025 at 7:10 PM vignesh C wrote: > > > > > > > The backport seems to be straight forward. Please let me know if you > > > need my help in doing so, if we decide to backport the fix. > >

don't include tableam.h in nbtree.h

2025-08-05 Thread Álvaro Herrera
I noticed that nbtree.h includes tableam.h. This seems rather random and unnecessary. This patch removes it and fixes fallout, which is pretty minimal. We do need to add a forward declaration of struct TM_IndexDeleteOp (whose full definition appears in tableam.h) so that _bt_delitems_delete_chec

Re: restore_command return code behaviour

2025-08-05 Thread Jean-Christophe Arnu
Le lun. 4 août 2025, 04:45, David G. Johnston a écrit : > > How about: > > Recovery will abort and the server will not start up upon any of the > following: > the shell is unable to execute the command (due to it not being found or > executable), > the command returns an exit status greater than

Re: GB18030-2022 Support in PostgreSQL

2025-08-05 Thread John Naylor
On Tue, Aug 5, 2025 at 1:22 PM Chao Li wrote: > > 2025年8月4日 21:51,Tom Lane wrote: > > So on the whole I'd lean a bit towards just redefining GB18030 as > meaning the new standard. The fact that we don't support it as a > server-side encoding perhaps makes that idea more tenable than it > would b

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

2025-08-05 Thread shveta malik
On Tue, Aug 5, 2025 at 5:14 AM Masahiko Sawada wrote: > > On Mon, Aug 4, 2025 at 3:38 AM shveta malik wrote: > > > > On Sat, Aug 2, 2025 at 4:53 AM Masahiko Sawada > > wrote: > > > > > > On Thu, Jul 31, 2025 at 5:00 AM Hayato Kuroda (Fujitsu) > > > wrote: > > > > > > > > Dear Sawada-san, > > >

Re: Improve LWLock tranche name visibility across backends

2025-08-05 Thread Bertrand Drouvot
Hi, On Mon, Aug 04, 2025 at 10:47:45PM -0500, Sami Imseih wrote: > > > > With a local hash table, I don't think it's necessary to introduce new > > > > code for managing > > > > a DSA based list of tranche names as is done in v3. We can go back to > > > > storing the shared > > > > trance names in

Re: encode/decode support for base64url

2025-08-05 Thread Florents Tselai
On 1 Aug 2025, at 1:13 PM, Florents Tselai wrote:On Tue, Jul 29, 2025 at 3:25 PM Daniel Gustafsson wrote:> On 12 Jul 2025, at 21:40, David E. Wheeler wrote: > Thank you! This looks great. The attached revision makes a a couple of minor changes: I also ha

Re: libpq-oauth: a mid-beta naming check

2025-08-05 Thread Jelte Fennema-Nio
On Tue, 5 Aug 2025 at 01:20, Jacob Champion wrote: > As far as I know, that > work necessarily includes designing a stable ABI and figuring out a > trusted place that users can put their plugins into. If we can do > both, I think we can get rid of the -MAJOR versioning scheme entirely, > because o

Re: CREATE PUBLICATION with 'publish_generated_columns' parameter specified but unassigned

2025-08-05 Thread vignesh C
On Tue, 5 Aug 2025 at 12:52, Peter Smith wrote: > > On Tue, Aug 5, 2025 at 4:43 PM Amit Kapila wrote: > > > > On Tue, Aug 5, 2025 at 11:57 AM Peter Smith wrote: > > > > > > On Tue, Aug 5, 2025 at 2:28 PM vignesh C wrote: > > > > > > > > On Tue, 5 Aug 2025 at 05:35, Peter Smith wrote: > > > > >

Re: Adding REPACK [concurrently]

2025-08-05 Thread Antonin Houska
Alvaro Herrera wrote: > I made a few changes from Antonin's original at [2]. First, I modified > the grammar to support "REPACK [tab] USING INDEX" without specifying the > index name. With this change, all possibilities of the old commands are > covered, ... > Here's a list of existing comman

Re: Bug in pg_dump --filter? - Invalid object types can be misinterpreted as valid

2025-08-05 Thread Daniel Gustafsson
> On 4 Aug 2025, at 17:18, Fujii Masao wrote: I missed this thread while being on vacation, thanks for finding and fixing this! > This also got me thinking, if we simply define keywords as strings of > non-whitespace characters, maybe we don't need to change the term "keyword" > to "token" at al

Re: CREATE PUBLICATION with 'publish_generated_columns' parameter specified but unassigned

2025-08-05 Thread Peter Smith
On Tue, Aug 5, 2025 at 4:43 PM Amit Kapila wrote: > > On Tue, Aug 5, 2025 at 11:57 AM Peter Smith wrote: > > > > On Tue, Aug 5, 2025 at 2:28 PM vignesh C wrote: > > > > > > On Tue, 5 Aug 2025 at 05:35, Peter Smith wrote: > > > > > > > > Here is a v1 patch, where: > > > > > > > > - now user gets

Re: Add 64-bit XIDs into PostgreSQL 15

2025-08-05 Thread Evgeny Voropaev
Hello hackers! I still have not created a TAP-test allowing for narrowing the problem of page inconsistency with a WAL-redo-Heap/INSERT+INIT operation. But the next script allows us to replay the problem during more common and more general tests. 1. Do not apply a fix for this problem or use