Re: Improve eviction algorithm in ReorderBuffer

2024-03-12 Thread Peter Smith
On Wed, Mar 13, 2024 at 12:48 PM Masahiko Sawada wrote: > > On Wed, Mar 13, 2024 at 10:15 AM Peter Smith wrote: > > > > On Tue, Mar 12, 2024 at 4:23 PM Masahiko Sawada > > wrote: > > > > > > On Fri, Mar 8, 2024 at 12:58 PM Peter Smith wrote: > > > > > > ... > > > > > > 5. > > > > > > + * > > >

Re: Add new error_action COPY ON_ERROR "log"

2024-03-12 Thread Bharath Rupireddy
On Wed, Mar 13, 2024 at 5:16 AM Michael Paquier wrote: > > On Tue, Mar 12, 2024 at 12:54:29PM +0530, Bharath Rupireddy wrote: > > +1. But, do you want to add them now or later as a separate > > patch/discussion altogether? > > The attached 0003 is what I had in mind: > - Simplification of the LOG

Re: Infinite loop in XLogPageRead() on standby

2024-03-12 Thread Kyotaro Horiguchi
At Mon, 11 Mar 2024 16:43:32 +0900 (JST), Kyotaro Horiguchi wrote in > Oh, I once saw the fix work, but seems not to be working after some > point. The new issue was a corruption of received WAL records on the > first standby, and it may be related to the setting. I identified the cause of the

Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

2024-03-12 Thread Nathan Bossart
I did some light editing to prepare this for commit. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 38c78bd92a7b4d4600e6f0dbe58283c21ea87d50 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 12 Mar 2024 22:04:25 -0500 Subject: [PATCH v10 1/1] Add pg_column_toast_chunk

Re: Race condition in FetchTableStates() breaks synchronization of subscription tables

2024-03-12 Thread vignesh C
On Tue, 12 Mar 2024 at 09:34, Ajin Cherian wrote: > > > > On Tue, Mar 12, 2024 at 2:59 PM vignesh C wrote: >> >> >> Thanks, I have created the following Commitfest entry for this: >> https://commitfest.postgresql.org/47/4816/ >> >> Regards, >> Vignesh > > > Thanks for the patch, I have verified t

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-12 Thread Amit Kapila
On Tue, Mar 12, 2024 at 8:55 PM Bharath Rupireddy wrote: > > On Mon, Mar 11, 2024 at 11:26 AM Amit Kapila wrote: > > > > > Hm. I get the concern. Are you okay with having inavlidation_reason > > > separately for both logical and physical slots? In such a case, > > > logical slots that got invalid

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-03-12 Thread Tom Lane
Jelte Fennema-Nio writes: > On Tue, 12 Mar 2024 at 19:28, Alvaro Herrera wrote: >>> Hmm, buildfarm member kestrel (which uses >>> -fsanitize=undefined,alignment) failed: >> Hm, I tried using the same compile flags, couldn't reproduce. > Okay, it passed now it seems so I guess this test is flaky

Re: perl: unsafe empty pattern behavior

2024-03-12 Thread Andrew Dunstan
On 2024-03-12 Tu 18:59, Tom Lane wrote: Jeff Davis writes: On Tue, 2024-03-12 at 18:53 +0100, Alvaro Herrera wrote: I also tried grepping (for things like qr{}, qr[], qr||, qr!!) and didn't find anything beyond what you have ... but I only looked for the "qr" literal, not other ways to get r

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-12 Thread Amit Kapila
On Tue, Mar 12, 2024 at 9:11 PM Bertrand Drouvot wrote: > > On Tue, Mar 12, 2024 at 05:51:43PM +0530, Amit Kapila wrote: > > On Tue, Mar 12, 2024 at 1:24 PM Bertrand Drouvot > > wrote: > > > so why to prevent it for > > these new parameters? This will unnecessarily create inconsistency in > > the

Re: perl: unsafe empty pattern behavior

2024-03-12 Thread Tom Lane
Andrew Dunstan writes: > On 2024-03-12 Tu 18:59, Tom Lane wrote: >> I wonder whether perlcritic has sufficiently deep understanding of >> Perl code that it could find these hazards. > Yeah, that was my thought too. I'd start with ProhibitComplexRegexes.pm > as a template. Oooh. Taking a quick

Re: remaining sql/json patches

2024-03-12 Thread Himanshu Upadhyaya
On Tue, Mar 12, 2024 at 5:37 PM Amit Langote wrote: > > > SELECT JSON_EXISTS(jsonb '{"customer_name": "test", "salary":1000, > "department_id":1}', '$ ? (@.department_id == $dept_id && @.salary == > $sal)' PASSING 1000 AS sal, 1 as dept_id); > json_exists > - > t > (1 row) > > Does

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-12 Thread Amit Kapila
On Tue, Mar 12, 2024 at 10:10 PM Bharath Rupireddy wrote: > > On Mon, Mar 11, 2024 at 3:44 PM Amit Kapila wrote: > > > > Yes, your understanding is correct. I wanted us to consider having new > > parameters like 'inactive_replication_slot_timeout' to be at > > slot-level instead of GUC. I think t

