Re: Possibly hard-to-read message

2025-06-11 Thread Peter Eisentraut
On 11.06.25 11:36, Daniel Gustafsson wrote: On 5 Jun 2025, at 13:14, Peter Eisentraut wrote: On 07.04.25 02:55, Daniel Gustafsson wrote: On 7 Apr 2025, at 02:43, David G. Johnston wrote: How about: + "if set to a number, overrides the default two second \\watch interval\n" I do like

confusing message in check_tuple

2025-06-11 Thread jian he
hi. in contrib/amcheck/verify_heapam.c, check_tuple report_corruption(ctx, psprintf("number of attributes %u exceeds maximum expected for table %u", ctx->natts, RelationGetDescr(ctx->rel)->natts

Re: Fix slot synchronization with two_phase decoding enabled

2025-06-11 Thread shveta malik
On Wed, Jun 11, 2025 at 11:31 PM Masahiko Sawada wrote: > > BTW have we addressed the point Amit mentioned before[1]? > > > The one more combination to consider is when someone takes a dump of > > an older version and loads it into a newer version. For example, where > > users dump from 17.5 and

Re: pg_get_multixact_members not documented

2025-06-11 Thread Sami Imseih
> Attached patch removing extra comma. Otherwise LGTM. Thanks! For v4, the final comma in the list is grammatically correct, and it’s the style we use throughout the docs. I marked the patch RFC. -- Sami

Re: Replication slot is not able to sync up

2025-06-11 Thread shveta malik
On Thu, Jun 12, 2025 at 4:13 AM Peter Smith wrote: > > Phrases like "... it is recommended..." and "... intended for testing > and debugging .. " and "... should be used with caution." and "... it > is advisable to..." seem like indicators that parts of the above > description should be using SGML

Re: Non-reproducible AIO failure

2025-06-11 Thread Konstantin Knizhnik
I tried to catch moment when memory is changed using mprotect. I have aligned PgAioHandle on page boundary (16kb at MacOS), and disable writes in `pgaio_io_reclaim`: ``` static void pgaio_io_reclaim(PgAioHandle *ioh) {    RESUME_INTERRUPTS();     rc = mprotect(ioh, sizeof(*ioh), PROT_READ);    

Proposal to allow DELETE/UPDATE on partitioned tables with unsupported foreign partitions

2025-06-11 Thread Shirisha Shirisha
Hello Hackers, We’d like to propose a change to improve DELETE and UPDATE behavior on partitioned tables containing foreign partitions. Currently, DELETE or UPDATE (D/U) on a partitioned table with foreign partitions fails with an error as below, if the FDW does not support the operation:

Re: pg_get_multixact_members not documented

2025-06-11 Thread Ashutosh Bapat
On Wed, Jun 11, 2025 at 9:44 PM Sami Imseih wrote: > > It's not clear, without some effort, which lock mode go with which row > lock in that description. > > For example, "keysh" does not have "for" in it but "fornokeyupd" does. > How about rephrasing this > > as "The lock modes "keysh", "sh", fo

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

2025-06-11 Thread Tatsuo Ishii
> Dear Kuroda-san, > > 2025年6月11日(水) 13:48 Hayato Kuroda (Fujitsu) : >> > I have also attached a part of the PDF generated with both 0001 and >> > 0002 applied for your reference. >> >> The patch is cleanly created, and +1 for all contents. > > Thank you very much for your review and for confirmi

Proposal for Improving Concurrent Index Creation Performance

2025-06-11 Thread Sergey Sargsyan
Hi PostgreSQL Hackers, I've been exploring the process of concurrent index creation and noticed a potential area for performance improvement, especially for large indexes. Currently, the process involves multiple stages: creating the index (initially invalid and not ready), builing the index, vali

RE: Missing program_XXX calling in pgbench tests

2025-06-11 Thread Hayato Kuroda (Fujitsu)
Dear Fujii-san, > +1 to focusing on the 0001 patch. > > Since this isn't a bug fix, I'm not sure back-patching is strictly necessary. > That said, it does improve consistency and test coverage, e.g., by adding > checks > like help text length, so I'd be fine with back-patching if others see valu

Re: failover logical replication slots

2025-06-11 Thread Amit Kapila
On Wed, Jun 11, 2025 at 10:17 PM Fabrice Chapuis wrote: > > Thanks for your reply. > The problem I see is that after creating a new subscription, we have: > > 1) if a failover occurs, on the new primary node, the failover and sync flags > are both set to true, so there's no problem. > > 2) when t

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

2025-06-11 Thread Michael Paquier
On Mon, May 26, 2025 at 10:04:05AM +0900, Sutou Kouhei wrote: > As I already said, I don't have a strong opinion on which > approach is better. My opinion for the (important) second > point is no. I feel that the pros of a. isn't realistic. If > users want to improve text/csv/binary performance (or

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

2025-06-11 Thread Noboru Saito
Dear Kuroda-san, 2025年6月11日(水) 13:48 Hayato Kuroda (Fujitsu) : > > I have also attached a part of the PDF generated with both 0001 and > > 0002 applied for your reference. > > The patch is cleanly created, and +1 for all contents. Thank you very much for your review and for confirming the patch c

Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward

2025-06-11 Thread Dimitrios Apostolou
On Wed, 11 Jun 2025, Nathan Bossart wrote: On Wed, Jun 11, 2025 at 12:32:58AM +0200, Dimitrios Apostolou wrote: what read-seek pattern do you see on the system call level (as shown by strace)? In pg_restore it was a constant loop of read(4K)-lseek(8-16K). For fseeko(), sizes less than 4096 pr

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

2025-06-11 Thread Tatsuo Ishii
> One thing I worry about the patch is, now the non-nulls array > optimization was removed. Since then I have been thinking about if > there could be other way to optimize searching for non null rows. Here is the v12 patch to implement the optimization on top of Oliver's v11 patch. Only src/backe

Re: Replication slot is not able to sync up

2025-06-11 Thread Peter Smith
On Wed, Jun 11, 2025 at 8:53 PM Amit Kapila wrote: > > On Wed, Jun 11, 2025 at 7:19 AM shveta malik wrote: > > > > On Tue, Jun 10, 2025 at 3:20 PM Zhijie Hou (Fujitsu) > > wrote: > > > > > > > > > Thanks for updating the patch. > > > > > > I have few suggestions for the document from a user's pe

Re: Fix slot synchronization with two_phase decoding enabled

2025-06-11 Thread Peter Smith
On Wed, Jun 11, 2025 at 8:16 PM Ajin Cherian wrote: > > On Fri, Jun 6, 2025 at 5:07 PM Nisha Moond wrote: > > > > > > Attached v18 patch. > > - patch-001: modified error messages as suggested above. > > - patch-002: improved pg_dump docs as per Shveta's off-list suggestions. > > > > [1] > > ht

Re: Replace some %llu remnants in the tree

2025-06-11 Thread Michael Paquier
On Wed, Jun 11, 2025 at 09:58:00AM +0200, Peter Eisentraut wrote: > On 09.06.25 05:59, Michael Paquier wrote: >> That's not necessarily mandatory for v18, for sure, but as this is new >> code we could as well clean it up before forking the next stable >> branch. > > Agree this should go into v18.

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

2025-06-11 Thread Sami Imseih
I tested v6 and I think GetNamedDSA is a good addition. I did not find any issues with the code. However, I am still convinced that GetNamedDSMHash should not append " Hash" to the tranche name of the dshash [0]. I am ok with " DSA" because the DSA tranche is created implicitly by the API. Also,

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-06-11 Thread Peter Geoghegan
On Fri, May 2, 2025 at 3:04 PM Peter Geoghegan wrote: > The second patch is more complicated, and seems like something that > I'll need to spend more time thinking about before proceeding with > commit. It has subtle behavioral implications, in that it causes the > pstate.forcenonrequired mechanis

Re: [19] Proposal: function markers to indicate collation/ctype sensitivity

2025-06-11 Thread Jeff Davis
On Wed, 2025-06-11 at 09:03 +0200, Peter Eisentraut wrote: > I think no matter how we slice it, there is going to be some case > that > will be degraded until some update is applied. The problem I see is a conflict between two goals: 1. Record appropriate dependencies if a function is sensitive

Re: Fix slot synchronization with two_phase decoding enabled

2025-06-11 Thread Masahiko Sawada
On Fri, Jun 6, 2025 at 12:07 AM Nisha Moond wrote: > > On Thu, Jun 5, 2025 at 3:26 PM Dilip Kumar wrote: > > > > On Thu, Jun 5, 2025 at 2:53 PM Dilip Kumar wrote: > > > > > > On Tue, Jun 3, 2025 at 11:05 AM Nisha Moond > > > wrote: > > > > > > > > > > > > Attached v17 patches. Added a top-up p

Re: Inconsistent Behavior in JSONB Numeric Array Deletion

2025-06-11 Thread David E. Wheeler
On Jun 11, 2025, at 17:43, Tom Lane wrote: > I fear that that would cause some problems. Consider > > regression=# select '["foo", "bar"]'::jsonb - 'bar'; > ?column? > -- > ["foo"] > (1 row) > > Right now we resolve the unlabeled literal as type text. > But if jsonb - jsonb existed, w

Re: Inconsistent Behavior in JSONB Numeric Array Deletion

2025-06-11 Thread Tom Lane
"David E. Wheeler" writes: > Bear in mind that `-` currently does both. Of the three current variants, the > first two delete from an array by value: > * jsonb - text: Deletes a key (and its value) from a JSON object, or matching > string value(s) from a JSON array. > * jsonb - text[] → jsonb:

Re: CHECKPOINT unlogged data

2025-06-11 Thread Nathan Bossart
On Wed, Jun 11, 2025 at 05:53:15PM +0200, Christoph Berg wrote: > Ack, done in v4. Thanks! The overall shape of these patches looks pretty good to me. I'll aim to give them a deeper review in the near future. -- nathan

Re: Inconsistent Behavior in JSONB Numeric Array Deletion

2025-06-11 Thread David E. Wheeler
On Jun 11, 2025, at 16:03, Robert Haas wrote: > The proposed behavior of the operator you want to add would be > inconsistent with the existing integer subtraction operator, because > the former would remove by value and the latter removes by index. Bear in mind that `-` currently does both. Of

Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward

2025-06-11 Thread Nathan Bossart
On Wed, Jun 11, 2025 at 12:32:58AM +0200, Dimitrios Apostolou wrote: > Thank you for benchmarking! Before answering in more depth, I'm curious, > what read-seek pattern do you see on the system call level (as shown by > strace)? In pg_restore it was a constant loop of read(4K)-lseek(8-16K). For fs

Re: [BUG] Cannot flush buffers of temp table deleted from other session

2025-06-11 Thread Daniil Davydov
Hi, On Thu, Jun 12, 2025 at 2:40 AM Tom Lane wrote: > > Daniil Davydov <3daniss...@gmail.com> writes: > > Ability to do a DROP temporary table of other session leads to error : > > [ shrug... ] Don't do that. A superuser is capable of doing lots > of things that will break the database, and thi

Re: [BUG] Cannot flush buffers of temp table deleted from other session

2025-06-11 Thread Tom Lane
Daniil Davydov <3daniss...@gmail.com> writes: > Ability to do a DROP temporary table of other session leads to error : [ shrug... ] Don't do that. A superuser is capable of doing lots of things that will break the database, and this one hardly seems like one of the worse ones. > BTW, there are

Re: PG 18 release notes draft committed

2025-06-11 Thread Bruce Momjian
On Wed, Jun 11, 2025 at 02:45:58PM -0400, Melanie Plageman wrote: > On Thu, May 29, 2025 at 12:41 PM Bruce Momjian wrote: > > > > On Thu, May 29, 2025 at 09:42:30AM -0400, Melanie Plageman wrote: > > > > > "Add an asynchronous I/O subsystem" > > > I noticed in the PG 17 release notes [1] we did in

Re: Inconsistent Behavior in JSONB Numeric Array Deletion

2025-06-11 Thread Robert Haas
On Tue, Jun 10, 2025 at 4:52 PM Mark Dake wrote: > SELECT jsonb('[2,3,1]') @> to_jsonb(1); > -- Returns true > > However, when attempting to remove that value from the array using -, the > operation fails: > SELECT jsonb('[2,3,1]') - to_jsonb(1); > -- ERROR: operator does not exist: jsonb - jsonb

[BUG] Cannot flush buffers of temp table deleted from other session

2025-06-11 Thread Daniil Davydov
Hi, Ability to do a DROP temporary table of other session leads to error : session 1 : create temp table test (id int); -- let's assume that 'test' will be placed in schema 'pg_temp_0' and has relfilepath 'base/5/t0_16390' insert into test select generate_series(1, 1000); -- make few buffers dirty

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

2025-06-11 Thread Nathan Bossart
Here is a new patch with GetNamedDSA() added. A couple notes: * I originally wanted to use GetNamedDSA() within GetNamedDSMHash(), but that would probably lead to two registry entries per dshash table, and it didn't really save all that much code, anyway. So, I didn't do that. * Using a DSA

Re: [BUG] Cannot flush buffers of temp table deleted from other session

2025-06-11 Thread Daniil Davydov
> > BTW, there are other bugs that can occur during interacting with other > session temp tables. I described them and suggested corrections in > this thread [1]. > > [1] > https://www.postgresql.org/message-id/flat/CAJDiXgj72Axj0d4ojKdRWG_rnkfs4uWY414NL%3D15sCvh7-9rwg%40mail.gmail.com Sorry, thi

Re: Remaining dependency on setlocale()

2025-06-11 Thread Jeff Davis
On Tue, 2025-06-10 at 17:32 +0200, Peter Eisentraut wrote: > v1-0001-copyfromparse.c-use-pg_ascii_tolower-rather-than-.patch > v1-0002-contrib-spi-refint.c-use-pg_ascii_tolower-instead.patch > v1-0003-isn.c-use-pg_ascii_toupper-instead-of-toupper.patch > v1-0004-inet_net_pton.c-use-pg_ascii_tolower

Re: Inconsistent Behavior in JSONB Numeric Array Deletion

2025-06-11 Thread David E. Wheeler
On Jun 7, 2025, at 16:20, Mark Dake wrote: > Support a jsonb - jsonb operator where, if the RHS is a scalar that appears > in the LHS array, the operator removes all matching values: > SELECT jsonb('[2,3,1]') - to_jsonb(1); > -- Expected: [2, 3] > This would mirror similar behavior in many appli

Re: Safeguards against incorrect fd flags for fsync()

2025-06-11 Thread Michael Banck
On Tue, Jun 10, 2025 at 09:09:35PM -0400, Tom Lane wrote: > Still, I'd like to be closer to having a working Hurd buildfarm member > before we take a portability risk that would only benefit Hurd. I've spent some more time on this, here's the status beyond make check: 1. The pg_stat_statements en

Re: CREATE DATABASE command for non-libc providers

2025-06-11 Thread Jeff Davis
On Tue, 2025-06-10 at 23:44 +0200, Daniel Verite wrote: > I may miss something, but I don't see a > technical reason why this code could not be taught to call the > equivalent > functions of the current collation provider, following the same > principles > as the regex code. The main challenge is

Re: Improve tab completion for COPY

2025-06-11 Thread Masahiko Sawada
On Tue, Jun 10, 2025 at 1:33 PM Nathan Bossart wrote: > > On Tue, Jun 10, 2025 at 12:37:48PM -0700, Masahiko Sawada wrote: > >> > (1) adds tab completion support for the REJECT_LIMIT option, which was > >> > introduced in v18 > >> > (2) splits the tab completion logic between COPY FROM and COPY TO

Performance optimization for ANALYZE with extended statistics (dependencies)

2025-06-11 Thread Ilia Evdokimov
Hi hackers, When calculating functional dependencies for extended statistics (dependencies), the current implementation always sorts rows in sample to measure the degree of dependency between columns. However, if the column a8 in the dependency list has ndistinct = 1 (all values are the same

Re: PG 18 release notes draft committed

2025-06-11 Thread Melanie Plageman
On Thu, May 29, 2025 at 12:41 PM Bruce Momjian wrote: > > On Thu, May 29, 2025 at 09:42:30AM -0400, Melanie Plageman wrote: > > > > "Add an asynchronous I/O subsystem" > > I noticed in the PG 17 release notes [1] we did include the shas of > > each of the commits for the read stream users. Should

Re: Batch TIDs lookup in ambulkdelete

2025-06-11 Thread Masahiko Sawada
On Mon, Jun 9, 2025 at 4:03 AM John Naylor wrote: > > On Sat, Jun 7, 2025 at 4:34 AM Masahiko Sawada wrote: > > BTW I found that the constant 'maxblkno' in test_tidstore.sql actually > > equals to InvalidBlockNumber, but not MaxBlockNumber. I think it > > doesn't make sense that TidStore uses Inv

Removing BTScanPosUnpinIfPinned idiom from nbtree, simplifying mark/restore support

2025-06-11 Thread Peter Geoghegan
As already discussed on another nearby thread [1], I think that we should get rid of nbtree's BTScanPosUnpinIfPinned idiom (which originated in 2015 commit 2ed5b87f), since it is rather brittle. Recent experience from today's bugfix commit 7c319f54 made that pretty clear. Attached patch gets rid o

Re: failover logical replication slots

2025-06-11 Thread Fabrice Chapuis
Thanks for your reply. The problem I see is that after creating a new subscription, we have: 1) if a failover occurs, on the new primary node, the failover and sync flags are both set to true, so there's no problem. 2) when the old node returns as a secondary in the cluster, the failover flag is

Re: [19] Proposal: function markers to indicate collation/ctype sensitivity

2025-06-11 Thread Jeff Davis
On Wed, 2025-06-11 at 09:06 +0200, Peter Eisentraut wrote: > >    CASE: lower/upper/initcap/fold behavior > >    CLASS: char classifications such as [[:punct:]] > >    ORDER: comparisons > > > > Internally, at least for the foreseeable future, CASE and CLASS > > would > > be the same. They'd just

Re: pg_get_multixact_members not documented

2025-06-11 Thread Sami Imseih
> It's not clear, without some effort, which lock mode go with which row lock > in that description. > For example, "keysh" does not have "for" in it but "fornokeyupd" does. How > about rephrasing this > as "The lock modes "keysh", "sh", fornokeyupd", and "forupd" correspond to > FOR KEY SHARE, F

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

2025-06-11 Thread Florents Tselai
> On 11 Jun 2025, at 5:23 PM, Nathan Bossart wrote: > > On Wed, Jun 11, 2025 at 05:11:54PM +0300, Florents Tselai wrote: >>> On 11 Jun 2025, at 4:57 PM, Nathan Bossart wrote: >>> I considered adding another function that would create/attach a DSA in the >>> DSM registry, since that's already

Re: strange perf regression with data checksums

2025-06-11 Thread Peter Geoghegan
On Tue, Jun 10, 2025 at 3:00 PM Peter Geoghegan wrote: > I have confirmed that this flavor of the problem has existed for a > long time. We'll need to backpatch the fix to all supported branches. > Current plan: Commit 0001 on all supported branches in the next couple > of days. Unless I hear obj

Re: CHECKPOINT unlogged data

2025-06-11 Thread Christoph Berg
Re: Nathan Bossart > IMO we should try to make the terminology consistent everywhere. I'd > suggest putting the renaming stuff in separate prerequisite patches for > your new CHECKPOINT option. Ack, done in v4. I haven't implemented a WAIT option yet since I didn't want to decide that without mo

Re: Proper object locking for GRANT/REVOKE

2025-06-11 Thread Peter Eisentraut
On 09.12.24 02:25, Noah Misch wrote: Ok, we should probably put that comment back in slightly altered form, like "XXX This function intentionally takes only an AccessShareLock ... $REASON. In the face of concurrent DDL, we might easily latch onto an old version of an object, causing the GRANT or

Re: Question on error code selection in conflict detection

2025-06-11 Thread Dilip Kumar
On Wed, Jun 11, 2025 at 7:33 PM Robert Haas wrote: > > On Tue, Jun 10, 2025 at 2:09 AM Amit Kapila wrote: > > Can we instead try to use other suitable existing error codes? > > Why? > > I mean, I'm not 100% against using existing error codes, but I feel > like we might be distorting the meanings

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

2025-06-11 Thread Nathan Bossart
On Wed, Jun 11, 2025 at 05:11:54PM +0300, Florents Tselai wrote: >> On 11 Jun 2025, at 4:57 PM, Nathan Bossart wrote: >> I considered adding another function that would create/attach a DSA in the >> DSM registry, since that's already an intermediate step of dshash creation. >> We could then use th

Re: ALTER TABLE ALTER CONSTRAINT misleading error message

2025-06-11 Thread Fujii Masao
On 2025/06/02 12:13, jian he wrote: On Wed, May 28, 2025 at 7:59 PM Álvaro Herrera wrote: On 2025-May-28, jian he wrote: hi. create table t(a int, constraint cc check(a = 1)); ALTER TABLE t ALTER CONSTRAINT cc not valid; ERROR: FOREIGN KEY constraints cannot be marked NOT VALID LINE 1:

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

2025-06-11 Thread Rahila Syed
> On Wed, Jun 11, 2025 at 07:15:56PM +0530, Rahila Syed wrote: > >> How can one dsa_allocate in the same area as the returned dshash_table ? > >> in other words: shouldn't the state->dsa_handle be returned somehow ? > > > > +1. FWIW, Having used the DSA apis in my code, I think having the > registr

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

2025-06-11 Thread Florents Tselai
> On 11 Jun 2025, at 4:57 PM, Nathan Bossart wrote: > > On Wed, Jun 11, 2025 at 07:15:56PM +0530, Rahila Syed wrote: >>> How can one dsa_allocate in the same area as the returned dshash_table ? >>> in other words: shouldn't the state->dsa_handle be returned somehow ? >> >> +1. FWIW, Having us

Re: Skipping schema changes in publication

2025-06-11 Thread Shlok Kyal
On Thu, 17 Apr 2025 at 09:12, Amit Kapila wrote: > > On Wed, Apr 16, 2025 at 8:22 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Thu, Apr 10, 2025 at 7:25 PM Amit Kapila wrote: > > > > > > On Tue, Jan 9, 2024 at 12:02 PM vignesh C wrote: > > > > > > > > As I did not see much interest from others, I

Re: CHECKPOINT unlogged data

2025-06-11 Thread Nathan Bossart
On Wed, Jun 11, 2025 at 03:45:46PM +0200, Christoph Berg wrote: > Do we want to change the checkpoint log message (and the new options) > only, or include the CHECKPOINT_* flags? (I would guess there aren't > many external users of these flags, but mmmv.) IMO we should try to make the terminology

Re: Question on error code selection in conflict detection

2025-06-11 Thread Robert Haas
On Tue, Jun 10, 2025 at 2:09 AM Amit Kapila wrote: > Can we instead try to use other suitable existing error codes? Why? I mean, I'm not 100% against using existing error codes, but I feel like we might be distorting the meanings of the existing error codes. If we used new error codes, then peop

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

2025-06-11 Thread Nathan Bossart
On Wed, Jun 11, 2025 at 07:15:56PM +0530, Rahila Syed wrote: >> How can one dsa_allocate in the same area as the returned dshash_table ? >> in other words: shouldn't the state->dsa_handle be returned somehow ? > > +1. FWIW, Having used the DSA apis in my code, I think having the registry > return >

Re: CHECKPOINT unlogged data

2025-06-11 Thread Christoph Berg
Re: Nathan Bossart > That seems like a good idea to me. I'm tempted to say that "fast" more > accurately describes what's happening than "immediate." "Immediate" sounds > like it happens instantaneously, but it's actually just happening "fast," > i.e., as fast as possible. Ack. > > #define CHEC

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

2025-06-11 Thread Rahila Syed
Hi, Thank you for proposing this enhancement to the DSM registry. It will make it easier to use dshash functionality. > While trying to port some existing DSMR code, I came across this > limitation: > > How can one dsa_allocate in the same area as the returned dshash_table ? > in other words: sh

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-06-11 Thread jian he
hi. + /* Copy data from merged partitions to new partition. */ + moveMergedTablesRows(rel, mergingPartitionsList, newPartRel); + + /* Drop the current partitions before attaching the new one. */ + foreach_ptr(RelationData, mergingPartition, mergingPartitionsList) + { + ObjectAddress object; + + /*

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-06-11 Thread Dmitry Koval
Hi, Junwang Zhao! Thank you for note. 1. >Would it be better to use RELATION_IS_OTHER_TEMP in this case? >I noticed that while other parts of tablecmds.c don’t use the macro, >all other files consistently use RELATION_IS_OTHER_TEMP. Agreed, RELATION_IS_OTHER_TEMP is better. Changed. The fix wil

Re: Add 64-bit XIDs into PostgreSQL 15

2025-06-11 Thread Yura Sokolov
11.06.2025 09:00, Evgeny Voropaev wrote: > 2) About repairing fragmentation. > > The original approach implemented in PG18 assumes that fragmentation > occurs during every `prune_freeze` operation. It happens because the > logic of the "redo"-function `heap_xlog_prune_freeze` assumes that > fra

Re: Possibly hard-to-read message

2025-06-11 Thread David G. Johnston
On Wednesday, June 11, 2025, Daniel Gustafsson wrote: > > How about the attached (reflowing rows in docs not done to keep the diff > readable)? > > WFM David J.

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-06-11 Thread Sami Imseih
> IMO, having this GUC to force the use of invisible indexes is quite > strange. In my view, it detracts from the guarantees that you're meant > to get from disabling indexes. What if some connection has > use_invisible_index set to true? The DBA might assume all is well > after having seen nobody

Re: Improve the performance of Unicode Normalization Forms.

2025-06-11 Thread Alexander Borisov
11.06.2025 10:13, John Naylor wrote: On Tue, Jun 3, 2025 at 1:51 PM Alexander Borisov wrote: 5. The server part "lost weight" in the binary, but the frontend "gained weight" a little. I read the old commits, which say that the size of the frontend is very important and that speed is not i

Re: Use RELATION_IS_OTHER_TEMP where possible

2025-06-11 Thread Junwang Zhao
Hi Ashutosh, On Wed, Jun 11, 2025 at 7:11 PM Ashutosh Bapat wrote: > > > > On Wed, Jun 11, 2025 at 5:12 AM Junwang Zhao wrote: >> >> Hi Nathan, >> >> On Wed, Jun 11, 2025 at 12:30 AM Nathan Bossart >> wrote: >> > >> > On Wed, Jun 11, 2025 at 12:07:35AM +0800, Junwang Zhao wrote: >> > > All othe

Re: Use RELATION_IS_OTHER_TEMP where possible

2025-06-11 Thread Ashutosh Bapat
On Wed, Jun 11, 2025 at 5:12 AM Junwang Zhao wrote: > Hi Nathan, > > On Wed, Jun 11, 2025 at 12:30 AM Nathan Bossart > wrote: > > > > On Wed, Jun 11, 2025 at 12:07:35AM +0800, Junwang Zhao wrote: > > > All other files perform this check using RELATION_IS_OTHER_TEMP. > > > Should we update tablec

Re: Replication slot is not able to sync up

2025-06-11 Thread Amit Kapila
On Wed, Jun 11, 2025 at 7:19 AM shveta malik wrote: > > On Tue, Jun 10, 2025 at 3:20 PM Zhijie Hou (Fujitsu) > wrote: > > > > > > Thanks for updating the patch. > > > > I have few suggestions for the document from a user's perspective. > > > > Thanks Hou-San, I agree with your suggestions. Addres

Re: Improve tab completion for various SET/RESET forms

2025-06-11 Thread Dagfinn Ilmari Mannsåker
Peter Eisentraut writes: > On 09.06.25 22:27, Dagfinn Ilmari Mannsåker wrote: >> I noticed that psql tab-completes every possible session-settable >> variable after RESET, not just the ones that have actually been set in >> the current session. However, as I was fixing that I noticed several >>

Re: Possibly hard-to-read message

2025-06-11 Thread Daniel Gustafsson
> On 5 Jun 2025, at 13:14, Peter Eisentraut wrote: > > On 07.04.25 02:55, Daniel Gustafsson wrote: >>> On 7 Apr 2025, at 02:43, David G. Johnston >>> wrote: >>> How about: >>> >>> + "if set to a number, overrides the default two second \\watch >>> interval\n" >>> >>> I do like the cons

Re: Conflict detection for update_deleted in logical replication

2025-06-11 Thread Amit Kapila
On Tue, Jun 10, 2025 at 11:55 AM Zhijie Hou (Fujitsu) wrote: > > Here is the V35 patch set which includes the following changes: > Few minor comments: === 1. +Â * Check if the subscriber's configuration is adequate to enable the +Â * retain_conflict_info option. I see some funny

Re: Question on error code selection in conflict detection

2025-06-11 Thread shveta malik
On Wed, Jun 11, 2025 at 11:05 AM Dilip Kumar wrote: > > On Tue, Jun 10, 2025 at 12:14 PM Dilip Kumar wrote: > > > > On Tue, Jun 10, 2025 at 11:39 AM Amit Kapila > > wrote: > > > > > > On Mon, Jun 9, 2025 at 7:14 PM Dilip Kumar wrote: > > > > > > > > I was reviewing the code for conflict report

Re: Fix slot synchronization with two_phase decoding enabled

2025-06-11 Thread Ajin Cherian
On Fri, Jun 6, 2025 at 5:07 PM Nisha Moond wrote: > > > Attached v18 patch. > - patch-001: modified error messages as suggested above. > - patch-002: improved pg_dump docs as per Shveta's off-list suggestions. > > [1] > https://www.postgresql.org/message-id/CAA4eK1%2BB067G8mUJzKUEjc5KSkYq6z0utT

Re: Extend COPY FROM with HEADER to skip multiple lines

2025-06-11 Thread Dagfinn Ilmari Mannsåker
Shinya Kato writes: > On Tue, Jun 10, 2025 at 7:05 PM Dagfinn Ilmari Mannsåker > wrote: > >> Although not useful for the above format, and not intended to derail or >> bloat the proposal in this thread, would it be useful to have a mode >> that combines skip and match? I.e. skip N lines, then c

Re: Feature: psql - display current search_path in prompt

2025-06-11 Thread Florents Tselai
On Wed, Jun 11, 2025 at 12:51 PM Jim Jones wrote: > On 10.06.25 15:37, Florents Tselai wrote: > > EDIT: There are test under `src/psql/t` , not sure though how much > > coverage they have, > > but most importantly how it’d look like for this case. > > I took a look at these files, but I'm still u

Re: Feature: psql - display current search_path in prompt

2025-06-11 Thread Jim Jones
On 10.06.25 15:37, Florents Tselai wrote: > EDIT: There are test under `src/psql/t` , not sure though how much > coverage they have, > but most importantly how it’d look like for this case.  I took a look at these files, but I'm still unsure how to use them for automated prompt checking - I'm not

Re: Conflict detection for update_deleted in logical replication

2025-06-11 Thread shveta malik
On Tue, Jun 10, 2025 at 11:55 AM Zhijie Hou (Fujitsu) wrote: > > Here is the V35 patch set which includes the following changes: > Thank You for the patches, few comments: 1) compute_min_nonremovable_xid: + /* + * Stop advancing xmin if an invalid non-removable transaction ID is + * found, othe

Re: Possibly hard-to-read message

2025-06-11 Thread Peter Eisentraut
On 05.06.25 17:57, David G. Johnston wrote: - "if set to a number" seems to indicate that something else happens if it's not a number.  But it doesn't say what.  And it's also not true. And we don't phrase things like that for other numeric settings. If not set to a number (data typ

Re: Improve tab completion for various SET/RESET forms

2025-06-11 Thread Peter Eisentraut
On 09.06.25 22:27, Dagfinn Ilmari Mannsåker wrote: I noticed that psql tab-completes every possible session-settable variable after RESET, not just the ones that have actually been set in the current session. However, as I was fixing that I noticed several other deficiencies around other forms o

Re: Add enable_groupagg GUC parameter to control GroupAggregate usage

2025-06-11 Thread Tatsuro Yamada
Hi Ashtosh and hackers, > >Some of those instances are for plan stability, all of which need not be > replicated. But some of them explicitly test sort based grouping. For rest > of them hash based plan seems to be the best one, so explicit > enable_groupagg = false is not needed. We will need so

Fix background workers not restarting with restart_after_crash = on

2025-06-11 Thread Andrey Rudometov
Good day, hackers. Reading through changes committed in master, I noticed that after CleanupBackend/CleanupBackroundworker refactor background workers will fail to start again after postgres' restart with restart_after_crash = on. The reason is CleanupBackend and HandleChildCrash not setting back

Re: Proposal: Limitations of palloc inside checkpointer

2025-06-11 Thread Xuneng Zhou
Hi, > > 3) Fill gaps by pulling from the tail instead of rewriting the whole > queue? > > > > I misunderstood at first—this is a generally helpful optimization. > > I'll integrate it into the current patch. > > Great, thank you. > I dug deeper into the “fill gaps from the tail” optimization and

Re: Replace some %llu remnants in the tree

2025-06-11 Thread Peter Eisentraut
On 09.06.25 05:59, Michael Paquier wrote: While hacking a different patch, I've noticed that a couple of %llu did not get the PRIu64 call in the AIO code, and I don't see why we could not switch them. These have been introduced in commits that got into the tree after Peter's 15a79c73111f. Look

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-06-11 Thread jian he
On Wed, Jun 11, 2025 at 8:06 AM Dmitry Koval wrote: > > >Do getAttributesList need to care about pg_attribute.attidentity? > >currently MERGE PARTITION seems to work fine with identity columns, > >this issue i didn't dig deeper. > > Probably after commit [3] partition's identity columns shares

Re: Fix potential overflow risks from wcscpy and sprintf

2025-06-11 Thread Peter Eisentraut
On 06.06.25 22:50, Yan Haibo wrote: This change stems from a recent static code analysis, which identified a minor potential overflow issue. I would appreciate it if someone could review the fix at their convenience. Please provide more detail in each case what the issue is and how you are pr

Re: Improve the performance of Unicode Normalization Forms.

2025-06-11 Thread John Naylor
On Tue, Jun 3, 2025 at 1:51 PM Alexander Borisov wrote: > 5. The server part "lost weight" in the binary, but the frontend > "gained weight" a little. > > I read the old commits, which say that the size of the frontend is very > important and that speed is not important > (speed is important o

Re: [19] Proposal: function markers to indicate collation/ctype sensitivity

2025-06-11 Thread Peter Eisentraut
On 05.06.25 22:47, Jeff Davis wrote: While we're at it, CTYPE is not very descriptive for a user-facing name. And COLLATE has become overloaded (expression clause, pg_collation object, ordering, or the superset of behaviors that includes CTYPE). Let's consider more user-friendly naming for the ma

Re: [19] Proposal: function markers to indicate collation/ctype sensitivity

2025-06-11 Thread Peter Eisentraut
On 05.06.25 21:56, Jeff Davis wrote: On Thu, 2025-06-05 at 10:12 +0200, Peter Eisentraut wrote: The reason we don't do it at parse time is that we don't have the information which functions care about collations, which is exactly what you are proposing here to add. Currently, we have: cre