Re: Request for Implementation of Custom Error Messages for CHECK Constraints

2025-05-12 Thread Bruce Momjian
On Mon, May 12, 2025 at 11:22:21AM -0700, David G. Johnston wrote: > On Monday, May 12, 2025, Bruce Momjian wrote: > > Yeah, you could name the constraint > "Custom_error_message_when_the_condition_is_not_met." and then just > convert underscore to spaces and display that to the user.

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

2025-05-12 Thread Matthias van de Meent
On Sun, 11 May 2025 at 14:06, Manish Rai Jain wrote: > > Hi hackers, > > I’ve been exploring the idea of integrating an LSM tree–based storage engine > into PostgreSQL — similar in spirit to MyRocks for MySQL — by replacing the > underlying storage while preserving PostgreSQL’s upper layers (pla

Re: INSERT ... ON CONFLICT DO SELECT [FOR ...] take 2

2025-05-12 Thread Andreas Karlsson
On 3/31/25 5:33 PM, Dean Rasheed wrote: On 3/4/25 10:24 AM, Andreas Karlsson wrote: Rebased the patch to add support for OLD.* and NEW.*. I took a closer look at this, and I have a number of comments: Thanks for taking a look and improving my patch! And thanks to Kirill too. * The changes

Re: Request for Implementation of Custom Error Messages for CHECK Constraints

2025-05-12 Thread David G. Johnston
On Monday, May 12, 2025, Bruce Momjian wrote: > > > Yeah, you could name the constraint > "Custom_error_message_when_the_condition_is_not_met." and then just > convert underscore to spaces and display that to the user. > > The 63 byte limit seems much more likely to be a factor if the name has to

Re: Request for Implementation of Custom Error Messages for CHECK Constraints

2025-05-12 Thread Bruce Momjian
On Sat, May 10, 2025 at 07:58:47PM -0400, Tom Lane wrote: > "Miguel Ferreira" writes: > > I propose extending the syntax of the ALTER TABLE ADD CONSTRAINT > > statement (and potentially CREATE TABLE) to allow for the > > specification of a custom error message for each CHECK constraint. > > Why d

Re: Small fixes needed by high-availability tools

2025-05-12 Thread Ants Aasma
Hi, dropping in my 2 cents here. On Mon, 12 May 2025 at 18:42, Andrey Borodin wrote: > >> Problem: user might try to cancel locally committed transaction and if we > >> do so we will show non-replicated data as committed. This leads to loosing > >> data with UPSERTs. > > > > Could you explain w

Re: Useless LEFT JOIN breaks MIN/MAX optimization

2025-05-12 Thread Tom Lane
Robert Haas writes: > But that's also assuming that you're correct here about how to descend > through a JoinExpr, which I'm not quite sure whether is true. It's > also assuming that we should solve the problem here rather than in > some other part of the code e.g. the join removal code, and I'm n

Re: libcurl in libpq.pc

2025-05-12 Thread Jacob Champion
On Mon, May 12, 2025 at 8:49 AM Jacob Champion wrote: > > On Mon, May 12, 2025 at 3:50 AM Christoph Berg wrote: > > Since nothing in libpq should need curl for compiling, should we drop > > it there instead? > > The static build (libpq.a) still needs libcurl. The module is only > compiled for use

Re: libcurl in libpq.pc

2025-05-12 Thread Jacob Champion
On Mon, May 12, 2025 at 3:50 AM Christoph Berg wrote: > Since nothing in libpq should need curl for compiling, should we drop > it there instead? The static build (libpq.a) still needs libcurl. The module is only compiled for use by the shared library. --Jacob

Allow reading LSN written by walreciever, but not flushed yet

2025-05-12 Thread Andrey Borodin
Moved off from "Small fixes needed by high-availability tools" > On 12 May 2025, at 01:33, Amit Kapila wrote: > > On Fri, May 2, 2025 at 6:30 PM Andrey Borodin wrote: >> >> 3. Allow reading LSN written by walreciever, but not flushed yet >> >> Problem: if we have synchronous_standby_names = A

Re: add tab-complete for ALTER DOMAIN ADD...

2025-05-12 Thread Álvaro Herrera
On 2025-May-12, Fujii Masao wrote: > I have no objection to this commit. However, I had assumed we would > wait to commit changes like this - which aren't bug fixes or > v18-related oversights - until master becomes the development branch > for v19. Maybe I'm missing something.. Yeah, fair questi

Re: Small fixes needed by high-availability tools

2025-05-12 Thread Andrey Borodin
> On 6 May 2025, at 12:00, Matthias van de Meent > wrote: > > On Fri, 2 May 2025 at 15:00, Andrey Borodin wrote: >> >> Hi hackers! >> >> I want to revive attempts to fix some old edge cases of physical quorum >> replication. >> >> Please find attached draft patches that demonstrate ideas.

Re: add tab-complete for ALTER DOMAIN ADD...

2025-05-12 Thread Tom Lane
Fujii Masao writes: > On 2025/05/11 23:22, Álvaro Herrera wrote: >> Done that, and pushed. > I have no objection to this commit. However, I had assumed we would > wait to commit changes like this - which aren't bug fixes or > v18-related oversights - until master becomes the development branch >

Re: [PATCH] Fix replica identity mismatch for partitioned tables with publish_via_partition_root

2025-05-12 Thread Maxim Orlov
Hi! This is probably not the most familiar part of Postgres to me, but does it break anything? Or is it just inconsistency in the replication protocol? A test for the described scenario would be a great addition. And, if it is feasible, provide an example of what would be broken with the way part

Re: Why our Valgrind reports suck

2025-05-12 Thread Tom Lane
=?utf-8?Q?=C3=81lvaro?= Herrera writes: > On 2025-May-11, Tom Lane wrote: >> In particular, I had not realized that autovacuum >> leaks a nontrivial amount of memory per relation processed (cf 0009), >> and apparently has done for a few releases now. This is horrid in >> databases with many table

Re: Why our Valgrind reports suck

2025-05-12 Thread Álvaro Herrera
On 2025-May-11, Tom Lane wrote: > Okay, here is a patch series that updates the > 0001-Make-memory-contexts-themselves-more-visible-to-valg.patch > patch you posted in that thread, and makes various follow-up > fixes that either fix or paper over various leaks. Wow, that's a lot of extra fixes.

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

2025-05-12 Thread Peter Geoghegan
On Sun, May 11, 2025 at 11:09 PM Tomas Vondra wrote: > I where "revert" is master with the removal patch. Sorry about the > confusion, I guess I was distracted and did some mistake. > > So, this seems to be in line with the hypothesis ... That makes way more sense. I wonder if we can fix this pr

Re: Vacuum statistics

2025-05-12 Thread Amit Kapila
On Fri, May 9, 2025 at 5:34 PM Alena Rybakina wrote: > > I did a rebase and finished the part with storing statistics separately from > the relation statistics - now it is possible to disable the collection of > statistics for relationsh using gucs and > this allows us to solve the problem with

libcurl in libpq.pc

2025-05-12 Thread Christoph Berg
Re: Jacob Champion > Wolfgang reported over in [1] that I've missed a comma when appending > to the PKG_CONFIG_REQUIRES_PRIVATE list, making libpq.pc look ugly: > > Requires.private: libssl, libcrypto libcurl Is adding libcurl there even the right move? This will make all programs using pkgco

[PATCH v2] Re: Cancel problems of query to pg_stat_statements

2025-05-12 Thread Roman Khapov
Hi! Thanks for the review! Its true that qtext_load_file() can be called with acquired lock in pg_stat_statements_internal()… So I perform INTERRUPTS_PENDING_CONDITION in v2 patch and call CHECK_FOR_INTERRUPTS later, after cycle ended and lock released. v2-cancelable-qtext_load_file.patch D

Re: Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache

2025-05-12 Thread Amit Kapila
On Mon, Apr 28, 2025 at 2:43 PM Nazir Bilal Yavuz wrote: > > Hi, > > On Fri, 25 Apr 2025 at 19:17, Xuneng Zhou wrote: > > > > > > Would love to hear if this makes sense or or am I overlooking something > > here. Thanks for any feedback! > > I think what you said makes sense and is correct if we

Re: Small fixes needed by high-availability tools

2025-05-12 Thread Amit Kapila
On Fri, May 2, 2025 at 6:30 PM Andrey Borodin wrote: > > > I want to revive attempts to fix some old edge cases of physical quorum > replication. > > Please find attached draft patches that demonstrate ideas. These patches are > not actually proposed code changes, I rather want to have a design

Consider explicit incremental sort for Append and MergeAppend

2025-05-12 Thread Richard Guo
For ordered Append or MergeAppend, it seems that incremental sort is currently not considered when injecting an explicit sort into subpaths that are not sufficiently ordered. For instance: set enable_seqscan to off; explain (costs off) select hundred as x, two as y from tenk1 union all select th

Re: Add an option to skip loading missing publication to avoid logical replication failure

2025-05-12 Thread Xuneng Zhou
If the presumed theory regarding the cause of the issue is correct — as outlined in this email — and no data replication occurs in this scenario

Re: Fix slot synchronization with two_phase decoding enabled

2025-05-12 Thread shveta malik
On Sat, May 10, 2025 at 4:59 PM Amit Kapila wrote: > > On Tue, May 6, 2025 at 4:52 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Mon, May 5, 2025 at 6:59 PM Amit Kapila wrote: > > > > > > > > > Yes, this is possible. Here is my theory as to how it can happen in the > > > current > > > case. In the

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2025-05-12 Thread Dmitry Koval
Hi! We (with colleagues) discussed further improvements to SPLIT/MERGE PARTITION(S). As a result of the discussion, the following answers to the questions remained: 1. Who should be the owner of new partitions (SPLIT PARTITION command) if owner of the partition being split is not the same as

Re: add tab-complete for ALTER DOMAIN ADD...

2025-05-12 Thread Fujii Masao
On 2025/05/11 23:22, Álvaro Herrera wrote: On 2025-Apr-29, Dagfinn Ilmari Mannsåker wrote: jian he writes: + /* ALTER DOMAIN ADD */ + else if (Matches("ALTER", "DOMAIN", MatchAny, "ADD")) + COMPLETE_WITH("CONSTRAINT", "NOT NULL", "CHECK"); I think the complet

Re: queryId constant squashing does not support prepared statements

2025-05-12 Thread Dmitry Dolgov
> On Fri, May 09, 2025 at 12:47:19PM GMT, Sami Imseih wrote: > So, I think we can create a new parse node ( parsenode.h ) that will only be > used in parsing (and gram.c only ) to track the start/end locations > and List and > based on this node we can create A_ArrayExpr and A_Expr with the List >

Re: queryId constant squashing does not support prepared statements

2025-05-12 Thread Dmitry Dolgov
> On Fri, May 09, 2025 at 10:12:24AM GMT, Dmitry Dolgov wrote: > Agree, I'll try to extend number of test cases here as a separate patch. Here is the extended version, where start/end is replaced by location/length, array_expr is handled as well, and more ARRAY cases are added. >From 81fe0b08473ea