Re: POC: Extension for adding distributed tracing - pg_tracing

2024-03-12 Thread Craig Ringer
On Tue, 12 Mar 2024, 23:45 Anthonin Bonnefoy, < anthonin.bonne...@datadoghq.com> wrote: > > > - I don't think it's a good idea to do memory allocations in the middle > of a > > PG_CATCH. If the error was due to out-of-memory, you'll throw another > error. > Good point. I was wondering what were th

RE: Race condition in FetchTableStates() breaks synchronization of subscription tables

2024-03-12 Thread Zhijie Hou (Fujitsu)
On Wednesday, March 13, 2024 11:49 AMvignesh C wrote: > On Tue, 12 Mar 2024 at 09:34, Ajin Cherian wrote: > > > > > > > > On Tue, Mar 12, 2024 at 2:59 PM vignesh C wrote: > >> > >> > >> Thanks, I have created the following Commitfest entry for this: > >> https://commitfest.postgresql.org/47/4816

Re: A failure in t/038_save_logical_slots_shutdown.pl

2024-03-12 Thread Amit Kapila
On Tue, Mar 12, 2024 at 8:46 PM Bharath Rupireddy wrote: > > On Tue, Mar 12, 2024 at 6:05 PM Amit Kapila wrote: > > > > The patch looks mostly good to me. I have changed the comments and > > commit message in the attached. I am planning to push this tomorrow > > unless you or others have any comm

Re: RFC: Logging plan of the running query

2024-03-12 Thread torikoshia
On Fri, Feb 16, 2024 at 11:42 PM torikoshia wrote: I'm not so sure about the implementation now, i.e. finding the next node to be executed from the planstate tree, but I'm going to try this approach. Attached a patch which takes this approach. - I saw no way to find the next node to be execu

Re: Add new error_action COPY ON_ERROR "log"

2024-03-12 Thread Michael Paquier
On Wed, Mar 13, 2024 at 08:08:42AM +0530, Bharath Rupireddy wrote: > On Wed, Mar 13, 2024 at 5:16 AM Michael Paquier wrote: >> The attached 0003 is what I had in mind: >> - Simplification of the LOG generated with quotes applied around the >> column name, don't see much need to add the relation na

Re: meson: Specify -Wformat as a common warning flag for extensions

2024-03-12 Thread Tristan Partin
On Tue Mar 12, 2024 at 6:56 PM CDT, Sutou Kouhei wrote: Hi, In "Re: meson: Specify -Wformat as a common warning flag for extensions" on Fri, 08 Mar 2024 10:05:27 -0600, "Tristan Partin" wrote: > Ok, I figured this out. -Wall implies -Wformat=1. We set warning_level > to 1 in the Meson pr

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-12 Thread shveta malik
On Wed, Mar 6, 2024 at 2:47 PM Bharath Rupireddy wrote: > > On Wed, Mar 6, 2024 at 2:42 PM Bertrand Drouvot > wrote: > > > > Hi, > > > > On Tue, Mar 05, 2024 at 01:44:43PM -0600, Nathan Bossart wrote: > > > On Wed, Mar 06, 2024 at 12:50:38AM +0530, Bharath Rupireddy wrote: > > > > On Mon, Mar 4,

Re: Improve the connection failure error messages

2024-03-12 Thread Peter Smith
FYI -- some more code has been pushed since this patch was last updated. AFAICT perhaps you'll want to update this patch again for the following new connection messages on HEAD: - slotfuncs.c [1] - slotsync.c [2] -- [1] https://github.com/postgres/postgres/blob/0b84f5c419a300dc1b1a70cf63

Re: type cache cleanup improvements

2024-03-12 Thread Michael Paquier
On Tue, Mar 12, 2024 at 06:55:41PM +0300, Teodor Sigaev wrote: > Playing around I found one more place which could easily modified with > hash_seq_init_with_hash_value() call. I think that this patch should be split for clarity, as there are a few things that are independently useful. I guess som

Re: POC, WIP: OR-clause support for indexes

2024-03-12 Thread Andrei Lepikhov
On 12/3/2024 22:20, Alexander Korotkov wrote: On Mon, Mar 11, 2024 at 2:43 PM Andrei Lepikhov I think you are right. It is probably a better place than any other to remove duplicates in an array. I just think we should sort and remove duplicates from entry->consts in one pass. Thus, this optimis

Re: Transaction timeout

2024-03-12 Thread Andrey M. Borodin
> On 13 Mar 2024, at 05:23, Alexander Korotkov wrote: > > On Tue, Mar 12, 2024 at 10:28 AM Andrey M. Borodin > wrote: >>> On 11 Mar 2024, at 16:18, Alexander Korotkov wrote: >>> >>> I think if checking psql stderr is problematic, checking just logs is >>> fine. Could we wait for the releva

