Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2024-04-29 Thread Maksim Milyutin
On 29.04.2024 23:59, Thomas Munro wrote: On Tue, Apr 30, 2024 at 7:17 AM Thomas Munro wrote: On Tue, Apr 30, 2024 at 6:47 AM Maksim Milyutin wrote: Should not we call at the end the StrategyFreeBuffer() function to add target buffer to freelist and not miss it after invalidation? Please ta

Re: speed up a logical replica setup

2024-04-29 Thread Amit Kapila
On Mon, Apr 29, 2024 at 5:28 PM Amit Kapila wrote: > > On Mon, Apr 29, 2024 at 5:23 PM Euler Taveira wrote: > I was trying to test this utility when 'sync_replication_slots' is on and it gets in an ERROR loop [1] and never finishes. Please find the postgresql.auto used on the standby attached. I

Re: Fix parallel vacuum buffer usage reporting

2024-04-29 Thread Anthonin Bonnefoy
I've done some additional tests to validate the reported numbers. Using pg_statio, it's possible to get the minimum number of block hits (Full script attached). -- Save block hits before vacuum SELECT pg_stat_force_next_flush(); SELECT heap_blks_hit, idx_blks_hit FROM pg_statio_all_tables where re

Re: tablecmds.c/MergeAttributes() cleanup

2024-04-29 Thread Ashutosh Bapat
On Mon, Apr 29, 2024 at 6:46 PM Robert Haas wrote: > On Sat, Apr 20, 2024 at 12:17 AM Ashutosh Bapat > wrote: > > Yes please. Probably this issue surfaced again after we reverted > compression and storage fix? Please If that's the case, please add it to > the open items. > > This is still on th

Re: Removing unneeded self joins

2024-04-29 Thread Alexander Lakhin
Hello Alexander, 23.10.2023 12:47, Alexander Korotkov wrote: I think this patch makes substantial improvement to query planning. It has received plenty of reviews. The code is currently in quite good shape. I didn't manage to find the cases when this optimization causes significant overhead to

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-29 Thread David G. Johnston
On Monday, April 29, 2024, Tom Lane wrote: > "David G. Johnston" writes: > > My solution to this was to rely on the fact that the bootstrap superuser > is > > assigned OID 10 regardless of its name. > > Yeah, I wrote it that way to start with too, but reconsidered > because > > (1) I don't like

Re: [PATCH] Fix bug when calling strncmp in check_authmethod_valid

2024-04-29 Thread Richard Guo
On Tue, Apr 30, 2024 at 10:41 AM Jingxian Li wrote: > Attached is a patch that fixes bug when calling strncmp function, in > which case the third argument (authmethod - strchr(authmethod, ' ')) > may be negative, which is not as expected.. Nice catch. I think you're right from a quick glance.

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-29 Thread Tom Lane
"David G. Johnston" writes: > My solution to this was to rely on the fact that the bootstrap superuser is > assigned OID 10 regardless of its name. Yeah, I wrote it that way to start with too, but reconsidered because (1) I don't like hard-coding numeric OIDs. We can avoid that in C code but it

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-29 Thread David G. Johnston
On Monday, April 29, 2024, Tom Lane wrote: > Daniel Gustafsson writes: > >> On 28 Apr 2024, at 20:52, Tom Lane wrote: > > > >> This is of course not bulletproof: with a sufficiently weird > >> bootstrap superuser name, we could get false matches to parts > >> of "regress_dump_test_role" or to p

Re: Help update PostgreSQL 13.12 to 13.14

2024-04-29 Thread Kashif Zeeshan
On Mon, Apr 29, 2024 at 9:07 PM •Isaac Rv wrote: > Ok entiendo sí, pero mi versión sigue en la 13.12 y necesito que sea > 13.14, me indica que ya no tiene actualizaciones pero realmente sí, ya no > sé cómo actualizarla a la 13.14 > Hi Please make sure that your postgres repository is set proper

Re: Synchronizing slots from primary to standby

2024-04-29 Thread shveta malik
On Mon, Apr 29, 2024 at 5:28 PM Zhijie Hou (Fujitsu) wrote: > > On Monday, April 29, 2024 5:11 PM shveta malik wrote: > > > > On Mon, Apr 29, 2024 at 11:38 AM shveta malik > > wrote: > > > > > > On Mon, Apr 29, 2024 at 10:57 AM Zhijie Hou (Fujitsu) > > > wrote: > > > > > > > > On Friday, March

