Re: Logical Replication of sequences

2025-05-28 Thread Ajin Cherian
On Fri, May 23, 2025 at 3:12 AM vignesh C wrote: > > > The attached v20250522 patch has the changes for the same. > > Regards, > Vignesh > Some review comments for patch 0001: 1. In src/backend/commands/sequence.c in pg_sequence_state() + /* open and lock sequence */ + init_sequence(seq_relid, &

backend_xmin is null in pg_stat_replication, although repl. slot change it

2025-05-28 Thread Pavel Stehule
Hi why, backend_xmin from pg_stat_replication is not updated, although used related replication slot effectively use something like this and blocks removing dead tuples? postgres=# select slot_name, age(xmin) from pg_replication_slots; -[ RECORD 1 ]- slot_name | readonly01 age | 111

Re: Clarification on warning when connecting to 'pgbouncer' database via Pgbouncer

2025-05-28 Thread Shaik Mohammad Mujeeb
> The entire point of having a wire protocol is that you can't/don't > need to detect that.  The short answer here is that this is > pgbouncer's bug and you should be nagging them to change, not us. Assuming we've requested the PgBouncer team to stop abusing the server_version parameter for

Re: Add comment explaining why queryid is int64 in pg_stat_statements

2025-05-28 Thread Michael Paquier
On Thu, May 22, 2025 at 01:01:14PM +0900, Michael Paquier wrote: > I have added an open item about the plan ID part as it applies to v18, > adding the RMT in CC to get an opinion. If we cannot get a consensus > on all that, letting things as they are is still logically correct, > even with the -Ww

Re: Foreign key validation failure in 18beta1

2025-05-28 Thread Tender Wang
Tender Wang 于2025年5月28日周三 20:38写道: > > > Alvaro Herrera 于2025年5月28日周三 20:26写道: > >> On 2025-May-28, Tender Wang wrote: >> >> > I dided the codes, in QueueFKConstraintValidation(), we add three >> > newconstraint for the >> > fk rel, because the pk rel is partition table. >> > >> > During phase

Re: Add AioUringCompletion in wait_event_names.txt and a safeguard in generate-wait_event_types.pl

2025-05-28 Thread Michael Paquier
On Tue, May 27, 2025 at 08:30:56AM +0900, Michael Paquier wrote: > +AioUringCompletion "Waiting for another process to complete IO via io_uring." > > "completion_lock" is described with similar words around the top of > method_io_uring.c. In more exact words, we are waiting for a backend > to pro

Re: Proposals for EXPLAIN: rename ANALYZE to EXECUTE and extend VERBOSE

2025-05-28 Thread Fujii Masao
On 2024/12/14 0:59, Michael Christofides wrote: > I've pushed the main patch. Woohoo! And thank you. I've already seen quite a lot of positivity around the commit on Twitter[1][2][3]. > I'm not planning on pushing the auto_explain.log_buffers default change unless there's a bit more disc

Re: Conflict detection for update_deleted in logical replication

2025-05-28 Thread Dilip Kumar
On Tue, May 27, 2025 at 11:45 AM Amit Kapila wrote: > > On Mon, May 26, 2025 at 12:46 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Sun, May 25, 2025 at 4:36 PM Dilip Kumar wrote: > > > > > > > > I am thinking can't we make it more deterministic such that when we > > > get the status first time if

Re: Virtual generated columns

2025-05-28 Thread Richard Guo
On Fri, May 16, 2025 at 5:35 PM jian he wrote: > we have used the USING expression in ATPrepAlterColumnType, > ATColumnChangeRequiresRewrite. > expanding it on ATPrepAlterColumnType seems to make more sense? > > @@ -14467,7 +14467,7 @@ ATPrepAlterColumnType(List **wqueue, > */ >

Re: PG 18 release notes draft committed

2025-05-28 Thread Bruce Momjian
On Wed, May 28, 2025 at 08:07:20PM -0400, Melanie Plageman wrote: > For the item: > > "Increase the logging granularity of server variable log_connections" > > I noticed that you cite the commit 9219093cab2 that actually does > modularize the GUC but you also cite a separate following commit > 18

Re: Assertion failure in smgr.c when using pg_prewarm with partitioned tables

2025-05-28 Thread Masahiro Ikeda
Thanks for your feedback. I've attached the updated patches. On 2025-05-28 10:10, Fujii Masao wrote: On 2025/05/26 16:55, ikedamsh wrote: 2025/05/21 12:54 Fujii Masao : Regarding the 0002 patch: - errdetail("Relation \"%s\" is a %s index.", -RelationGetRelationName(rel), NameSt

Re: queryId constant squashing does not support prepared statements

2025-05-28 Thread Michael Paquier
On Wed, May 28, 2025 at 04:05:03PM -0500, Sami Imseih wrote: > That's my mistake. I added a new file called normalize.sql to test > specific normalization scenarios. Added in v7 Thanks. I was not sure that a new file was worth having for these tests, knowing that select.sql has similar coverage.

Re: PG 18 release notes draft committed

2025-05-28 Thread Melanie Plageman
On Thu, May 1, 2025 at 10:44 PM Bruce Momjian wrote: > > I will continue improving it until beta 1, and until the final release. Hi Bruce, Thanks so much for putting these together. For the item: "Increase the logging granularity of server variable log_connections" I noticed that you cite the

Re: Document How Commit Handles Aborted Transactions

2025-05-28 Thread David G. Johnston
Recent discussion led me to realize we are also contrary to the SQL Standard here. v3 updates the Commit reference page to reflect this fact. Leaving ready-to-commit. David J. From 9e19152958130f7610feab7983221aace7abfe20 Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Wed, 28 May 2025

Re: PG 18 release notes draft committed

2025-05-28 Thread Bruce Momjian
On Wed, May 28, 2025 at 02:54:29PM -0400, Joe Conway wrote: > On 5/27/25 17:27, Bruce Momjian wrote: > > On Mon, May 26, 2025 at 10:20:08AM -0400, Joe Conway wrote: > > > On 5/23/25 09:47, Bruce Momjian wrote: > > > > On Fri, May 23, 2025 at 09:54:54AM +0200, Álvaro Herrera wrote: > > > > > I also

Re: PG 18 release notes draft committed

2025-05-28 Thread Bruce Momjian
On Wed, May 28, 2025 at 11:25:03PM +0900, Yugo Nagata wrote: > On Wed, 28 May 2025 23:14:36 +0900 > Yugo Nagata wrote: > > > On Thu, 1 May 2025 22:44:50 -0400 > > Bruce Momjian wrote: > > > > > I have committd the first draft of the PG 18 release notes. The item > > > count looks strong: > >

Re: Correct documentation for protocol version

2025-05-28 Thread Dave Cramer
On Tue, 22 Apr 2025 at 10:34, Dave Cramer wrote: > > On Fri, 11 Apr 2025 at 11:02, Jelte Fennema-Nio > wrote: > >> On Fri, 11 Apr 2025 at 22:57, Dave Cramer wrote: >> > Well this isn't quite true since if you request 3.0 and have invalid >> options it will return 3.0, which is not the highest s

Re: Standardize the definition of the subtype field of AlterDomainStmt

2025-05-28 Thread Quan Zongliang
Updated On 2025/5/28 19:30, Tender Wang wrote: Peter Eisentraut mailto:pe...@eisentraut.org>> 于 2025年5月28日周三 19:23写道: On 27.05.25 05:06, Quan Zongliang wrote: > I noticed that the subtype of AlterDomainStmt is directly using > constants in the code. It is not conducive to the

Re: pg16 && GSSAPI && Heimdal/Macos

2025-05-28 Thread Jacob Champion
On Wed, May 28, 2025 at 2:59 PM Tom Lane wrote: > (That should make the above-depicted elog unreachable, but > belt and suspenders too isn't a bad plan.) I like that approach, if delegation on Mac ends up being too much of a pain. --Jacob

Re: pg16 && GSSAPI && Heimdal/Macos

2025-05-28 Thread Tom Lane
Jacob Champion writes: > - I also want to draw attention to the fact that libpq can't claim > that a credential is delegated if it's not; that breaks the security > of our FDWs. So pg_store_delegated_credential() cannot be a no-op. Right. What I had in mind if we cannot find an alternative imple

Re: pg16 && GSSAPI && Heimdal/Macos

2025-05-28 Thread Jacob Champion
On Wed, May 28, 2025 at 9:25 AM Jacob Champion wrote: > Personally, I'd be more happy to "maintain GSS on Mac using > non-deprecated interfaces" than "maintain GSS via Heimdal, > best-effort, some of the time". I think the former puts less of a > burden on our testing matrix. I was curious enough

Re: queryId constant squashing does not support prepared statements

2025-05-28 Thread Sami Imseih
>> * 0001: > You have mentioned the addition of tests, but v6-0001 includes nothing > of the kind. Am I missing something? How much coverage did you > intend to add here? These seem to be included in squashing.sql in > patch v6-0002, but IMO this should be moved somewhere else to work > with th

Re: Fixing memory leaks in postgres_fdw

2025-05-28 Thread Tom Lane
I wrote: > Having said that, the idea that this sequence is OOM-safe is pretty > silly anyway, considering that createNewConnection does a pstrdup, > and creates a new hashtable entry which might require enlarging the > hashtable, and for that matter might even create the hashtable. > So maybe rath

Re: Add CHECK_FOR_INTERRUPTS in polling loop code path in XactLockTableWait

2025-05-28 Thread Kevin K Biju
Hi Fujii, The WaitEvent sounds good to me, I will submit a separate patch for that when I find time. Kevin On Wed, May 28, 2025 at 5:06 PM Fujii Masao wrote: > > > On 2025/05/27 4:43, Kevin K Biju wrote: > > Hi Fujii, > > > > Thanks for the review. > > So unless there are any objections, I'm p

Re: PG 18 release notes draft committed

2025-05-28 Thread Joe Conway
On 5/27/25 17:27, Bruce Momjian wrote: On Mon, May 26, 2025 at 10:20:08AM -0400, Joe Conway wrote: On 5/23/25 09:47, Bruce Momjian wrote: > On Fri, May 23, 2025 at 09:54:54AM +0200, Álvaro Herrera wrote: > > I also think that showing an XML-ish format of a commit message is > > unhelpful, not to

Re: fix: propagate M4 env variable to flex subprocess

2025-05-28 Thread J. Javier Maestro
On Wed, May 28, 2025 at 6:08 PM Andres Freund wrote: > Hi, > > On 2025-05-17 23:32:24 -0400, J. Javier Maestro wrote: > > On Tue, May 13, 2025 at 11:54 AM Andres Freund > wrote: > > > Bilal, I think you wrote this originally, do you recall? > > > > > > It seems like an issue beyond just M4... >

Re: Expression push down from Join Node to below node.

2025-05-28 Thread Shubhankar Anand Kulkarni
Can you please resolve the doubt mentioned in the below thread? Thanks &Regards Shubhankar K Zlabs-CStore Member of Technical Staff, Zoho On Mon, 26 May 2025 16:58:12 +0530 Shubhankar Anand Kulkarni wrote --- Hi Andy, Thanks for the reply. As suggested, I tried using CTE which

Re: fix: propagate M4 env variable to flex subprocess

2025-05-28 Thread Andres Freund
Hi, On 2025-05-17 23:32:24 -0400, J. Javier Maestro wrote: > On Tue, May 13, 2025 at 11:54 AM Andres Freund wrote: > > Bilal, I think you wrote this originally, do you recall? > > > > It seems like an issue beyond just M4... > > > > IIRC the rest of the tools in the environment have ways to be s

Re: wrong query results on bf leafhopper

2025-05-28 Thread Andres Freund
Hi, On 2025-05-28 22:51:14 +0930, Robins Tharakan wrote: > On Tue, 20 May 2025 at 15:20, David Rowley wrote: > > > On Tue, 20 May 2025 at 16:07, Tom Lane wrote: > > > Failures like this one [1]: > > > > > > @@ -340,9 +340,13 @@ > > > create function myinthash(myint) returns integer strict immu

Re: PG 18 release notes draft committed

2025-05-28 Thread Bruce Momjian
On Wed, May 28, 2025 at 10:55:50AM +0100, Dean Rasheed wrote: > For "Improve the speed of multiplication", I think it should say > "numeric multiplication" rather than simply "multiplication", and I > think it's worth also linking to commits ca481d3c9ab and c4e44224cf6 > which were part of the same

Re: pg16 && GSSAPI && Heimdal/Macos

2025-05-28 Thread Jacob Champion
On Wed, May 28, 2025 at 8:53 AM Tom Lane wrote: > Even granting that we're okay with letting people build against > Heimdal, I'm not clear on the path forward. Your patch proposes > to effectively disable gss_accept_delegation, which isn't real > palatable (and would require docs and test fixes t

Re: pg16 && GSSAPI && Heimdal/Macos

2025-05-28 Thread Tom Lane
"Todd M. Kover" writes: > Wehere did this end up getting decided? I'm hoping, if it's going to > make it into main/master, it will be able to also make it's way ingo pg18. I don't think anything's been decided. I've expressed my opinion, but I'm just one person. I'd hoped some other people who

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

2025-05-28 Thread Tomas Vondra
On 5/28/25 16:22, Dimitrios Apostolou wrote: > Hello, sorry for mass sending this, but I didn't get any response to my > first email [1] so I'm now CC'ing the commit's 4d330a6 [2] author and > the reviewers. I think it's an important issue, because I need to > custom-compile postgresql to have wh

Re: Logical Replication of sequences

2025-05-28 Thread Nisha Moond
On Thu, May 22, 2025 at 10:42 PM vignesh C wrote: > > > The attached v20250522 patch has the changes for the same. > Thank you for the patches, please find comments for patch-0004. 1) +/* + * report_error_sequences + * + * Logs a warning listing all sequences that are missing on the publisher, +

Re: pg16 && GSSAPI && Heimdal/Macos

2025-05-28 Thread Todd M. Kover
Wehere did this end up getting decided? I'm hoping, if it's going to make it into main/master, it will be able to also make it's way ingo pg18. As Nico wrote, my interest in opening this was especially for Apple's implementation of Kerberos (and to a lesser extent NetBSD and FreeBSD)'s which, tod

Re: wrong query results on bf leafhopper

2025-05-28 Thread Tom Lane
Robins Tharakan writes: > I didn't dive in deeper but I see that indri failed recently [1] on what > seems > like the exact same test / line-number (at t/027_stream_regress.pl line 95) > that leafhopper has been tripping on recently. The error is not verbatim, > but it was a little too coincidenta

Re: fix: propagate M4 env variable to flex subprocess

2025-05-28 Thread J. Javier Maestro
On Tue, May 20, 2025 at 8:53 AM Nazir Bilal Yavuz wrote: > Hi, > > On Tue, 13 May 2025 at 18:54, Andres Freund wrote: > > > > Hi, > > > > On 2025-05-12 23:14:59 -0400, J. Javier Maestro wrote: > > > The pgflex wrapper runs flex with an explicit environment, so it > doesn't > > > inherit environm

Re: PG 18 release notes draft committed

2025-05-28 Thread Yugo Nagata
On Wed, 28 May 2025 23:14:36 +0900 Yugo Nagata wrote: > On Thu, 1 May 2025 22:44:50 -0400 > Bruce Momjian wrote: > > > I have committd the first draft of the PG 18 release notes. The item > > count looks strong: > > Some items in the "EXPLAIN" section are actually not about the EXPLAIN > but

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

2025-05-28 Thread Dimitrios Apostolou
Hello, sorry for mass sending this, but I didn't get any response to my first email [1] so I'm now CC'ing the commit's 4d330a6 [2] author and the reviewers. I think it's an important issue, because I need to custom-compile postgresql to have what I had before: a transparently compressed databas

Re: PG 18 release notes draft committed

2025-05-28 Thread Yugo Nagata
On Thu, 1 May 2025 22:44:50 -0400 Bruce Momjian wrote: > I have committd the first draft of the PG 18 release notes. The item > count looks strong: Some items in the "EXPLAIN" section are actually not about the EXPLAIN but the ANALYZE command. The attached patch is move them to the "Utility Com

Re: wrong query results on bf leafhopper

2025-05-28 Thread Robins Tharakan
On Tue, 20 May 2025 at 15:20, David Rowley wrote: > On Tue, 20 May 2025 at 16:07, Tom Lane wrote: > > Failures like this one [1]: > > > > @@ -340,9 +340,13 @@ > > create function myinthash(myint) returns integer strict immutable > language > >internal as 'hashint4'; > > NOTICE: argument t

Re: Foreign key validation failure in 18beta1

2025-05-28 Thread Tender Wang
Alvaro Herrera 于2025年5月28日周三 20:26写道: > On 2025-May-28, Tender Wang wrote: > > > I dided the codes, in QueueFKConstraintValidation(), we add three > > newconstraint for the > > fk rel, because the pk rel is partition table. > > > > During phase 3 of AlterTable, in ATRewriteTables(), > > call val

Re: Foreign key validation failure in 18beta1

2025-05-28 Thread Alvaro Herrera
On 2025-May-28, Tender Wang wrote: > I dided the codes, in QueueFKConstraintValidation(), we add three > newconstraint for the > fk rel, because the pk rel is partition table. > > During phase 3 of AlterTable, in ATRewriteTables(), > call validateForeignKeyConstraint() three times. > The first t

Re: Foreign key validation failure in 18beta1

2025-05-28 Thread Tender Wang
Tender Wang 于2025年5月28日周三 18:54写道: > > > Antonin Houska 于2025年5月28日周三 15:51写道: > >> I've come across an unexpected ERROR during validation of FK constraint >> in PG >> 18beta1. The same works in PG 17: >> >> drop table if exists fk; >> drop table if exists pk; >> create table pk(i int primary ke

Re: ALTER TABLE ALTER CONSTRAINT misleading error message

2025-05-28 Thread Álvaro Herrera
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: ALTER TABLE t ALTER CONSTRAINT cc not valid; >

Re: Add CHECK_FOR_INTERRUPTS in polling loop code path in XactLockTableWait

2025-05-28 Thread Fujii Masao
On 2025/05/27 4:43, Kevin K Biju wrote: Hi Fujii, Thanks for the review. So unless there are any objections, I'm planning to commit the patch with the following commit message. --- Make XactLockTableWait() and ConditionalXactLockTableWait() interruptable more. Previously, Xact

Re: Standardize the definition of the subtype field of AlterDomainStmt

2025-05-28 Thread Tender Wang
Peter Eisentraut 于2025年5月28日周三 19:23写道: > On 27.05.25 05:06, Quan Zongliang wrote: > > I noticed that the subtype of AlterDomainStmt is directly using > > constants in the code. It is not conducive to the maintenance and > > reading of the code. Based on the definition of AlterTableType, use > >

Re: Suggestion : support for environment variable in initdb to set the superuser password

2025-05-28 Thread Peter Eisentraut
On 27.05.25 11:43, Reda Agaoua wrote: I do believe it can be useful in a variety of settings, but I'm not sure whether this is secure. Specifically, the documentation advises against using PGPASSWORD for connecting to postgres : "Use of this environment variable is not recommended for security

Re: Standardize the definition of the subtype field of AlterDomainStmt

2025-05-28 Thread Peter Eisentraut
On 27.05.25 05:06, Quan Zongliang wrote: I noticed that the subtype of AlterDomainStmt is directly using constants in the code. It is not conducive to the maintenance and reading of the code. Based on the definition of AlterTableType, use "AD_" as the prefix. Define several macros to replace th

Re: Foreign key validation failure in 18beta1

2025-05-28 Thread Tender Wang
Antonin Houska 于2025年5月28日周三 15:51写道: > I've come across an unexpected ERROR during validation of FK constraint in > PG > 18beta1. The same works in PG 17: > > drop table if exists fk; > drop table if exists pk; > create table pk(i int primary key) partition by range (i); > create table pk_1 part

Re: MERGE issues around inheritance

2025-05-28 Thread Tender Wang
Dean Rasheed 于2025年5月28日周三 18:26写道: > On Mon, 26 May 2025 at 12:50, Tender Wang wrote: > > > >> > "it is possible for the parent to be excluded from the > >> > plan and so all of the entries in the resultRelInfo array may be for > >> > different relations than rootResultRelInfo." > >> > > >> >

Re: MERGE issues around inheritance

2025-05-28 Thread Dean Rasheed
On Mon, 26 May 2025 at 12:50, Tender Wang wrote: > >> > "it is possible for the parent to be excluded from the >> > plan and so all of the entries in the resultRelInfo array may be for >> > different relations than rootResultRelInfo." >> > >> > I didn't fully understand the above sentence. Can y

Re: PG 18 release notes draft committed

2025-05-28 Thread Dean Rasheed
For "Improve the speed of multiplication", I think it should say "numeric multiplication" rather than simply "multiplication", and I think it's worth also linking to commits ca481d3c9ab and c4e44224cf6 which were part of the same work. I think it's also worth mentioning 9428c001f67, which sped up

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-05-28 Thread Richard Guo
On Thu, May 22, 2025 at 11:51 PM Tom Lane wrote: > BTW, in my mind the current thread is certainly v19 material, > so I have not looked at Richard's patch yet. Yeah, this patchset is targeted for v19. Maybe we could be more aggressive and have 0001 and 0002 in v18? (no chance for 0003 though)

Re: ALTER TABLE ALTER CONSTRAINT misleading error message

2025-05-28 Thread Tender Wang
jian he 于2025年5月28日周三 17:10写道: > 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: ALTER TABLE t ALTER CONSTRAINT cc not valid; >

ALTER TABLE ALTER CONSTRAINT misleading error message

2025-05-28 Thread jian he
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: ALTER TABLE t ALTER CONSTRAINT cc not valid; ^ the error message seems misleading, shou

Foreign key validation failure in 18beta1

2025-05-28 Thread Antonin Houska
I've come across an unexpected ERROR during validation of FK constraint in PG 18beta1. The same works in PG 17: drop table if exists fk; drop table if exists pk; create table pk(i int primary key) partition by range (i); create table pk_1 partition of pk for values from (0) to (1); create table pk

Re: ALTER DOMAIN ADD NOT NULL NOT VALID

2025-05-28 Thread jian he
On Thu, May 22, 2025 at 10:08 PM Quan Zongliang wrote: > > It makes sense to support the "NOT NULL NOT VALID" option. > > The two if statements in the AlterDomainNotNull() should be adjusted. > > if (typTup->typnotnull == notNull && !notNull) > ==> > if (!notNull && !typTup->typnotnull) > > > if (

Re: finish TODOs in to_json_is_immutable, to_jsonb_is_immutable also add tests on it

2025-05-28 Thread jian he
On Mon, May 19, 2025 at 9:09 AM jian he wrote: > > hi. > > somehow, I accidentally saw the TODOs (commits [3]) on jsonb.c and json.c > for functions: to_json_is_immutable and to_jsonb_is_immutable. > The attached patch is to finalize these TODOs. > > per coverage [1], [2], there was zero coverage