Re: Sequence Access Methods, round two

2024-03-12 Thread Peter Eisentraut
On 12.03.24 00:44, Michael Paquier wrote: Anyway, there is one piece of this patch set that I think has a lot of value outside of the discussion with access methods, which is to redesign pg_sequence_last_value so as it returns a (last_value, is_called) tuple rather than a (last_value). This has

Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

2024-03-12 Thread Yugo NAGATA
On Tue, 12 Mar 2024 22:07:17 -0500 Nathan Bossart wrote: > I did some light editing to prepare this for commit. Thank you. I confirmed the test you improved and I am fine with that. Regards, Yugo Nagata > > -- > Nathan Bossart > Amazon Web Services: https://aws.amazon.com -- Yugo NAGATA

meson vs tarballs

2024-03-12 Thread Andrew Dunstan
I and several colleagues have just been trying to build from a tarball with meson. `meson setup build .` results in this: [...] Message: checking for file conflicts between source and build directory meson.build:2963:2: ERROR: Problem encountered: Non-clean source code directory det

Re: speed up a logical replica setup

2024-03-12 Thread Euler Taveira
On Fri, Mar 8, 2024, at 6:44 AM, Hayato Kuroda (Fujitsu) wrote: > Hmm, right. I considered below improvements. Tomas and Euler, how do you > think? I'm posting a new patchset v28. I changed the way that the check function works. From the usability perspective, it is better to test all conditions

Re: Add basic tests for the low-level backup method.

2024-03-12 Thread Michael Paquier
On Wed, Mar 13, 2024 at 01:12:28PM +1300, David Steele wrote: > On 2/29/24 16:55, Michael Paquier wrote: >> +unlink("$backup_dir/postmaster.pid") >> +or BAIL_OUT("unable to unlink $backup_dir/postmaster.pid"); >> +unlink("$backup_dir/postmaster.opts") >> +or BAIL_OUT("unable to unlink $back

Re: meson vs tarballs

2024-03-12 Thread Peter Eisentraut
On 13.03.24 07:11, Andrew Dunstan wrote: I and several colleagues have just been trying to build from a tarball with meson. That seems pretty awful and unfriendly and I didn't see anything about it in the docs. At https://www.postgresql.org/docs/16/install-requirements.html is says: """ Alt

Re: Race condition in FetchTableStates() breaks synchronization of subscription tables

2024-03-12 Thread vignesh C
On Wed, 13 Mar 2024 at 10:12, Zhijie Hou (Fujitsu) wrote: > > On Wednesday, March 13, 2024 11:49 AMvignesh C wrote: > > On Tue, 12 Mar 2024 at 09:34, Ajin Cherian wrote: > > > > > > > > > > > > On Tue, Mar 12, 2024 at 2:59 PM vignesh C wrote: > > >> > > >> > > >> Thanks, I have created the foll

Re: meson vs tarballs

2024-03-12 Thread Andrew Dunstan
On 2024-03-13 We 02:22, Peter Eisentraut wrote: On 13.03.24 07:11, Andrew Dunstan wrote: I and several colleagues have just been trying to build from a tarball with meson. That seems pretty awful and unfriendly and I didn't see anything about it in the docs. At https://www.postgresql.org/

Re: Support json_errdetail in FRONTEND builds

2024-03-12 Thread Michael Paquier
On Tue, Mar 12, 2024 at 08:38:43PM -0400, Andrew Dunstan wrote: > On 2024-03-12 Tu 14:43, Jacob Champion wrote: >> Two notes that I wanted to point out explicitly: >> - On the other thread, Daniel contributed a destroyStringInfo() >> counterpart for makeStringInfo(), which is optional but seemed us

Re: meson vs tarballs

2024-03-12 Thread Andrew Dunstan
On 2024-03-13 We 02:31, Andrew Dunstan wrote: On 2024-03-13 We 02:22, Peter Eisentraut wrote: On 13.03.24 07:11, Andrew Dunstan wrote: I and several colleagues have just been trying to build from a tarball with meson. That seems pretty awful and unfriendly and I didn't see anything about

Re: MERGE ... RETURNING

2024-03-12 Thread jian he
Hi, some minor issues: [ WITH with_query [, ...] ] MERGE INTO [ ONLY ] target_table_name [ * ] [ [ AS ] target_alias ] USING data_source ON join_condition when_clause [...] [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ] here the "WITH" part should have "[ RECURSIVE ]" like: [

Re: Disable LLVM bitcode generation with pgxs.mk framework.

2024-03-12 Thread Peter Eisentraut
On 12.03.24 14:38, Xing Guo wrote: When the PostgreSQL server is configured with --with-llvm, the pgxs.mk framework will generate LLVM bitcode for extensions automatically. Sometimes, I don't want to generate bitcode for some extensions. I can turn off this feature by specifying with_llvm=0 in th

<    1   2