Re: TerminateOtherDBBackends code comments inconsistency.

2024-04-29 Thread Amit Kapila
On Tue, Apr 30, 2024 at 2:58 AM Noah Misch wrote: > > On Mon, Apr 29, 2024 at 10:18:35AM +0530, Amit Kapila wrote: > > On Mon, Apr 22, 2024 at 9:56 PM Noah Misch wrote: > > > 3a9b18b309 didn't change the docs of pg_terminate_backend and whatever > > is mentioned w.r.t permissions in the doc of th

Re: pg_trgm comparison bug on cross-architecture replication due to different char implementation

2024-04-29 Thread Tom Lane
Masahiko Sawada writes: > On Tue, Apr 23, 2024 at 11:57 PM Tom Lane wrote: >> Reject as not a bug. Discourage people from thinking that physical >> replication will work across architectures. > While cross-arch physical replication is not supported, I think having > architecture dependent diffe

Re: CREATE TABLE/ProcessUtility hook behavior change

2024-04-29 Thread jian he
On Tue, Apr 30, 2024 at 10:26 AM David Steele wrote: > > Hackers, > > While testing pgAudit against PG17 I noticed the following behavioral > change: > > CREATE TABLE public.test > ( > id INT, > name TEXT, > description TEXT, > CONSTRAINT test_pkey PRIMARY KEY (id)

Re: pg_trgm comparison bug on cross-architecture replication due to different char implementation

2024-04-29 Thread Masahiko Sawada
On Tue, Apr 23, 2024 at 11:57 PM Tom Lane wrote: > > "Guo, Adam" writes: > > I would like to report an issue with the pg_trgm extension on > > cross-architecture replication scenarios. When an x86_64 standby > > server is replicating from an aarch64 primary server or vice versa, > > the gist_trgm

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-29 Thread Alexander Lakhin
30.04.2024 03:10, Dmitry Koval wrote: Hi! 1. 29.04.2024 21:00, Alexander Lakhin wrote: I still wonder, why that constraint (now with a less questionable name) is created during MERGE? The SPLIT/MERGE PARTITION(S) commands for creating partitions reuse the existing code of CREATE TABLE .. LIKE

[PATCH] Fix bug when calling strncmp in check_authmethod_valid

2024-04-29 Thread Jingxian Li
Hi all, Attached is a patch that fixes bug when calling strncmp function, in which case the third argument (authmethod - strchr(authmethod, ' ')) may be negative, which is not as expected.. With Regards, Jingxian Li. v1-0001-Fix-bug-when-calling-strncmp-in-check_authmethod_valid.patch Desc

CREATE TABLE/ProcessUtility hook behavior change

2024-04-29 Thread David Steele
Hackers, While testing pgAudit against PG17 I noticed the following behavioral change: CREATE TABLE public.test ( id INT, name TEXT, description TEXT, CONSTRAINT test_pkey PRIMARY KEY (id) ); NOTICE: AUDIT: SESSION,23,1,DDL,CREATE TABLE,TABLE,public.test,"CREAT

Re: Fix parallel vacuum buffer usage reporting

2024-04-29 Thread Masahiko Sawada
On Fri, Apr 26, 2024 at 9:12 PM Alena Rybakina wrote: > > Hi! >> >> The same script was run, but using vacuum verbose analyze, and I saw the >> difference again in the fifth step: >> with your patch: buffer usage: 32312 hits, 607 misses, 1566 dirtied >> master: buffer usage: 32346 hits, 573 misse

Re: A failure in prepared_xacts test

2024-04-29 Thread Tom Lane
Richard Guo writes: > +1. I'm kind of worried that the expansion of parallelization could > lead to more instances of instability. Alexander mentioned one such > case at [1]. I haven't looked into it though. > [1] > https://www.postgresql.org/message-id/cbf0156f-5aa1-91db-5802-82435dda03e6%40g

Re: A failure in prepared_xacts test

2024-04-29 Thread Richard Guo
On Tue, Apr 30, 2024 at 6:43 AM Michael Paquier wrote: > I'd be curious about any discussion involving the structure of the > meson tests. +1. I'm kind of worried that the expansion of parallelization could lead to more instances of instability. Alexander mentioned one such case at [1]. I ha

jsonpath Time and Timestamp Special Cases

2024-04-29 Thread David E. Wheeler
Hello hackers, I noticed that the jsonpath date/time functions (.time() and timestamp(), et al.) don’t support some valid but special-case PostgreSQL values, notably `infinity`, `-infinity`, and, for times, '24:00:00`: ❯ psql psql (17devel) Type "help" for help. david=# select jsonb_path_query

Re: A failure in prepared_xacts test

2024-04-29 Thread Richard Guo
On Mon, Apr 29, 2024 at 9:45 PM Tom Lane wrote: > Richard Guo writes: > > I noticed that some TAP tests from recovery and subscription would > > select the count from pg_prepared_xacts. I wonder if these tests would > > be affected if there are any prepared transactions on the backend. > > TAP

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-29 Thread Dmitry Koval
Hi! 1. 29.04.2024 21:00, Alexander Lakhin wrote: I still wonder, why that constraint (now with a less questionable name) is created during MERGE? The SPLIT/MERGE PARTITION(S) commands for creating partitions reuse the existing code of CREATE TABLE .. LIKE ... command. A new partition was cre

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-29 Thread Tom Lane
I wrote: > Pushed, thanks for reviewing! Argh, I forgot I'd meant to push b0c5b215d first not second. Oh well, it was only neatnik-ism that made me want to see those other animals fail --- and a lot of the buildfarm is red right now for $other_reasons anyway. regards, tom

Re: Logging which interface was connected to in log_line_prefix

2024-04-29 Thread Cary Huang
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Hi I did a quick test on this patch and it seems to work as

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-29 Thread Tom Lane
Daniel Gustafsson writes: > On 29 Apr 2024, at 21:15, Tom Lane wrote: >> v3 attached also has a bit more work on code comments. > LGTM. Pushed, thanks for reviewing! regards, tom lane

Re: Support tid range scan in parallel?

2024-04-29 Thread David Rowley
On Tue, 30 Apr 2024 at 10:36, Cary Huang wrote: > In one of our migration scenarios, we rely on tid range scan to migrate huge > table from one database to another once the lower and upper ctid bound is > determined. With the support of parallel ctid range scan, this process could > be done muc

Re: Support a wildcard in backtrace_functions

2024-04-29 Thread Michael Paquier
On Mon, Apr 29, 2024 at 08:08:19AM -0400, Robert Haas wrote: > On Mon, Apr 29, 2024 at 5:12 AM Peter Eisentraut wrote: >> Ok, it's reverted. Thanks for taking care of it. > Thanks, and sorry. :-( Sorry for the outcome.. -- Michael signature.asc Description: PGP signature

Re: A failure in prepared_xacts test

2024-04-29 Thread Michael Paquier
On Mon, Apr 29, 2024 at 09:45:16AM -0400, Tom Lane wrote: > TAP tests shouldn't be at risk, because there is no "make > installcheck" equivalent for them. Each TAP test creates its own > database instance (or maybe several), so that instance won't have > anything else going on. There are a few mo

Re: Internal error codes triggered by tests

2024-04-29 Thread Michael Paquier
On Mon, Apr 29, 2024 at 08:02:45AM -0500, Justin Pryzby wrote: > I sent a list of user-facing elogs here, a few times. > ZDclRM/jate66...@telsasoft.com > > And if someone had expressed an interest, I might have sent a longer > list. Thanks. I'll take a look at what you have there. Nothing would

Support tid range scan in parallel?

2024-04-29 Thread Cary Huang
Hello   When using ctid as a restriction clause with lower and upper bounds, PostgreSQL's planner will use TID range scan plan to handle such query. This works and generally fine. However, if the ctid range covers a huge amount of data, the planner will not use parallel worker to perform ctid ran

Re: TerminateOtherDBBackends code comments inconsistency.

2024-04-29 Thread Noah Misch
On Mon, Apr 29, 2024 at 10:18:35AM +0530, Amit Kapila wrote: > On Mon, Apr 22, 2024 at 9:56 PM Noah Misch wrote: > > > > On Mon, Apr 15, 2024 at 11:17:54AM +0530, Amit Kapila wrote: > > > On Thu, Apr 11, 2024 at 6:58 PM Kirill Reshke > > > wrote: > > > > > > > > While working on [0] i have notic

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2024-04-29 Thread Thomas Munro
On Tue, Apr 30, 2024 at 7:17 AM Thomas Munro wrote: > On Tue, Apr 30, 2024 at 6:47 AM Maksim Milyutin wrote: > >> Should not we call at the end the StrategyFreeBuffer() function to add > >> target buffer to freelist and not miss it after invalidation? > > > Please take a look at this issue, curr

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-29 Thread Daniel Gustafsson
> On 29 Apr 2024, at 21:15, Tom Lane wrote: > It occurred to me to use "aclexplode" to expand the initprivs, and > then we can substitute names with simple equality tests. The test > query is a bit more complicated, but I feel better about it. Nice, I didn't even remember that function existed.

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Jacob Champion
On Mon, Apr 29, 2024 at 12:32 PM Jacob Champion wrote: > > On Mon, Apr 29, 2024 at 12:06 PM Heikki Linnakangas wrote: > > On 29/04/2024 21:43, Jacob Champion wrote: > > > But if you're in that situation, what does the use of directonly give > > > you over `sslnegotiation=direct`? You already know

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Jacob Champion
On Mon, Apr 29, 2024 at 12:06 PM Heikki Linnakangas wrote: > On 29/04/2024 21:43, Jacob Champion wrote: > > But if you're in that situation, what does the use of directonly give > > you over `sslnegotiation=direct`? You already know that servers > > support direct, so there's no additional perform

Re: Direct SSL connection and ALPN loose ends

2024-04-29 Thread Ranier Vilela
Em seg., 29 de abr. de 2024 às 15:36, Heikki Linnakangas escreveu: > On 29/04/2024 21:06, Ranier Vilela wrote: > > Em seg., 29 de abr. de 2024 às 14:56, Heikki Linnakangas > > mailto:hlinn...@iki.fi>> escreveu: > > > > On 29/04/2024 20:10, Ranier Vilela wrote: > > > Hi, > > > > >

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2024-04-29 Thread Thomas Munro
On Tue, Apr 30, 2024 at 6:47 AM Maksim Milyutin wrote: >> Should not we call at the end the StrategyFreeBuffer() function to add >> target buffer to freelist and not miss it after invalidation? > Please take a look at this issue, current implementation of > EvictUnpinnedBuffer() IMO is erroneou

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-29 Thread Tom Lane
Daniel Gustafsson writes: >> On 28 Apr 2024, at 20:52, Tom Lane wrote: >> ... It's a little bit >> nasty to look at the ACL column of pg_init_privs, because that text >> involves the bootstrap superuser's name which is site-dependent. >> What I did to try to make the test stable is >> replace(ini

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Heikki Linnakangas
On 29/04/2024 21:43, Jacob Champion wrote: On Mon, Apr 29, 2024 at 1:38 AM Heikki Linnakangas wrote: If you only have v17 servers in your environment, so you know all servers support direct negotiation if they support SSL at all, but a mix of servers with and without SSL, sslnegotiation=directo

Re: Virtual generated columns

2024-04-29 Thread Corey Huinker
On Mon, Apr 29, 2024 at 4:24 AM Peter Eisentraut wrote: > Here is a patch set to implement virtual generated columns. > I'm very excited about this! > The main feature patch (0005 here) generally works but has a number of > open corner cases that need to be thought about and/or fixed, many of

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Jacob Champion
On Mon, Apr 29, 2024 at 11:43 AM Heikki Linnakangas wrote: > Note that if the client does not request ALPN at all, the callback is > not called, and the connection is accepted. Old clients still work > because they do not request ALPN. Ugh, sorry for the noise -- I couldn't figure out why all my

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2024-04-29 Thread Maksim Milyutin
On 14.04.2024 21:16, Maksim Milyutin wrote: On 07.04.2024 02:07, Thomas Munro wrote: So this is the version I plan to commit. +bool +EvictUnpinnedBuffer(Buffer buf) +{ ... +/* This will return false if it becomes dirty or someone else pins it. */ +result = InvalidateVictimBuffer(desc)

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Heikki Linnakangas
On 29/04/2024 21:04, Jacob Champion wrote: On Fri, Apr 26, 2024 at 3:51 PM Heikki Linnakangas wrote: I finally understood what you mean. So if the client supports ALPN, but the list of protocols that it provides does not include 'postgresql', the server should reject the connection with 'no_app

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Jacob Champion
On Mon, Apr 29, 2024 at 1:38 AM Heikki Linnakangas wrote: > Sure, we'd try to fix them ASAP. But we've had the SSLRequest > negotiation since time immemorial. If a new vulnerability is found, it's > unlikely that we'd need to disable the SSLRequest negotiation altogether > to fix it. We'd be in se

Re: Direct SSL connection and ALPN loose ends

2024-04-29 Thread Heikki Linnakangas
On 29/04/2024 21:06, Ranier Vilela wrote: Em seg., 29 de abr. de 2024 às 14:56, Heikki Linnakangas mailto:hlinn...@iki.fi>> escreveu: On 29/04/2024 20:10, Ranier Vilela wrote: > Hi, > > With TLS 1.3 and others there is possibly a security flaw using ALPN [1]. >

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-29 Thread Daniel Gustafsson
> On 28 Apr 2024, at 20:52, Tom Lane wrote: > > I wrote: >> Here's a draft patch that attacks that. It seems to fix the >> problem with test_pg_dump: no dangling pg_init_privs grants >> are left behind. Reading this I can't find any sharp edges, and I prefer your changes to recordExtensionInitP

Re: Possible to get LIMIT in an index access method?

2024-04-29 Thread Matthias van de Meent
On Mon, 29 Apr 2024 at 18:17, Chris Cleveland wrote: > > I'm developing an index access method. > > SELECT * > FROM foo > WHERE col <=> constant > ORDER BY col <==> constant > LIMIT 10; > > I'm successfully getting the WHERE and the ORDER BY clauses in my beginscan() > method. Is there any way to

Re: Direct SSL connection and ALPN loose ends

2024-04-29 Thread Ranier Vilela
Em seg., 29 de abr. de 2024 às 14:56, Heikki Linnakangas escreveu: > On 29/04/2024 20:10, Ranier Vilela wrote: > > Hi, > > > > With TLS 1.3 and others there is possibly a security flaw using ALPN [1]. > > > > It seems to me that the ALPN protocol can be bypassed if the client does > > not correct

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Jacob Champion
On Fri, Apr 26, 2024 at 3:51 PM Heikki Linnakangas wrote: > I finally understood what you mean. So if the client supports ALPN, but > the list of protocols that it provides does not include 'postgresql', > the server should reject the connection with 'no_applicaton_protocol' > alert. Right. (And

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-29 Thread Alexander Lakhin
Hi Dmitry, 19.04.2024 02:26, Dmitry Koval wrote: 18.04.2024 19:00, Alexander Lakhin wrote: leaves a strange constraint: \d+ t*    Table "public.tp_0" ... Not-null constraints: "merge-16385-26BCB0-tmp_i_not_null" NOT NULL "i" Thanks! Attached fix (

Re: Direct SSL connection and ALPN loose ends

2024-04-29 Thread Heikki Linnakangas
On 29/04/2024 20:10, Ranier Vilela wrote: Hi, With TLS 1.3 and others there is possibly a security flaw using ALPN [1]. It seems to me that the ALPN protocol can be bypassed if the client does not correctly inform the ClientHello header. So, the suggestion is to check the ClientHello header

Re: CVE's addressed in next update

2024-04-29 Thread Tom Lane
Mark Hill writes: > Do we know, is it posted anywhere on the postgresql.org site what CVE's will > be addressed in the next round up updates > to Postgres which should come out next Thursday, May 9th, 2024? We do not announce that sort of thing in advance. regards, tom l

CVE's addressed in next update

2024-04-29 Thread Mark Hill
Do we know, is it posted anywhere on the postgresql.org site what CVE's will be addressed in the next round up updates to Postgres which should come out next Thursday, May 9th, 2024? Thanks, Mark

re: Direct SSL connection and ALPN loose ends

2024-04-29 Thread Ranier Vilela
Hi, With TLS 1.3 and others there is possibly a security flaw using ALPN [1]. It seems to me that the ALPN protocol can be bypassed if the client does not correctly inform the ClientHello header. So, the suggestion is to check the ClientHello header in the server and terminate the TLS handshake

Possible to get LIMIT in an index access method?

2024-04-29 Thread Chris Cleveland
I'm developing an index access method. SELECT * FROM foo WHERE col <=> constant ORDER BY col <==> constant LIMIT 10; I'm successfully getting the WHERE and the ORDER BY clauses in my beginscan() method. Is there any way to get the LIMIT (or OFFSET, for that matter)? My access method is designed

Re: Tarball builds in the new world order

2024-04-29 Thread Tom Lane
Peter Eisentraut writes: > On 26.04.24 21:24, Tom Lane wrote: >> Concretely, I'm proposing the attached. Peter didn't like >> PG_COMMIT_HASH, so I have PG_COMMIT_REFSPEC below, but I'm not >> wedded to that if a better name is proposed. > This seems ok to me, but note that we do have an equivale

Re: Use streaming read API in ANALYZE

2024-04-29 Thread Nazir Bilal Yavuz
Hi, On Mon, 8 Apr 2024 at 04:21, Thomas Munro wrote: > > Pushed. Thanks Bilal and reviewers! I wanted to discuss what will happen to this patch now that 27bc1772fc8 is reverted. I am continuing this thread but I can create another thread if you prefer so. After the revert of 27bc1772fc8, acqui

Direct SSL connection and ALPN loose ends

2024-04-29 Thread Heikki Linnakangas
There's been a bunch of bugs, and discussion on the intended behavior of sslnegotiation and ALPN. This email summarizes the current status: ## Status and loose ends for beta1 All reported bugs have now been fixed. We now enforce ALPN in all the right places. Please let me know if I missed some

Re: A failure in prepared_xacts test

2024-04-29 Thread Tom Lane
Richard Guo writes: > I noticed that some TAP tests from recovery and subscription would > select the count from pg_prepared_xacts. I wonder if these tests would > be affected if there are any prepared transactions on the backend. TAP tests shouldn't be at risk, because there is no "make install

Re: New committers: Melanie Plageman, Richard Guo

2024-04-29 Thread Jimmy Yih
Big congrats to you two!!! - Jimmy -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidenti

Possible data race on Windows (src/bin/pg_dump/parallel.c)

2024-04-29 Thread Ranier Vilela
Hi, Per Coverity. CID 1542943: (#1 of 1): Data race condition (MISSING_LOCK) 3. missing_lock: Accessing slot->AH without holding lock signal_info_lock. Elsewhere, ParallelSlot.AH is written to with signal_info_lock held 1 out of 1 times (1 of these accesses strongly imply that it is necessary).

Re: tablecmds.c/MergeAttributes() cleanup

2024-04-29 Thread Robert Haas
On Sat, Apr 20, 2024 at 12:17 AM Ashutosh Bapat wrote: > Yes please. Probably this issue surfaced again after we reverted compression > and storage fix? Please If that's the case, please add it to the open items. This is still on the open items list and I'm not clear who, if anyone, is working

Re: Internal error codes triggered by tests

2024-04-29 Thread Justin Pryzby
I sent a list of user-facing elogs here, a few times. ZDclRM/jate66...@telsasoft.com And if someone had expressed an interest, I might have sent a longer list.

Re: Tarball builds in the new world order

2024-04-29 Thread Peter Eisentraut
On 26.04.24 21:24, Tom Lane wrote: Concretely, I'm proposing the attached. Peter didn't like PG_COMMIT_HASH, so I have PG_COMMIT_REFSPEC below, but I'm not wedded to that if a better name is proposed. Um, "refspec" leads me here , whic

Re: using extended statistics to improve join estimates

2024-04-29 Thread Justin Pryzby
On Sun, Apr 28, 2024 at 10:07:01AM +0800, Andy Fan wrote: > 's/estimiatedcluases/estimatedclauses/' typo error in the > commit message is not fixed since I have to regenerate all the commits Maybe you know this, but some of these patches need to be squashed. Regenerating the patches to address fee

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Robert Haas
On Mon, Apr 29, 2024 at 4:38 AM Heikki Linnakangas wrote: > Making requiredirect to imply sslmode=require, or error out unless you > also set sslmode=require, feels like a cavalier way of forcing SSL. We > should have a serious discussion on making sslmode=require the default > instead. That would

Re: Tarball builds in the new world order

2024-04-29 Thread Peter Eisentraut
On 26.04.24 21:24, Tom Lane wrote: Concretely, I'm proposing the attached. Peter didn't like PG_COMMIT_HASH, so I have PG_COMMIT_REFSPEC below, but I'm not wedded to that if a better name is proposed. This seems ok to me, but note that we do have an equivalent implementation in meson. If we

Re: Support a wildcard in backtrace_functions

2024-04-29 Thread Robert Haas
On Mon, Apr 29, 2024 at 5:12 AM Peter Eisentraut wrote: > On 27.04.24 00:16, Michael Paquier wrote: > > On Fri, Apr 26, 2024 at 02:39:16PM -0400, Tom Lane wrote: > >> Well, in that case we have to have some kind of control GUC, and > >> I think the consensus is that the one we have now is under-de

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Michael Paquier
On Mon, Apr 29, 2024 at 12:43:18PM +0300, Heikki Linnakangas wrote: > If a caller wants to distinguish between "libpq or the SSL library doesn't > support ALPN at all" from "the server didn't support ALPN", you can tell > from whether PQsslAttribute returns NULL or an empty string. So I think an >

Re: speed up a logical replica setup

2024-04-29 Thread Amit Kapila
On Mon, Apr 29, 2024 at 5:23 PM Euler Taveira wrote: > > On Mon, Apr 29, 2024, at 6:56 AM, Amit Kapila wrote: > > On Wed, Mar 27, 2024 at 1:47 AM Euler Taveira wrote: > > > > On Tue, Mar 26, 2024, at 4:12 PM, Tomas Vondra wrote: > > > > Perhaps I'm missing something, but why is NUM_CONN_ATTEMPTS

RE: Synchronizing slots from primary to standby

2024-04-29 Thread Zhijie Hou (Fujitsu)
On Monday, April 29, 2024 5:11 PM shveta malik wrote: > > On Mon, Apr 29, 2024 at 11:38 AM shveta malik > wrote: > > > > On Mon, Apr 29, 2024 at 10:57 AM Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Friday, March 15, 2024 10:45 PM Bertrand Drouvot > wrote: > > > > > > > > Hi, > > > > > > > >

Re: speed up a logical replica setup

2024-04-29 Thread Euler Taveira
On Mon, Apr 29, 2024, at 6:56 AM, Amit Kapila wrote: > On Wed, Mar 27, 2024 at 1:47 AM Euler Taveira wrote: > > > > On Tue, Mar 26, 2024, at 4:12 PM, Tomas Vondra wrote: > > > > Perhaps I'm missing something, but why is NUM_CONN_ATTEMPTS even needed? > > Why isn't recovery_timeout enough to decide

Re: speed up a logical replica setup

2024-04-29 Thread Amit Kapila
On Tue, Mar 26, 2024 at 8:24 AM Euler Taveira wrote: > > On Mon, Mar 25, 2024, at 1:06 PM, Hayato Kuroda (Fujitsu) wrote: > > The first patch implements a combination of (1) and (2). > > ## Analysis for failure 2 > > According to [2], the physical replication slot which is specified as > primary_

Join removal and attr_needed cleanup

2024-04-29 Thread Antonin Houska
The attached patch tries to fix a corner case where attr_needed of an inner relation of an OJ contains the join relid only because another, already-removed OJ, needed some of its attributes. The unnecessary presence of the join relid in attr_needed can prevent the planner from further join removals

Re: speed up a logical replica setup

2024-04-29 Thread Amit Kapila
On Wed, Mar 27, 2024 at 1:47 AM Euler Taveira wrote: > > On Tue, Mar 26, 2024, at 4:12 PM, Tomas Vondra wrote: > > Perhaps I'm missing something, but why is NUM_CONN_ATTEMPTS even needed? > Why isn't recovery_timeout enough to decide if wait_for_end_recovery() > waited long enough? > > > It was an

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Heikki Linnakangas
On 23/04/2024 10:07, Michael Paquier wrote: In the documentation of PQsslAttribute(), it is mentioned that empty string is returned for "alpn" if ALPN was not used, however the code returns NULL in this case: SSL_get0_alpn_selected(conn->ssl, &data, &len); if (data == NULL || le

Re: A failure in prepared_xacts test

2024-04-29 Thread Michael Paquier
On Mon, Apr 29, 2024 at 05:11:19PM +0800, Richard Guo wrote: > I noticed that some TAP tests from recovery and subscription would > select the count from pg_prepared_xacts. I wonder if these tests would > be affected if there are any prepared transactions on the backend. TAP tests run in isolatio

Re: Support a wildcard in backtrace_functions

2024-04-29 Thread Peter Eisentraut
On 27.04.24 00:16, Michael Paquier wrote: On Fri, Apr 26, 2024 at 02:39:16PM -0400, Tom Lane wrote: Well, in that case we have to have some kind of control GUC, and I think the consensus is that the one we have now is under-designed. So I also vote for a full revert and try again in v18. Okay,

Re: A failure in prepared_xacts test

2024-04-29 Thread Richard Guo
On Mon, Apr 29, 2024 at 2:58 PM Michael Paquier wrote: > On Mon, Apr 29, 2024 at 01:32:40AM -0400, Tom Lane wrote: > > (BTW, on the same logic, should ecpg's twophase.pgc be using a > > prepared-transaction name that's less generic than "gxid"?) > > I've hesitated a few seconds about that before

Re: Synchronizing slots from primary to standby

2024-04-29 Thread shveta malik
On Mon, Apr 29, 2024 at 11:38 AM shveta malik wrote: > > On Mon, Apr 29, 2024 at 10:57 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Friday, March 15, 2024 10:45 PM Bertrand Drouvot > > wrote: > > > > > > Hi, > > > > > > On Thu, Mar 14, 2024 at 02:22:44AM +, Zhijie Hou (Fujitsu) wrote: > > >

Re: Synchronizing slots from primary to standby

2024-04-29 Thread shveta malik
On Mon, Apr 29, 2024 at 11:38 AM shveta malik wrote: > > On Mon, Apr 29, 2024 at 10:57 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Friday, March 15, 2024 10:45 PM Bertrand Drouvot > > wrote: > > > > > > Hi, > > > > > > On Thu, Mar 14, 2024 at 02:22:44AM +, Zhijie Hou (Fujitsu) wrote: > > >

Re: A failure in prepared_xacts test

2024-04-29 Thread Richard Guo
On Mon, Apr 29, 2024 at 1:11 PM Tom Lane wrote: > Up to now, we've only worried about whether tests running in parallel > within a single test suite can interact. It's quite scary to think > that the meson setup has expanded the possibility of interactions > to our entire source tree. Maybe tha

Re: Direct SSL connection with ALPN and HBA rules

2024-04-29 Thread Heikki Linnakangas
On 26/04/2024 02:23, Jacob Champion wrote: On Thu, Apr 25, 2024 at 2:50 PM Heikki Linnakangas wrote: I think that comes down to the debate upthread, and whether you think it's a performance tweak or a security feature. My take on it is, `direct` mode is performance, and `requiredirect` is secur

Use "unique keys" to enhance outer join removal

2024-04-29 Thread Antonin Houska
While the "unique keys" feature [1] is still under development, I'm thinking how it could be used to enhance the removal of useless outer joins. Is something really bad about the 0002 patch attached? I recognize it may be weird that a join relation possibly produces non-join paths (e.g. SeqScan),

Re: small documentation fixes related to collations/ICU

2024-04-29 Thread Kashif Zeeshan
Looks good. On Mon, Apr 29, 2024 at 12:05 PM Peter Eisentraut wrote: > I found two mistakes related to collation and/or ICU support in the > documentation that should probably be fixed and backpatched. See > attached patches.

small documentation fixes related to collations/ICU

2024-04-29 Thread Peter Eisentraut
I found two mistakes related to collation and/or ICU support in the documentation that should probably be fixed and backpatched. See attached patches.From 44ea0d75f2739b6a3eed9a0233c3dcb2a64b2538 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 29 Apr 2024 08:50:20 +0200 Subject: [PAT