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

2025-06-10 Thread Peter Eisentraut
On 05.06.25 22:57, Jeff Davis wrote: On Tue, 2025-06-03 at 20:22 -0700, Jeff Davis wrote: EQUALITY marker: indicates that the function or index AM depends on CollOid for the equality semantics of the input expression. Examples: texteq(), btree AM, hash AM. (Note: EQUALITY is only important for n

Re: [V2] Adding new CRC32C implementation for IBM S390X

2025-06-10 Thread John Naylor
On Thu, Jun 5, 2025 at 2:15 PM Eduard Stefes wrote: > > Hi, > > So here is V2 of the crc32c_s390x patch. Changes from V1 are: Hi Eduard, thanks for the update. Note, it's not necessary to change the thread subject, and in fact I came very close to missing this email entirely. Secondly, I haven't

Re: pg_get_multixact_members not documented

2025-06-10 Thread Ashutosh Bapat
On Fri, Jun 6, 2025 at 4:15 AM Sami Imseih wrote: > > We developers may understand the mode text "sh", "keysh" etc. But it may > not be user friendly. > > yes, I can see that being a point of confusion. > > > It would have been better if the function would have reported standard > modes as descri

Re: failover logical replication slots

2025-06-10 Thread Dilip Kumar
On Wed, Jun 11, 2025 at 10:18 AM Zhijie Hou (Fujitsu) wrote: > > On Tue, Jun 10, 2025 at 11:46 PM Fabrice Chapuis wrote: > > I'm working with logical replication in a PostgreSQL 17 setup, and I'm > > exploring the new option to make replication slots failover safe in a highly > > available environ

Re: Add 64-bit XIDs into PostgreSQL 15

2025-06-10 Thread Evgeny Voropaev
> What exactly would break if we did perform `heap_page_prune_execute` > with NO fragmentation repair during `heap_page_prepare_for_xid`? Correction into the last question: What exactly would break if we did invoke `heap_page_prune_execute` with `repairFragmentation=true` during performing of `

Re: Question on error code selection in conflict detection

2025-06-10 Thread Dilip Kumar
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 reporting and became curious > > > about the choice of ERRCODE_T_R_SERIALIZATION

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2025-06-10 Thread Yugo Nagata
On Wed, 11 Jun 2025 13:33:07 +0900 Fujii Masao wrote: > > > On 2025/06/11 11:49, Yugo Nagata wrote: > > While looking at the thread [1], I've remembered this thread. > > The patches in this thread are partially v18-related, but include > > enhancement or fixes for existing feature, so should th

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

2025-06-10 Thread Florents Tselai
> On 10 Jun 2025, at 8:25 PM, Nathan Bossart wrote: > > On Tue, Jun 10, 2025 at 07:47:02PM +0300, Florents Tselai wrote: >> Love this new API. > > Thanks! > >> a minor typo here >> + * current backend. This function gurantees that only one backend > > Fixed. > >> Since you made the first

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2025-06-10 Thread Yugo Nagata
On Wed, 11 Jun 2025 13:33:07 +0900 Fujii Masao wrote: > > > On 2025/06/11 11:49, Yugo Nagata wrote: > > While looking at the thread [1], I've remembered this thread. > > The patches in this thread are partially v18-related, but include > > enhancement or fixes for existing feature, so should th

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

2025-06-10 Thread David Rowley
On Tue, 10 Jun 2025 at 04:40, Robert Treat wrote: > You are going to have a guc either way, which > means you are going to have to explain a bunch of these different > caveats in BOTH solutions. It's just that in one of the solutions, you > are further entangling the usage with DDL changes (and th

Re: Add log_autovacuum_{vacuum|analyze}_min_duration

2025-06-10 Thread Shinya Kato
On Thu, Jun 5, 2025 at 3:53 AM Sami Imseih wrote: > > Approach 2: > > - log_autovacuum_min_duration: Changed behavior, which controls only > > autovacuum logging. > > - log_autoanalyze_min_duration: New parameter, which controls > > autoanalyze logging. > > My vote is for this approach. It is pro

RE: failover logical replication slots

2025-06-10 Thread Zhijie Hou (Fujitsu)
On Tue, Jun 10, 2025 at 11:46 PM Fabrice Chapuis wrote: > I'm working with logical replication in a PostgreSQL 17 setup, and I'm > exploring the new option to make replication slots failover safe in a highly > available environment using physical standby nodes managed by Patroni. > > After a swit

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

2025-06-10 Thread Hayato Kuroda (Fujitsu)
Dear Saito-san, > Yes, your understanding is correct. The top-right image was generated > with the previous patch, and the bottom-right with the v2 patch. > > Thank you also for your advice regarding splitting the patch into two parts: > - 0001: Set both body.start.indent and body.end.indent to 0

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-06-10 Thread jian he
hi. we generally no need to worry about the partitioned table check constraint, generated column does not apply to newly merged partitions. since partitioned table constraints apply to each individual partition, including newly created partitions. However, there are corner cases: constraints incl

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2025-06-10 Thread Fujii Masao
On 2025/06/11 11:49, Yugo Nagata wrote: While looking at the thread [1], I've remembered this thread. The patches in this thread are partially v18-related, but include enhancement or fixes for existing feature, so should they be postponed to v19, or should be separated properly to v18 part and

Re: Extend COPY FROM with HEADER to skip multiple lines

2025-06-10 Thread Shinya Kato
On Tue, Jun 10, 2025 at 7:05 PM Dagfinn Ilmari Mannsåker wrote: > Andrew Dunstan writes: > > > OTOH I'm a bit curious to know what software produces multi-line CSV > > headers. > > AWS CloudFront access logs are stored in S3 as TSV files (one per hour > per CF node) with a two-line header commen

Re: Add enable_groupagg GUC parameter to control GroupAggregate usage

2025-06-10 Thread Tatsuro Yamada
Hi Ashutosh, Thanks for your reply! >I first thought enable_hashagg should be sufficient to choose one strategy over the other. But that is not true, enable_hashagg = true allows both the strategies, enable_hashagg = false disables just hash strategy. There's no way to disable group agg alone. So

Re: Proposal: Global Index for PostgreSQL

2025-06-10 Thread Dilip Kumar
On Wed, Jun 11, 2025 at 1:08 AM Bruce Momjian wrote: > > On Mon, Jun 9, 2025 at 05:51:25PM -0400, Bruce Momjian wrote: > > On Mon, Jun 9, 2025 at 03:28:38PM +0530, Dilip Kumar wrote: > > There are certainly use cases where this would be helpful, but I think > > the big question is whether it wou

Re: Proposal: Global Index for PostgreSQL

2025-06-10 Thread Dilip Kumar
On Tue, Jun 10, 2025 at 3:21 AM Bruce Momjian wrote: Thanks Bruce for your thoughts on this. > On Mon, Jun 9, 2025 at 03:28:38PM +0530, Dilip Kumar wrote: > > On Mon, Jun 9, 2025 at 2:03 PM Nikita Malakhov wrote: > > > Global Indexes is a very interesting functionality that has both > > > sig

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2025-06-10 Thread Yugo Nagata
On Tue, 8 Apr 2025 12:28:57 +0900 Yugo NAGATA wrote: > On Fri, 4 Apr 2025 19:18:11 +0900 > Fujii Masao wrote: > > > > > > > On 2025/04/04 0:21, Fujii Masao wrote: > > > Thanks for updating the patch! > > > > > > If there are no objections, I'll proceed with committing it using the > > > fol

Re: ZStandard (with dictionaries) compression support for TOAST compression

2025-06-10 Thread Michael Paquier
On Thu, Jun 05, 2025 at 12:03:49AM -0700, Nikhil Kumar Veldanda wrote: > Agreed. I introduced pg_compression_available(text) and refactored the > SQL tests accordingly. I split out LZ4 tests into compression_lz4.sql > and created compression_zstd.sql with the appropriate differences. > > v25-0001-

Re: [PATCH] Refactor: Extract XLogRecord info

2025-06-10 Thread Steven Niu
Hi, Xiaoran, I see. The code is checking if the bits other than rmgr bits, XLR_SPECIAL_REL_UPDATE and XLR_CHECK_CONSISTENCY are used. Thanks for explanation. Steven 在 2025/6/11 10:13, Xiaoran Wang 写道: > > > Steven Niu mailto:niush...@gmail.com>> 于2025年6月 > 10日周二 17:56写道: > > I'm confused by

Re: [PATCH] Refactor: Extract XLogRecord info

2025-06-10 Thread Steven Niu
Hi, Xiaoran, I see. The code is checking if the bits other than rmgr bits, XLR_SPECIAL_REL_UPDATE and XLR_CHECK_CONSISTENCY are used. Thanks for the explanation. Steven Xiaoran Wang 于2025年6月11日周三 10:13写道: > > > Steven Niu 于2025年6月10日周二 17:56写道: > >> I'm confused by the code of XLR_RMGR_INFO

Re: Add a bound check to TidRangeEval

2025-06-10 Thread Junwang Zhao
Hi David, On Mon, Jun 9, 2025 at 9:52 AM David Rowley wrote: > > On Sun, 8 Jun 2025 at 21:41, Junwang Zhao wrote: > > The comments of TidRangeEval saids: > > > > ``` > > Returns false if we detect the range cannot contain any tuples. > > ``` > > > > After narrowing the upper and lower bounds, we

Re: [PATCH] Refactor: Extract XLogRecord info

2025-06-10 Thread Xiaoran Wang
Steven Niu 于2025年6月10日周二 17:56写道: > I'm confused by the code of XLR_RMGR_INFO_MASK and XLR_INFO_MASK. > > According to the definition of masks, the high 4 bits are for rmgr. > > /* > * The high 4 bits in xl_info may be used freely by rmgr. The > * XLR_SPECIAL_REL_UPDATE and XLR_CHECK_CONSISTENC

Re: Replication slot is not able to sync up

2025-06-10 Thread shveta malik
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. Addressed in v4. Also addressed Amit's suggestion at [1] to improve errdetail.

Re: [PATCH v1] Add pg_stat_multixact view for multixact membership usage monitoring

2025-06-10 Thread Naga Appani
On Tue, Jun 10, 2025 at 11:40 AM Andrew Johnson wrote: > > Hi Naga, > > Thank you for the thoughtful feedback and for driving attention to > this issue. I appreciate you taking the time to review my patch. > > You raise some good points about the trade-offs between a lightweight > function and the

Re: Safeguards against incorrect fd flags for fsync()

2025-06-10 Thread Tom Lane
Michael Paquier writes: > We don't have a trace of O_ACCMODE in the tree, and POSIX defines it. > I'm wondering how the buildfarm would react on that, but perhaps > that's fine on !WIN32. It's hard to say with all the hosts there, at > least the CI is OK. POSIX has required O_ACCMODE in fcntl.h

Re: Partitioned tables and [un]loggedness

2025-06-10 Thread Michael Paquier
On Fri, Jun 06, 2025 at 10:55:32AM +0900, Michael Paquier wrote: > Okay, thanks. Let's wait for a couple of days in case there are more > opinions and/or comments. I propose to apply the patch around the > beginning of next week if there are no objections. It took a bit longer than wanted, but a

Re: queryId constant squashing does not support prepared statements

2025-06-10 Thread Michael Paquier
On Tue, Jun 10, 2025 at 07:25:27PM +0200, Alvaro Herrera wrote: > On 2025-Jun-10, Michael Paquier wrote: >> I think that this is can be reproduced by >> -DWRITE_READ_PARSE_PLAN_TREES -DCOPY_PARSE_PLAN_TREES >> -DRAW_EXPRESSION_COVERAGE_TEST that I always include in my builds. >> The freebsd task us

Re: Safeguards against incorrect fd flags for fsync()

2025-06-10 Thread Michael Paquier
On Tue, Jun 10, 2025 at 12:26:48PM +0200, Michael Banck wrote: > Well O_RDONLY might historically be 0 almost everywhere, but it is > defined to 1 on the GNU system [1]: > > |#define O_RDONLY0x0001 /* Open read-only. */ > > So there, the comparison with 0 does not work and initdb (a

Re: Improve tab completion for COPY

2025-06-10 Thread Fujii Masao
On 2025/06/11 5:33, 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 to reflect their different opti

Re: Use RELATION_IS_OTHER_TEMP where possible

2025-06-10 Thread Junwang Zhao
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 tablecmds.c to do the same for consistency? > > Seems like a good idea. Th

Re: Cleaning up historical portability baggage

2025-06-10 Thread Thomas Munro
On Tue, Jun 10, 2025 at 10:59 PM Michael Banck wrote: > I don't have an opinion here, I think it would be ok to just define it > to 16 if it is undefined and if the Hurd people want something better at > some point, they should submit patches. Cool. I will go ahead and do that, as you proposed,

Re: Cleanup gcc trick with varattrib_1b_e in VARATT_EXTERNAL_GET_POINTER()

2025-06-10 Thread Tom Lane
Peter Eisentraut writes: > On 09.06.25 10:21, Michael Paquier wrote: >> now in detoast.h: >> /* >> * Macro to fetch the possibly-unaligned contents of an EXTERNAL datum >> * into a local "struct varatt_external" toast pointer. This should be >> * just a memcpy, but some versions of gcc seem to pr

Re: Cleanup gcc trick with varattrib_1b_e in VARATT_EXTERNAL_GET_POINTER()

2025-06-10 Thread Michael Paquier
On Tue, Jun 10, 2025 at 06:30:33PM +0200, Peter Eisentraut wrote: > I can see how this might have been different historically. I have noticed > that there are some areas of code where Datum and struct varlena * or > similar are used interchangeably. Macros tend to hide that kind of > confusion.

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

2025-06-10 Thread Dimitrios Apostolou
On Tue, 10 Jun 2025, Nathan Bossart wrote: I also wrote a couple of test programs to show the difference between fseeko-ing and fread-ing through a file with various sizes. On a Linux machine, I see this: log2(n) | fseeko | fread -+-+--- 1 | 109.288 | 5.52

Re: [WIP]Vertical Clustered Index (columnar store extension) - take2

2025-06-10 Thread Peter Smith
Tomas. Attached is the first version of the README, intended to address the points above. For convenience, I’ve included it as a separate file, but the plan is to integrate it into the 0002 patch in the next update. Please let me know if you have any feedback or suggestions for improving the content. == Kind Regards, Peter Smith. Fujitsu Australia. README-20250610 Description: Binary data

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

2025-06-10 Thread Nathan Bossart
On Mon, Jun 09, 2025 at 10:09:57PM +0200, Dimitrios Apostolou wrote: > Fix by avoiding forward seeks for jumps of less than 1MB forward. > Do instead sequential reads. > > Performance gain can be significant, depending on the size of the dump > and the I/O subsystem. On my local NVMe drive, read s

Re: CREATE DATABASE command for non-libc providers

2025-06-10 Thread Daniel Verite
Jeff Davis wrote: > Even if it's not a collatable type, it should use the database > collation rather than going straight to libc. Again, is that something > that can ever be fixed or are we just stuck with libc semantics for > full text search permanently, even if you initialize the clust

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

2025-06-10 Thread Sami Imseih
> So, if we were adding named LWLocks today, I suspect we might do it > differently. The first thing that comes to mind is that we could store a > shared LWLockTrancheNames table. +1 > and stop requiring each backend to register them individually. which will prevent odd behavior when a backend

Re: Cleaning up historical portability baggage

2025-06-10 Thread Tom Lane
Michael Banck writes: > 2. The fact that nobody else complained about those new(er) timestamp- > comparison additions appears to imply that there are no 100ms resolution > machines we support anymore. So did we consider switching those > pg_sleep(0.1) calls in stats.sql to pg_sleep(0.01) to save a

Re: Safeguards against incorrect fd flags for fsync()

2025-06-10 Thread Michael Banck
Hi, one more thing: On Tue, Jun 10, 2025 at 12:26:48PM +0200, Michael Banck wrote: > The better way might be to mask the flags with O_ACCMODE and then just > check what you want, like in the attached. I forgot to mention it in the patch, but Samuel Thibault reviewed the patch and suggested impro

Re: User timeouts for scheduling functions

2025-06-10 Thread David G. Johnston
On Tuesday, June 10, 2025, Steve Senior wrote: > I'm prototyping an extension in which I need to execute a C function > repeatedly on a timer as part of a sql execution hook, > Isn’t this going to produce a long-running open transaction? David J.

Re: Cleaning up historical portability baggage

2025-06-10 Thread Michael Banck
Hi, On Tue, Jun 10, 2025 at 12:59:16PM +0200, Michael Banck wrote: > On Tue, Jun 10, 2025 at 09:05:03AM +1200, Thomas Munro wrote: > > https://savannah.gnu.org/task/?7050 > > 3. make check nowadays succeeds the subscription test that it failed in > the log mentioned in the above task, but it stil

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

2025-06-10 Thread Masahiko Sawada
On Sun, Jun 8, 2025 at 8:57 PM shveta malik wrote: > > On Sat, Jun 7, 2025 at 2:44 AM Masahiko Sawada wrote: > > > > On Fri, Jun 6, 2025 at 3:02 AM shveta malik wrote: > > > > > > On Wed, Jun 4, 2025 at 3:40 PM shveta malik > > > wrote: > > > > > > > > On Wed, Jun 4, 2025 at 6:41 AM Masahiko S

Feature Request: Declarative Optimistic Locking via ON NO ROWS for UPDATE/DELETE

2025-06-10 Thread Mark Dake
Hi all, I'd like to propose a declarative syntax addition for UPDATE and DELETE that supports optimistic locking directly in SQL: an ON NO ROWS clause that triggers an error if no rows are affected by the DML statement. Problem In many applications, particularly those using optimistic conc

User timeouts for scheduling functions

2025-06-10 Thread Steve Senior
I'm prototyping an extension in which I need to execute a C function repeatedly on a timer as part of a sql execution hook, and end it when I choose. I've spent the time reading these lists, the documentation etc and the only solution I saw that wouldn't require a patch was user-definable timeou

Inconsistent Behavior in JSONB Numeric Array Deletion

2025-06-10 Thread Mark Dake
Hi all, I'd like to report what I believe is an inconsistency in the behavior of the jsonb - operator when applied to numeric arrays. Problem PostgreSQL allows us to check for the presence of a scalar inside a JSONB array: SELECT jsonb('[2,3,1]') @> to_jsonb(1); -- Returns true Ho

Fix potential overflow risks from wcscpy and sprintf

2025-06-10 Thread Yan Haibo
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. Thank you for your time and support. Best regards, Haibo 0001-Mitigate-potential-overflow-risks-from-wcscpy-and-s

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

2025-06-10 Thread Nathan Bossart
On Tue, Jun 10, 2025 at 02:05:16PM -0500, Sami Imseih wrote: > There is also that dynamic tranche named are stored in local backend > look-up table, so if you have some backends that attached some dynamic > hash table > and others that did not, only the ones that registered would be able to > resol

Re: Improve tab completion for COPY

2025-06-10 Thread Nathan Bossart
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 to >> > reflect their different options. > > [...] > > Given RE

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

2025-06-10 Thread Alexander Korotkov
On Mon, Jun 9, 2025 at 7:09 PM Vitaly Davydov wrote: > > I think we can use this approach for HEAD and probably keep the > > previous idea for backbranches. Keeping some value in shared_memory > > per slot sounds risky to me in terms of introducing new bugs. > > Not sure, what kind of problems may

Re: Non-reproducible AIO failure

2025-06-10 Thread Andres Freund
Hi, On 2025-06-10 21:09:18 +0300, Konstantin Knizhnik wrote: > > On 10/06/2025 8:41 pm, Andres Freund wrote: > > I was able to reproduce it with gcc, too. > > I've reproduced it without that bitfield, unfortunately :(. > But also only at MacOS? Correct. > I wonder if it is possible to set har

Re: Improve tab completion for COPY

2025-06-10 Thread Masahiko Sawada
On Mon, Jun 9, 2025 at 7:59 PM Yugo Nagata wrote: > > On Tue, 10 Jun 2025 11:15:09 +0900 > torikoshia wrote: > > > On 2025-06-03 17:58, Yugo Nagata wrote: > > > Thank you for updating the patch. > > > It looks good and I confirmed that this works as expected. > > > > Thanks for your review! > > >

Re: Proposal: Global Index for PostgreSQL

2025-06-10 Thread Bruce Momjian
On Mon, Jun 9, 2025 at 05:51:25PM -0400, Bruce Momjian wrote: > On Mon, Jun 9, 2025 at 03:28:38PM +0530, Dilip Kumar wrote: > There are certainly use cases where this would be helpful, but I think > the big question is whether it would have so many negatives that most > people who try to use it w

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

2025-06-10 Thread Sami Imseih
There is also that dynamic tranche named are stored in local backend look-up table, so if you have some backends that attached some dynamic hash table and others that did not, only the ones that registered would be able to resolve the tranche id to its name. This is the case which I encountered ye

Re: strange perf regression with data checksums

2025-06-10 Thread Peter Geoghegan
On Mon, Jun 9, 2025 at 10:47 AM Peter Geoghegan wrote: > As I said, I think that this is actually an old bug. After all, > _bt_killitems is required to test so->currPos.lsn against the same > page's current LSN if the page pin was dropped since _bt_readpage was > first called -- regardless of any

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

2025-06-10 Thread Sami Imseih
> I'm not quite following your uneasiness with the tranche names. For the > dshash table, we'll need a tranche for the DSA and one for the hash table, > so presumably any wait events for those locks should be named accordingly, > right? I may be alone in this opinion, but I prefer the suffixless

Re: Non-reproducible AIO failure

2025-06-10 Thread Konstantin Knizhnik
On 10/06/2025 8:41 pm, Andres Freund wrote: I was able to reproduce it with gcc, too. I've reproduced it without that bitfield, unfortunately :(. But also only at MacOS? I wonder if it is possible to set hardware watchpoint fro program itself (not using gdb)? I.e. using ptrace? Looks lik

Re: Non-reproducible AIO failure

2025-06-10 Thread Andres Freund
Hi, On 2025-06-10 17:28:11 +0300, Konstantin Knizhnik wrote: > On 09/06/2025 2:05 am, Thomas Munro wrote: > > On Sat, Jun 7, 2025 at 6:47 AM Andres Freund wrote: > > > On 2025-06-06 14:03:12 +0300, Konstantin Knizhnik wrote: > > > > There is really essential difference in code generated by clang

Re: Remaining dependency on setlocale()

2025-06-10 Thread Jeff Davis
On Tue, 2025-06-10 at 17:32 +0200, Peter Eisentraut wrote: > As I mentioned earlier in the thread, I don't think we can do this > for > LC_CTYPE, because otherwise system error messages would not come out > in > the right encoding. Is there any way around that? If all we need is the right encodi

Re: pg_restore causing ENOSPACE on the WAL partition. Fundamental issue?

2025-06-10 Thread David G. Johnston
On Tuesday, June 10, 2025, Dimitrios Apostolou wrote: > Hello list, > > I have previously raised an issue on pgsql-general, where PostgreSQL is > logging without any boundaries to the WAL directory, even if other writer > processes can't catch up with it. It ends up with WAL partition becoming >

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

2025-06-10 Thread Nathan Bossart
On Tue, Jun 10, 2025 at 07:47:02PM +0300, Florents Tselai wrote: > Love this new API. Thanks! > a minor typo here > + * current backend. This function gurantees that only one backend Fixed. > Since you made the first step towards decoupling DSMR_NAME_LEN from > NAMEDATALEN; > is it worth con

Re: queryId constant squashing does not support prepared statements

2025-06-10 Thread Álvaro Herrera
On 2025-Jun-10, Michael Paquier wrote: > I think that this is can be reproduced by > -DWRITE_READ_PARSE_PLAN_TREES -DCOPY_PARSE_PLAN_TREES > -DRAW_EXPRESSION_COVERAGE_TEST that I always include in my builds. > The freebsd task uses the same with debug_copy_parse_plan_trees=on, > debug_write_read_p

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

2025-06-10 Thread Florents Tselai
> On 10 Jun 2025, at 7:21 PM, Nathan Bossart wrote: > > On Tue, Jun 10, 2025 at 10:38:29AM -0500, Nathan Bossart wrote: >> On Mon, Jun 09, 2025 at 07:14:28PM -0500, Sami Imseih wrote: >>> Going back to the original point, DSMRegistryHash and DSMRegistryHash >>> are built-in, and those names are

Re: [PATCH v1] Add pg_stat_multixact view for multixact membership usage monitoring

2025-06-10 Thread Andrew Johnson
Hi Naga, Thank you for the thoughtful feedback and for driving attention to this issue. I appreciate you taking the time to review my patch. You raise some good points about the trade-offs between a lightweight function and the pgstat infrastructure. I actually think both approaches have merit fo

pg_restore causing ENOSPACE on the WAL partition. Fundamental issue?

2025-06-10 Thread Dimitrios Apostolou
Hello list, I have previously raised an issue on pgsql-general, where PostgreSQL is logging without any boundaries to the WAL directory, even if other writer processes can't catch up with it. It ends up with WAL partition becoming full and a bad crash. Read more at the thread at: https://www

Re: Use RELATION_IS_OTHER_TEMP where possible

2025-06-10 Thread Nathan Bossart
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 tablecmds.c to do the same for consistency? Seems like a good idea. -- nathan

Re: Cleanup gcc trick with varattrib_1b_e in VARATT_EXTERNAL_GET_POINTER()

2025-06-10 Thread Peter Eisentraut
On 09.06.25 10:21, Michael Paquier wrote: Back in b89e151054a0, the following macro has been introduced to retrieve the varatt_external of an on-disk external TOAST Datum, stuff now in detoast.h: /* * Macro to fetch the possibly-unaligned contents of an EXTERNAL datum * into a local "struct v

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

2025-06-10 Thread Nathan Bossart
On Tue, Jun 10, 2025 at 10:38:29AM -0500, Nathan Bossart wrote: > On Mon, Jun 09, 2025 at 07:14:28PM -0500, Sami Imseih wrote: >> Going back to the original point, DSMRegistryHash and DSMRegistryHash >> are built-in, and those names are well-defined and actually refer to >> waits related to the mec

Use RELATION_IS_OTHER_TEMP where possible

2025-06-10 Thread Junwang Zhao
Hi hackers, While reviewing the Merge/Split partitions patch[0], I found some places in tablecmds.c where RELATION_IS_OTHER_TEMP can be used but not, such as: /* If the parent is temp, it must belong to this session */ if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && !rel->rd_islocaltemp

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-06-10 Thread Junwang Zhao
Hi Dmitry, On Tue, Jun 10, 2025 at 6:48 AM Dmitry Koval wrote: > > Hi, Jian He! > > Thanks for the suggestions and patches! > This email contains comments to three emails (05/06/2025). > I hope to read two emails (for 06/06/2025) tomorrow. > > 1. > >What should we do when any to be merged partit

Re: [PATCH v1] Add pg_stat_multixact view for multixact membership usage monitoring

2025-06-10 Thread Naga Appani
On Tue, Jun 10, 2025 at 9:40 AM Andrew Johnson wrote: > > Hello hackers, > > I'd like to propose adding a new view named "pg_stat_multixact" to > expose multixact member usage. This addresses a major monitoring gap > that ultimately led to a production outage at Metronome [1]. > > Problem > Multix

failover logical replication slots

2025-06-10 Thread Fabrice Chapuis
I'm working with logical replication in a PostgreSQL 17 setup, and I'm exploring the new option to make replication slots failover safe in a highly available environment using physical standby nodes managed by Patroni. After a switchover, I encounter an error message in the PostgreSQL logs and obs

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

2025-06-10 Thread Nathan Bossart
On Mon, Jun 09, 2025 at 07:14:28PM -0500, Sami Imseih wrote: > Going back to the original point, DSMRegistryHash and DSMRegistryHash > are built-in, and those names are well-defined and actually refer to > waits related to the mechanism of registering a DSA or a HASH. > I think it will be odd to ap

Re: Remaining dependency on setlocale()

2025-06-10 Thread Peter Eisentraut
On 07.06.25 00:23, Jeff Davis wrote: On Thu, 2025-06-05 at 22:15 -0700, Jeff Davis wrote: To continue this thread, I did a symbol search in the meson build directory like (patterns.txt attached): Attached a rough patch series which does what everyone seemed to agree on: * Change some trivi

Re: Update Windows CI Task Names: Server 2022 + VS 2022 Upgrade

2025-06-10 Thread Nazir Bilal Yavuz
Hi, On Fri, 6 Jun 2025 at 08:30, Peter Eisentraut wrote: > > On 05.06.25 12:42, Thomas Munro wrote: > > I think on your C11 thread I might have been confused about that, > > since there was an implication that 2019 might support , > > but it looks like 2019 added language stuff while 2022 added t

[PATCH v1] Add pg_stat_multixact view for multixact membership usage monitoring

2025-06-10 Thread Andrew Johnson
Hello hackers, I'd like to propose adding a new view named "pg_stat_multixact" to expose multixact member usage. This addresses a major monitoring gap that ultimately led to a production outage at Metronome [1]. Problem Multixact membership exhaustion is an edge case that can cause write lockouts

Re: Buffer overflow in SerializeLibraryState() found by Address Sanitizer

2025-06-10 Thread David Geier
But just seeing now that size in EstimateLibraryState() is initialized to 1. So that total size should actually be fine. Weird that the patch makes the sanitizer error disappear. On 6/10/2025 4:21 PM, David Geier wrote: The loop advances the pointer via start_address += len. -- David Geier (

Re: Non-reproducible AIO failure

2025-06-10 Thread Konstantin Knizhnik
On 09/06/2025 2:05 am, Thomas Munro wrote: On Sat, Jun 7, 2025 at 6:47 AM Andres Freund wrote: On 2025-06-06 14:03:12 +0300, Konstantin Knizhnik wrote: There is really essential difference in code generated by clang 15 (working) and 16 (not working). There also are code gen differences betw

Re: Buffer overflow in SerializeLibraryState() found by Address Sanitizer

2025-06-10 Thread David Geier
The loop advances the pointer via start_address += len. -- David Geier (ServiceNow On 6/10/2025 3:06 PM, Daniel Gustafsson wrote: On 10 Jun 2025, at 14:59, David Geier wrote: Hi hackers! SerializeLibraryState() writes 1 byte too much into the buffer pointed to by start_address. This is the

Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring

2025-06-10 Thread Naga Appani
On Tue, Mar 11, 2025 at 4:48 AM Kirill Reshke wrote: > > On Tue, 11 Mar 2025 at 14:37, Naga Appani wrote: > > > > > > > > On Mon, Mar 10, 2025 at 10:43 AM Naga Appani wrote: > >> > >> Hi, > >> > > Hi > > > = > > Proposal > > = > > The internal ReadMultiXactCounts(

Re: Feature: psql - display current search_path in prompt

2025-06-10 Thread Florents Tselai
> On 10 Jun 2025, at 4:09 PM, Florents Tselai wrote: > > > >> On 10 Jun 2025, at 3:51 PM, Jim Jones wrote: >> >> Hi Florents >> >> On 10.06.25 13:36, Florents Tselai wrote: >>> >>> On Tue, Jun 10, 2025 at 2:08 AM Jelte Fennema-Nio >> > wrote: >>> >>>On Mon,

Re: Feature: psql - display current search_path in prompt

2025-06-10 Thread Florents Tselai
> On 10 Jun 2025, at 3:51 PM, Jim Jones wrote: > > Hi Florents > > On 10.06.25 13:36, Florents Tselai wrote: >> >> On Tue, Jun 10, 2025 at 2:08 AM Jelte Fennema-Nio > > wrote: >> >>On Mon, 9 Jun 2025 at 17:54, Florents Tselai >>mailto:florents.tse...@gmail.

Re: Buffer overflow in SerializeLibraryState() found by Address Sanitizer

2025-06-10 Thread Daniel Gustafsson
> On 10 Jun 2025, at 14:59, David Geier wrote: > > Hi hackers! > > SerializeLibraryState() writes 1 byte too much into the buffer pointed to by > start_address. This is the very last '\0' it writes after the loop. Attached > is a patch that fixes the problem by accounting for that extra byte i

Buffer overflow in SerializeLibraryState() found by Address Sanitizer

2025-06-10 Thread David Geier
Hi hackers! SerializeLibraryState() writes 1 byte too much into the buffer pointed to by start_address. This is the very last '\0' it writes after the loop. Attached is a patch that fixes the problem by accounting for that extra byte in EstimateLibraryStateSpace() -- David Geier (ServiceNow)

Re: Feature: psql - display current search_path in prompt

2025-06-10 Thread Jim Jones
Hi Florents On 10.06.25 13:36, Florents Tselai wrote: > > On Tue, Jun 10, 2025 at 2:08 AM Jelte Fennema-Nio > wrote: > > On Mon, 9 Jun 2025 at 17:54, Florents Tselai > mailto:florents.tse...@gmail.com>> wrote: > > Here’s a quick attempt that makes %S subst

Re: [PATCH] Refactor: Extract XLogRecord info

2025-06-10 Thread Michael Paquier
On Mon, Jun 09, 2025 at 10:54:43PM -0300, Fabrízio de Royes Mello wrote: > The refactoring LGTM but do we really need two patches? IMHO you can just > merge everything into a single patch. FWIW, I'm not sure what's the benefit of the proposal which comes down to the removal of a bitwise NOT, excep

Re: pg_dump/pg_dumpall help synopses and terminology

2025-06-10 Thread Ashutosh Bapat
Hi Peter, On Tue, Jun 10, 2025 at 12:29 PM Peter Eisentraut wrote: > How about this to bring it all together: > > pg_dump --help: > pg_dump exports a PostgreSQL database as an SQL script or to other formats. > > pg_dumpall --help: > pg_dumpall exports a PostgreSQL database cluster as an SQL scri

Re: Feature: psql - display current search_path in prompt

2025-06-10 Thread Florents Tselai
On Tue, Jun 10, 2025 at 2:08 AM Jelte Fennema-Nio wrote: > On Mon, 9 Jun 2025 at 17:54, Florents Tselai > wrote: > > Here’s a quick attempt that makes %S substitue for a search_path > > Like > > \set PROMPT1 'user:%n search_path: %S' > > + else > + return PQuser(pset.db); > > That seems

Re: Cleaning up historical portability baggage

2025-06-10 Thread Michael Banck
Hi, On Tue, Jun 10, 2025 at 09:05:03AM +1200, Thomas Munro wrote: > On Tue, Jun 10, 2025 at 2:25 AM Andres Freund wrote: > > On 2025-06-09 15:25:22 +0200, Michael Banck wrote: > > > Postgres built fine up and until v15 on the Hurd, so this is a build > > > regression, and the fact that we define

Re: Sanding down some edge cases for PL/pgSQL reserved words

2025-06-10 Thread Pavel Stehule
Hi > > 1. AFAICS, there is no real reason for STRICT to be a reserved > rather than unreserved PL/pgSQL keyword, and for that matter not > EXECUTE either. Making them unreserved does allow some ambiguity, > but I don't think there's any surprises in how that ambiguity > would be resolved; and ce

Re: Safeguards against incorrect fd flags for fsync()

2025-06-10 Thread Michael Banck
Hi, On Wed, Oct 09, 2019 at 03:26:40PM +0900, Michael Paquier wrote: > After the set of issues discussed here, it seems to me that it would > be a good thing to have some safeguards against incorrect flags when > opening a fd which would be used for fsync(): > https://www.postgresql.org/message-id

Re: Add 64-bit XIDs into PostgreSQL 15

2025-06-10 Thread Evgeny Voropaev
Glad to see the activity around the full version of xid64! 1) About extra freezing in `freeze_single_heap_page`. At xid64v62 `freeze_single_heap_page` performs freezing via a call to `heap_page_prune_and_freeze`. Why, then, does `freeze_single_heap_page` perform freezing a second time? ``` f

Re: Extend COPY FROM with HEADER to skip multiple lines

2025-06-10 Thread Dagfinn Ilmari Mannsåker
Andrew Dunstan writes: > OTOH I'm a bit curious to know what software produces multi-line CSV > headers. AWS CloudFront access logs are stored in S3 as TSV files (one per hour per CF node) with a two-line header comment where the first line is the version and the second lists the fields (but not

Re: [PATCH] Refactor: Extract XLogRecord info

2025-06-10 Thread Steven Niu
I'm confused by the code of XLR_RMGR_INFO_MASK and XLR_INFO_MASK. According to the definition of masks, the high 4 bits are for rmgr. /* * The high 4 bits in xl_info may be used freely by rmgr. The * XLR_SPECIAL_REL_UPDATE and XLR_CHECK_CONSISTENCY bits can be passed by * XLogInsert caller. Th

RE: Replication slot is not able to sync up

2025-06-10 Thread Zhijie Hou (Fujitsu)
On Thu, May 29, 2025 at 11:09 AM shveta malik wrote: > > On Wed, May 28, 2025 at 11:56 AM Masahiko Sawada > wrote: > > > > > > I didn't know it was intended for testing and debugging purposes so > > clearilying it in the documentation would be a good idea. > > I have added the suggested docs i

Re: [PATCH] Add CANONICAL option to xmlserialize

2025-06-10 Thread Jim Jones
rebase and add an extra check for xmlbuf after the xmlC14NDocDumpMemory call: if (nbytes < 0 || xmlbuf == NULL) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("could not canonicalize XML document"))); -- Jim From b892f597cbb8c88cdc9db60adb4f407b5b

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-06-10 Thread jian he
On Tue, Jun 10, 2025 at 6:48 AM Dmitry Koval wrote: > 3. > >i think, we can do the following way: > >if (modelRel->rd_rel->relam) > > elog(ERROR, "error"); > >relamId = modelRel->rd_rel->relam; > > Can you clarify what is reason to change the current AM-logic for > creating a new partition? >

  1   2   >