Re: long-standing data loss bug in initial sync of logical replication

2024-07-09 Thread Amit Kapila
On Tue, Jul 9, 2024 at 8:14 PM vignesh C wrote: > > On Tue, 9 Jul 2024 at 17:05, Amit Kapila wrote: > > > > On Mon, Jul 1, 2024 at 10:51 AM vignesh C wrote: > > > > > > > > > This issue is present in all supported versions. I was able to > > > reproduce it using the steps recommended by Andres a

Re: why there is not VACUUM FULL CONCURRENTLY?

2024-07-09 Thread Antonin Houska
Alvaro Herrera wrote: > On 2024-Jul-09, Antonin Houska wrote: > > > Alvaro Herrera wrote: > > > > > > Is your plan to work on it soon or should I try to write a draft patch? > > > > (I > > > > assume this is for PG >= 18.) > > > > > > I don't have plans for it, so if you have resources, plea

Re: Is creating logical replication slots in template databases useful at all?

2024-07-09 Thread Michael Paquier
On Tue, Jun 18, 2024 at 03:19:41PM +0530, Ashutosh Bapat wrote: > On Mon, Jun 17, 2024 at 5:50 PM Bharath Rupireddy < > bharath.rupireddyforpostg...@gmail.com> wrote: >> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=29d0a77fa6606f9c01ba17311fc452dabd3f793d >> , >> I noticed tha

Re: Allow non-superuser to cancel superuser tasks.

2024-07-09 Thread Kirill Reshke
> The script has two tests, and the CI is failing for the second test > where we expect the signal to be processed: > [12:48:23.370] # Failed test 'autovacuum worker signaled with > pg_signal_autovacuum_worker granted' > [12:48:23.370] # at t/006_signal_autovacuum.pl line 90. > -- > Michael T

Re: relfilenode statistics

2024-07-09 Thread Michael Paquier
On Sat, May 25, 2024 at 07:52:02AM +, Bertrand Drouvot wrote: > But I think that it is in a state that can be used to discuss the approach it > is implementing (so that we can agree or not on it) before moving > forward. I have read through the patch to get an idea of how things are done, and

Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal

2024-07-09 Thread Fujii Masao
On 2024/07/10 2:57, Robert Haas wrote: Here's v2. Thanks for the patch! With v2 patch, I found a case where WAL data generated with wal_level = minimal is summarized. In the steps below, the hoge2_minimal table is created under wal_level = minimal, but its block modification information is

Re: jsonpath: Inconsistency of timestamp_tz() Output

2024-07-09 Thread Junwang Zhao
On Tue, Jul 9, 2024 at 11:38 PM David E. Wheeler wrote: > > On Jul 9, 2024, at 11:08, Junwang Zhao wrote: > > > In JsonbValue.val.datatime, there is a tz field, I think that's where > > the offset stored, it is 18000 in the first example > > > > struct > > { > > Datum value; > > Oid typid; > > in

Re: array_in sub function ReadArrayDimensions error message

2024-07-09 Thread David G. Johnston
On Tuesday, July 9, 2024, jian he wrote: > > I also found other issues, like. > select '[-2:2147483644]={3}'::int[]; > ERROR: malformed array literal: "[-2:2147483644]={3}" > LINE 1: select '[-2:2147483644]={3}'::int[]; >^ > DETAIL: Specified array dimensions do not match array

Re: Allow non-superuser to cancel superuser tasks.

2024-07-09 Thread Michael Paquier
On Wed, Jul 10, 2024 at 10:03:04AM +0500, Kirill Reshke wrote: > The problem is the error message has been changed. > > # DETAIL: Only roles with privileges of the > "pg_signal_autovacuum_worker" role may terminate autovacuum workers.' > # doesn't match '(?^:ERROR: permission denied to termi

Re: Allow non-superuser to cancel superuser tasks.

2024-07-09 Thread Michael Paquier
On Tue, Jul 09, 2024 at 01:12:59PM -0500, Nathan Bossart wrote: > I've committed 0001. It looks like 0002 failed CI testing [0], but I > haven't investigated why. > > [0] https://cirrus-ci.com/task/5668467599212544 Nice catch by the CI. This looks like a race condition to me. I think that we s

Re: Allow non-superuser to cancel superuser tasks.

2024-07-09 Thread Kirill Reshke
Hi On Tue, 9 Jul 2024 at 23:13, Nathan Bossart wrote: > > I've committed 0001. It looks like 0002 failed CI testing [0], but I > haven't investigated why. > > [0] https://cirrus-ci.com/task/5668467599212544 > > -- > nathan The problem is the error message has been changed. # DETAIL: Only role

Re: Internal error codes triggered by tests

2024-07-09 Thread Michael Paquier
On Mon, Jul 08, 2024 at 12:00:00PM +0300, Alexander Lakhin wrote: > Let me show you other error types for discussion/classification: > SELECT pg_describe_object(1::regclass, 0, 0); > > ERROR:  XX000: unsupported object class: 1 > LOCATION:  getObjectDescription, objectaddress.c:4016 > or > SELECT

Re: array_in sub function ReadArrayDimensions error message

2024-07-09 Thread jian he
On Tue, Jul 9, 2024 at 11:31 PM Tom Lane wrote: > > jian he writes: > > On Mon, Jul 8, 2024 at 10:42 PM Tom Lane wrote: > >> One possibility could be > >> ... > >> that is, only say "Missing "]"" if there's no ']' anywhere, and > >> otherwise just say the dimensions are wrong. This could be foo

Re: Injection points: preloading and runtime arguments

2024-07-09 Thread Michael Paquier
On Tue, Jul 09, 2024 at 12:08:26PM +0300, Heikki Linnakangas wrote: > And the injection point is attached in between the INJECTION_POINT_LOAD() > and INJECTION_POINT() calls, you will still get an assertion failure. For a > testing facility, maybe that's acceptable, but it could be fixed pretty > e

Re: Logical Replication of sequences

2024-07-09 Thread Peter Smith
On Fri, Jul 5, 2024 at 9:58 PM vignesh C wrote: > > On Thu, 4 Jul 2024 at 12:44, Peter Smith wrote: > > > > 1. > > Should there be some new test for the view? Otherwise, AFAICT this > > patch has no tests that will exercise the new function > > pg_get_publication_sequences. > > pg_publication_seq

Re: Injection point locking

2024-07-09 Thread Michael Paquier
On Tue, Jul 09, 2024 at 12:12:04PM +0300, Heikki Linnakangas wrote: > I thought about it, but no. If the generation number doesn't match, there > are a few possibilities: > > 1. The entry was what we were looking for, but it was concurrently detached. > Return NULL is correct in that case. > > 2.

Re: MERGE/SPLIT partition commands should create new partitions in the parent's tablespace?

2024-07-09 Thread Masahiko Sawada
On Sat, Jul 6, 2024 at 4:06 PM Fujii Masao wrote: > > Hi, > > I noticed that ALTER TABLE MERGE PARTITIONS and SPLIT PARTITION commands > always create new partitions in the default tablespace, regardless of > the parent's tablespace. However, the indexes of these new partitions inherit > the table

Re: make pg_ctl more friendly

2024-07-09 Thread Junwang Zhao
Hi, Laurenz On Wed, Jul 10, 2024 at 3:59 AM Laurenz Albe wrote: > > On Wed, 2024-01-17 at 17:33 +0800, Junwang Zhao wrote: > > On Wed, Jan 17, 2024 at 4:54 PM Alvaro Herrera > > wrote: > > > I think this needs more comments. First, in the WaitPMResult enum, we > > > currently have three values

Re: pgsql: Add pg_get_acl() to get the ACL for a database object

2024-07-09 Thread Michael Paquier
On Mon, Jul 08, 2024 at 11:55:28AM +0200, Joel Jacobson wrote: > Thanks, nice simplifications. > I agree the tests you removed are not that interesting. > > Looks good to me. On second review, I have spotted a use-after-free for the case of an attribute ACL in both v1 and v2, as we would finish b

Re: Wrong results with grouping sets

2024-07-09 Thread Richard Guo
On Sat, Jul 6, 2024 at 9:26 AM Richard Guo wrote: > On Thu, Jul 4, 2024 at 6:02 PM Ashutosh Bapat > wrote: > > I don't have any specific thoughts on backpatching, but I have started > > reviewing the patches. > Thanks for reviewing this patchset! Here is an updated version of this patchset. I'

Re: Wrong results with grouping sets

2024-07-09 Thread Richard Guo
On Sat, Jul 6, 2024 at 10:37 AM Tom Lane wrote: > Richard Guo writes: > > BTW, from catversion.h I read: > > > * Another common reason for a catversion update is a change in parsetree > > * external representation, since serialized parsetrees appear in stored > > * rules and new-style SQL func

Re: MAINTAIN privilege -- what do we need to un-revert it?

2024-07-09 Thread Jeff Davis
On Tue, 2024-07-09 at 15:20 +0900, Michael Paquier wrote: > On Sun, Jun 30, 2024 at 03:23:44PM -0700, Noah Misch wrote: > > I've audited NewGUCNestLevel() calls that didn't get this > > addition.  Among > > those, these need the addition: > > > > - Each in ComputeIndexAttrs() -- they arise when th

Re: Built-in CTYPE provider

2024-07-09 Thread Jeff Davis
On Mon, 2024-07-08 at 18:05 -0700, Noah Misch wrote: > I'm thinking about these > aggravating factors for $SUBJECT: This is still marked as an open item for 17, but you've already acknowledged[1] that no code changes are necessary in version 17. Upgrades of Unicode take an active step from a commi

Re: Should we work around msvc failing to compile tab-complete.c?

2024-07-09 Thread Tom Lane
Andres Freund writes: > On 2024-07-09 17:44:27 -0400, Tom Lane wrote: >> Worst case: the reason no one uses readline under Windows is that it flat >> out doesn't work. > It seems to work fine as long as a debug-readline is paired with a debug-psql > or a release-readline is paired with a release-

Re: Should we work around msvc failing to compile tab-complete.c?

2024-07-09 Thread Andres Freund
Hi, On 2024-07-09 17:44:27 -0400, Tom Lane wrote: > Worst case: the reason no one uses readline under Windows is that it flat > out doesn't work. I've just tried it again, it works after splitting the else-if chain. > One thing that struck me while looking at tab-complete.c just now is > that

Re: Pgoutput not capturing the generated columns

2024-07-09 Thread Peter Smith
Hi Shubham/Shlok, I was thinking some more about the suggested new BitMapSet (BMS) idea of patch 0001 that changes the 'columns' meaning to include generated cols also where necessary. I feel it is a bit risky to change lots of code without being 100% confident it will still be in the final push.

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

2024-07-09 Thread Nathan Bossart
On Mon, Jun 24, 2024 at 11:30:00AM +0530, Bharath Rupireddy wrote: > 6) Vacuum command can't be run on the standby in recovery. So, to help > invalidate replication slots on the standby, I have for now let the > checkpointer also do the XID age based invalidation. I know > invalidating both in chec

Re: Should we work around msvc failing to compile tab-complete.c?

2024-07-09 Thread Tom Lane
Andres Freund writes: > On 2024-07-09 09:14:33 +0100, Dave Page wrote: >> Packagers aren't likely to be using readline, as it's GPL and it would have >> to be shipped with packages on Windows. > I'm not sure (I mean that literally, not as a way to state that I think it's > not as you say) it'd ac

Re: XML test error on Arch Linux

2024-07-09 Thread Erik Wienhold
On 2024-07-09 21:53 +0200, Tom Lane wrote: > Well, that didn't take long: several animals are reporting > different error text for one or both of those new test cases. > [...snip...] > At the moment I'm thinking that we should just remove those > new test cases again. +1 -- Erik

Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.

2024-07-09 Thread Joel Jacobson
On Tue, Jul 9, 2024, at 14:01, Dean Rasheed wrote: > One thing I noticed while testing the earlier patches on this thread > was that they were significantly faster if they used unsigned integers > rather than signed integers. I think the reason is that operations > like "x / 1" and "x % 1"

Re: make pg_ctl more friendly

2024-07-09 Thread Laurenz Albe
On Wed, 2024-01-17 at 17:33 +0800, Junwang Zhao wrote: > On Wed, Jan 17, 2024 at 4:54 PM Alvaro Herrera > wrote: > > I think this needs more comments. First, in the WaitPMResult enum, we > > currently have three values -- READY, STILL_STARTING, FAILED. These are > > all pretty self-explanatory.

Re: XML test error on Arch Linux

2024-07-09 Thread Tom Lane
I wrote: > I'll push this change in a little bit (still gotta write commit > message) and indri should go back to green. Unless one of the > other animals complains, I'll set about back-patching in a > day or two. Well, that didn't take long: several animals are reporting different error text for

Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.

2024-07-09 Thread Joel Jacobson
On Tue, Jul 9, 2024, at 16:11, Joel Jacobson wrote: > I added some more ndigits test cases: Ops, please ignore previous benchmark; I had forgot to commit in between the measurements, so they all ran in the same db txn, which caused a lot of noise on few ndigits. New benchmark: > /* > * Intel Co

Re: Commitfest manager for July 2024

2024-07-09 Thread Joe Conway
On 7/8/24 11:38, Joe Conway wrote: On 7/3/24 12:51, Andrey M. Borodin wrote: On 3 Jul 2024, at 01:08, Corey Huinker wrote: I'll give it a shot. Great, thank you! Do you have extended access to CF? Like activity log and mass-mail functions? If no I think someone from PG_INFRA can grant you n

Re: improve performance of pg_dump with many sequences

2024-07-09 Thread Nathan Bossart
rebased -- nathan >From 8cab570c9c5771d58860ff4e1d8cbd38e2792d80 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 30 Apr 2024 14:41:36 -0500 Subject: [PATCH v2 1/3] parse sequence information --- src/bin/pg_dump/pg_dump.c | 64 --- 1 file changed, 26

Re: 回复: An implementation of multi-key sort

2024-07-09 Thread Robert Haas
On Sun, Jul 7, 2024 at 2:32 AM Konstantin Knizhnik wrote: > If mksort really provides advantage only when there are a lot of > duplicates (for prefix keys?) and of small fraction of duplicates there > is even some (small) regression > then IMHO taking in account in planner information about estima

Re: XML test error on Arch Linux

2024-07-09 Thread Tom Lane
Erik Wienhold writes: > So how about just ignoring XML_ERR_NOT_WELL_BALANCED like in the > attached? Oh, that's a good idea. Given that we know they've changed the behavior around this at least once, I'm not sure that it's safe to unconditionally ignore this error --- but we could ignore it as l

Re: improve predefined roles documentation

2024-07-09 Thread Nathan Bossart
rebased (due to commit ccd3802, which introduced pg_signal_autovacuum_worker) -- nathan >From c9e9c04c8edf3aaedc683c1c4e6811feb2c2c267 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 18 Jun 2024 11:38:40 -0500 Subject: [PATCH v5 1/1] revamp predefined roles documentation --- doc/src/s

Re: [PATCH] Add CANONICAL option to xmlserialize

2024-07-09 Thread Jim Jones
On 19.06.24 10:59, Jim Jones wrote: > On 09.02.24 14:19, Jim Jones wrote: >> v9 attached with rebase due to changes done to primnodes.h in 615f5f6 >> > v10 attached with rebase due to changes in primnodes, parsenodes.h, and > gram.y > v11 attached with rebase due to changes in xml.c -- Jim From

Re: Allow non-superuser to cancel superuser tasks.

2024-07-09 Thread Nathan Bossart
I've committed 0001. It looks like 0002 failed CI testing [0], but I haven't investigated why. [0] https://cirrus-ci.com/task/5668467599212544 -- nathan

Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal

2024-07-09 Thread Robert Haas
Here's v2. Jakub Wartak pointed out to me off-list that this broke the case where a chain of incrementals crosses a timeline switch. That made me realize that I also need to add the WAL level to XLOG_END_OF_RECOVERY, so this version does that. I also forgot to mention that this patch changes beha

Re: array_in sub function ReadArrayDimensions error message

2024-07-09 Thread David G. Johnston
On Tue, Jul 9, 2024 at 8:59 AM Tom Lane wrote: > "David G. Johnston" writes: > > > I'd add a hint if the first symbol is [ and we fail to get to the point > of > > actually seeing the equal sign or the first subsequent unquoted symbol > is a > > comma instead of a colon. > > That seems closely r

Re: why there is not VACUUM FULL CONCURRENTLY?

2024-07-09 Thread Alvaro Herrera
On 2024-Jul-09, Antonin Houska wrote: > Alvaro Herrera wrote: > > > > Is your plan to work on it soon or should I try to write a draft patch? (I > > > assume this is for PG >= 18.) > > > > I don't have plans for it, so if you have resources, please go for it. > > The first version is attached.

Re: tests fail on windows with default git settings

2024-07-09 Thread Andres Freund
Hi, On 2024-07-09 06:26:12 -0400, Andrew Dunstan wrote: > On 2024-07-08 Mo 5:44 PM, Andres Freund wrote: > > > What I suggest (see attached) is we run the diff command with > > > --strip-trailing-cr on Windows. Then we just won't care if the expected > > > file > > > and/or the output file has CR

Re: tests fail on windows with default git settings

2024-07-09 Thread Andres Freund
Hi, On 2024-07-09 14:52:39 +0100, Dave Page wrote: > I have 4 different diff.exe's on my ~6 week old build VM (not counting > shims), all of which seem to support --strip-trailing-cr. Those builds came > with: > > - git > - VC++ > - diffutils (installed by chocolatey) > - vcpkg > > I think it's re

Re: Should we work around msvc failing to compile tab-complete.c?

2024-07-09 Thread Andres Freund
Hi, On 2024-07-09 09:14:33 +0100, Dave Page wrote: > On Mon, 8 Jul 2024 at 21:08, Andres Freund wrote: > > I think we'd need to backpatch more for older branches. At least > > > > commit 3f28bd7337d > > Author: Thomas Munro > > Date: 2022-12-22 17:14:23 +1300 > > > > Add work-around for VA

Re: XML test error on Arch Linux

2024-07-09 Thread Erik Wienhold
On 2024-07-07 22:43 +0200, Tom Lane wrote: > As far as the errcontext changes go: I think we have to just bite > the bullet and accept them. It looks like 2.13 has a completely > different mechanism than prior versions for deciding when to issue > XML_ERR_NOT_WELL_BALANCED. And it's not even clea

Re: array_in sub function ReadArrayDimensions error message

2024-07-09 Thread Tom Lane
"David G. Johnston" writes: > One possibility all this ignores is that what we are calling > array-dimensions are in reality most likely a user using json array syntax > in our SQL arrays. That seems eminently more likely than someone > mis-typing this niche incantation of building an array liter

Re: array_in sub function ReadArrayDimensions error message

2024-07-09 Thread David G. Johnston
On Tue, Jul 9, 2024 at 8:31 AM Tom Lane wrote: > > Here again, the problem is not a missing "=", it's invalid > syntax somewhere before that. > > Another thing we could consider doing here (and similarly > for your original case) is > > DETAIL: Expected "=" not "," after array dimensions. > > Th

Re: jsonpath: Inconsistency of timestamp_tz() Output

2024-07-09 Thread David E. Wheeler
On Jul 9, 2024, at 11:08, Junwang Zhao wrote: > In JsonbValue.val.datatime, there is a tz field, I think that's where > the offset stored, it is 18000 in the first example > > struct > { > Datum value; > Oid typid; > int32 typmod; > int tz; /* Numeric time zone, in seconds, for > * Time

Re: tests fail on windows with default git settings

2024-07-09 Thread Andrew Dunstan
On 2024-07-09 Tu 9:52 AM, Dave Page wrote: > What I suggest (see attached) is we run the diff command with > --strip-trailing-cr on Windows. Then we just won't care if the expected file > and/or the output file has CRs. I was wondering about that too, but I wasn't sure we

Re: array_in sub function ReadArrayDimensions error message

2024-07-09 Thread Tom Lane
jian he writes: > On Mon, Jul 8, 2024 at 10:42 PM Tom Lane wrote: >> One possibility could be >> ... >> that is, only say "Missing "]"" if there's no ']' anywhere, and >> otherwise just say the dimensions are wrong. This could be fooled >> by a ']' that's part of some string in the data, but eve

Re: jsonpath: Inconsistency of timestamp_tz() Output

2024-07-09 Thread Junwang Zhao
On Tue, Jul 9, 2024 at 10:22 PM David E. Wheeler wrote: > > On Jul 9, 2024, at 10:07, David E. Wheeler wrote: > > > So perhaps I had things reversed before. Maybe it’s actually doing the > > right then when it converts a timestamp to a timestamptz, but not when it > > the input contains an offs

Re: Built-in CTYPE provider

2024-07-09 Thread Jeremy Schneider
On Tue, Jul 9, 2024 at 4:00 AM Laurenz Albe wrote: > > My personal exprience is that very few users are aware of or care about > the strict accuracy of the collation sort order and other locale aspects. > But they care a lot about index corruption. > > So I'd argue that we should not have any bre

Re: Document DateStyle effect on jsonpath string()

2024-07-09 Thread David E. Wheeler
On Jul 9, 2024, at 10:35, jian he wrote: > one tiny complaint would be maybe we need `reset datestyle`. That’s fair. Done. D v2-0001-Document-impact-of-datestyle-on-jsonpath-string.patch Description: Binary data

Re: long-standing data loss bug in initial sync of logical replication

2024-07-09 Thread vignesh C
On Tue, 9 Jul 2024 at 17:05, Amit Kapila wrote: > > On Mon, Jul 1, 2024 at 10:51 AM vignesh C wrote: > > > > > > This issue is present in all supported versions. I was able to > > reproduce it using the steps recommended by Andres and Tomas's > > scripts. I also conducted a small test through TAP

Re: Optimize WindowAgg's use of tuplestores

2024-07-09 Thread Ashutosh Bapat
On Sun, Jul 7, 2024 at 4:27 PM David Rowley wrote: > > As part of making tuplestores faster [1], I noticed that in WindowAgg, when > we end one partition we call tuplestore_end() and then we do > tuplestore_begin_heap() again for the next partition in begin_partition() and > then go on to set u

Re: Document DateStyle effect on jsonpath string()

2024-07-09 Thread jian he
On Thu, Jul 4, 2024 at 10:45 PM David E. Wheeler wrote: > > On Jul 4, 2024, at 04:28, jian he wrote: > > > Do you need to reset the datestyle? > > Wouldn’t hurt but it’s not necessary, no. It’s set only for the execution of > this file, and there are no more calls that rely on it. > > > also the

Re: jsonpath: Inconsistency of timestamp_tz() Output

2024-07-09 Thread David E. Wheeler
On Jul 9, 2024, at 10:07, David E. Wheeler wrote: > So perhaps I had things reversed before. Maybe it’s actually doing the right > then when it converts a timestamp to a timestamptz, but not when it the input > contains an offset, as in your example. To clarify, there’s an inconsistency in the

Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.

2024-07-09 Thread Joel Jacobson
On Tue, Jul 9, 2024, at 14:01, Dean Rasheed wrote: > Before considering the other patches to optimise for larger inputs, I > think it's worth optimising the existing mul_var() code as much as > possible. > > One thing I noticed while testing the earlier patches on this thread > was that they were s

Re: jsonpath: Inconsistency of timestamp_tz() Output

2024-07-09 Thread David E. Wheeler
> On Jul 8, 2024, at 21:44, Junwang Zhao wrote: > > # select jsonb_path_query_tz('"2024-08-15 12:34:56-05"', '$.timestamp_tz()'); > > Do you also expect this to show the time in America/New_York? > > This is what I get: > > [local] postgres@postgres:5432-28176=# select > jsonb_path_query_tz

Re: tests fail on windows with default git settings

2024-07-09 Thread Dave Page
Hi On Mon, 8 Jul 2024 at 22:44, Andres Freund wrote: > Hi, > > On 2024-07-08 16:56:10 -0400, Andrew Dunstan wrote: > > On 2024-07-08 Mo 4:16 PM, Andres Freund wrote: > > > I'm actually mildly surprised that the tests don't fail when *not* > using > > > autocrlf, because afaict test_json_parser_i

RE: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-09 Thread Hayato Kuroda (Fujitsu)
> 0001 - Codes for SUBOPT_TWOPHASE_COMMIT are moved per requirement [1]. >Also, checks for failover and two_phase are unified into one function. > 0002 - updated accordingly. An argument for the check function is added. > 0003 - this contains documentation changes required in [2]. Previous

Re: Address the -Wuse-after-free warning in ATExecAttachPartition()

2024-07-09 Thread Junwang Zhao
On Tue, Jul 9, 2024 at 7:39 PM Amit Langote wrote: > > On Tue, Jul 9, 2024 at 19:58 Junwang Zhao wrote: >> >> On Tue, Jul 9, 2024 at 6:18 PM Amit Langote wrote: >> > >> > Hi Junwang, >> > >> > On Mon, Jul 8, 2024 at 7:08 PM Junwang Zhao wrote: >> > > On Mon, Jul 8, 2024 at 3:22 PM Nitin Jadhav

Re: doc: modify the comment in function libpqrcv_check_conninfo()

2024-07-09 Thread Fujii Masao
On 2024/07/09 15:56, ikedarintarof wrote: - * Validate connection info string, and determine whether it might cause - * local filesystem access to be attempted. + * The function + * 1. validates connection info string and + * 2. checks a password is provided if must_use_password is true. IMO,

Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.

2024-07-09 Thread Dean Rasheed
On Tue, 9 Jul 2024 at 10:11, Dean Rasheed wrote: > > OK, I have committed this. > Before considering the other patches to optimise for larger inputs, I think it's worth optimising the existing mul_var() code as much as possible. One thing I noticed while testing the earlier patches on this threa

RE: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-09 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > > I see that in 0003/0004, the patch first aborts pending prepared > > transactions, update's catalog, and then change slot's property via > > walrcv_alter_slot. What if there is any ERROR (say the remote node is > > not reachable or there is an error while updating the catalog) after

RE: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-09 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thanks for giving comments! Here I wanted to reply one of comments. > What should be the behavior if one tries to set slot_name to NONE and > also tries to toggle two_pahse option? You mentioned like below case, right? ``` ALTER SUBSCRIPTION sub SET (two_phase = false, slot_name = NO

Re: Address the -Wuse-after-free warning in ATExecAttachPartition()

2024-07-09 Thread Amit Langote
On Tue, Jul 9, 2024 at 19:58 Junwang Zhao wrote: > On Tue, Jul 9, 2024 at 6:18 PM Amit Langote > wrote: > > > > Hi Junwang, > > > > On Mon, Jul 8, 2024 at 7:08 PM Junwang Zhao wrote: > > > On Mon, Jul 8, 2024 at 3:22 PM Nitin Jadhav > > > wrote: > > > > > > > > In [1], Andres reported a -Wuse-

Re: long-standing data loss bug in initial sync of logical replication

2024-07-09 Thread Amit Kapila
On Mon, Jul 1, 2024 at 10:51 AM vignesh C wrote: > > > This issue is present in all supported versions. I was able to > reproduce it using the steps recommended by Andres and Tomas's > scripts. I also conducted a small test through TAP tests to verify the > problem. Attached is the alternate_lock_

Re: 回复: An implementation of multi-key sort

2024-07-09 Thread Tomas Vondra
BTW I forgot to report that I intended to test this on 32-bit ARM too, because that sometimes triggers "funny" behavior, but the build fails like this: In file included from tuplesort.c:630: mk_qsort_tuple.c: In function ‘mkqs_compare_datum_by_shortcut’: mk_qsort_tuple.c:167:23: warning: implicit

Re: speed up a logical replica setup

2024-07-09 Thread Alexander Lakhin
Hello Amit and Kuroda-san, 03.07.2024 14:02, Amit Kapila wrote: Pushed 0002 and 0003. Let's wait for a discussion on 0001. Please look at another failure of the test [1]: [13:28:05.647](2.460s) not ok 26 - failover slot is synced [13:28:05.648](0.001s) #   Failed test 'failover slot is synced'

Re: Address the -Wuse-after-free warning in ATExecAttachPartition()

2024-07-09 Thread Junwang Zhao
On Tue, Jul 9, 2024 at 6:18 PM Amit Langote wrote: > > Hi Junwang, > > On Mon, Jul 8, 2024 at 7:08 PM Junwang Zhao wrote: > > On Mon, Jul 8, 2024 at 3:22 PM Nitin Jadhav > > wrote: > > > > > > In [1], Andres reported a -Wuse-after-free bug in the > > > ATExecAttachPartition() function. I've cre

Re: Parent/child context relation in pg_get_backend_memory_contexts()

2024-07-09 Thread Melih Mutlu
Hi David, David Rowley , 5 Tem 2024 Cum, 11:06 tarihinde şunu yazdı: > With the order you have it, that query could be expressed as: > > WITH c AS (SELECT * FROM pg_backend_memory_contexts) > SELECT c1.* > FROM c c1, c c2 > WHERE c2.name = 'CacheMemoryContext' > AND c1.path[c2.level + 1] = c2.pat

Re: Restart pg_usleep when interrupted

2024-07-09 Thread Bertrand Drouvot
Hi, On Fri, Jul 05, 2024 at 11:49:45AM -0500, Sami Imseih wrote: > > > With 50 indexes and 10 parallel workers I can see things like: > > > > 2024-07-02 08:22:23.789 UTC [2189616] LOG: expected 1.00, actual > > 239.378368 > > 2024-07-02 08:22:24.575 UTC [2189616] LOG: expected 0.10, a

Re: tests fail on windows with default git settings

2024-07-09 Thread Andrew Dunstan
On 2024-07-08 Mo 5:44 PM, Andres Freund wrote: What I suggest (see attached) is we run the diff command with --strip-trailing-cr on Windows. Then we just won't care if the expected file and/or the output file has CRs. I was wondering about that too, but I wasn't sure we can rely on that flag be

Re: Address the -Wuse-after-free warning in ATExecAttachPartition()

2024-07-09 Thread Amit Langote
Hi Junwang, On Mon, Jul 8, 2024 at 7:08 PM Junwang Zhao wrote: > On Mon, Jul 8, 2024 at 3:22 PM Nitin Jadhav > wrote: > > > > In [1], Andres reported a -Wuse-after-free bug in the > > ATExecAttachPartition() function. I've created a patch to address it > > with pointers from Amit offlist. > > >

Re: [HACKERS] make async slave to wait for lsn to be replayed

2024-07-09 Thread Kartyshov Ivan
Thank you for your interest in the patch. On 2024-06-20 11:30, Kyotaro Horiguchi wrote: Hi, I looked through the patch and have some comments. == L68: +Recovery Procedures It looks somewhat confusing and appears as if the section is intended to explain how to perform recovery. Since t

Re: Injection point locking

2024-07-09 Thread Heikki Linnakangas
On 09/07/2024 08:16, Michael Paquier wrote: typedef struct InjectionPointCacheEntry { charname[INJ_NAME_MAXLEN]; +intslot_idx; +uint64generation; charprivate_data[INJ_PRIVATE_MAXLEN]; InjectionPointCallback callback; } InjectionP

Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.

2024-07-09 Thread Dean Rasheed
On Sat, 6 Jul 2024 at 12:17, Joel Jacobson wrote: > > > I think this is good to go, so unless there are any further comments, > > I plan to commit it soon. > > LGTM. > OK, I have committed this. At the last minute, I changed the name of the new function to mul_var_short() because "short" is prob

Re: Injection points: preloading and runtime arguments

2024-07-09 Thread Heikki Linnakangas
On 05/07/2024 12:16, Michael Paquier wrote: On Mon, Jun 10, 2024 at 03:10:33PM +0900, Michael Paquier wrote: OK, cool. I'll try to get that into the tree once v18 opens up. And I've spent more time on this one, and applied it to v18 after some slight tweaks. If you do: INJECTION_POINT_LOAD

Re: Should we work around msvc failing to compile tab-complete.c?

2024-07-09 Thread Dave Page
On Mon, 8 Jul 2024 at 21:08, Andres Freund wrote: > Hi, > > On 2024-07-08 14:18:03 -0400, Tom Lane wrote: > > Andres Freund writes: > > > Compiling postgres on windows with tab-completion support fails either > with > > > "fatal error C1026: parser stack overflow, program too complex”. > > > or

Re: [PATCH] TODO “Allow LISTEN on patterns”

2024-07-09 Thread Emanuel Calvo
Hello there, El vie, 15 mar 2024 a las 9:01, Alexander Cheshev () escribió: > Hello Hackers, > > I have implemented TODO “Allow LISTEN on patterns” [1] and attached > the patch to the email. The patch basically consists of the following > two parts. > > 1. Support wildcards in LISTEN command > >

Re: Built-in CTYPE provider

2024-07-09 Thread Laurenz Albe
On Mon, 2024-07-08 at 18:05 -0700, Noah Misch wrote: > > I do not think it is realistic to define "IMMUTABLE" as meaning that > > the function will never change behavior until the heat death of the > > universe.  As a counterexample, we've not worried about applying > > bug fixes or algorithm impro

Missing installation of Kerberos.pm and AdjustUpgrade.pm

2024-07-09 Thread Michael Paquier
Hi all, (cc-ing Tom as committer of 52585f8f072a) As Ashutosh has mentioned here we are not installing AdjustUpgrade.pm: http://postgresql.org/message-id/caexhw5sja9yqzhin+uop4duhjwmgzc86ygdkxeeew+hvycv...@mail.gmail.com The same thing can be said for Kerberos.pm. Could there be an argument for

Re: Test to dump and restore objects left behind by regression

2024-07-09 Thread Michael Paquier
On Mon, Jul 08, 2024 at 03:59:30PM +0530, Ashutosh Bapat wrote: > Before submitting the patch, I looked for all the places which mention > AdjustUpgrade or AdjustUpgrade.pm to find places where the new module needs > to be mentioned. But I didn't find any. AdjustUpgrade is not mentioned > in src/te

Re: Pluggable cumulative statistics

2024-07-09 Thread Michael Paquier
On Tue, Jul 09, 2024 at 05:23:03AM +, Bertrand Drouvot wrote: > I gave a second thought on it, and I think that this is the "data" part that > lead > to the confusion (as too generic), what about? > > shared_data_len -> shared_stats_len > shared_data_off -> shared_stats_off > > That looks ok

Re: Incorrect results from numeric round() and trunc()

2024-07-09 Thread Dean Rasheed
On Mon, 8 Jul 2024 at 11:08, Joel Jacobson wrote: > > LGTM. > Thanks for the review. I have pushed and back-patched this. Regards, Dean

Re: Doc Rework: Section 9.16.13 SQL/JSON Query Functions

2024-07-09 Thread Amit Langote
On Tue, Jul 9, 2024 at 12:30 PM Amit Langote wrote: > On Tue, Jul 9, 2024 at 10:39 AM jian he wrote: > > On Mon, Jul 8, 2024 at 8:57 PM Amit Langote wrote: > > > > > > Updated patch attached. > > > > > > > Returns true if the SQL/JSON > > path_expression > > -applied to the con

Re: SQL:2011 application time

2024-07-09 Thread jian he
On Thu, Jun 6, 2024 at 4:56 AM Paul Jungwirth wrote: > > On 5/21/24 11:27, Isaac Morland wrote: > > On Tue, 21 May 2024 at 13:57, Robert Haas > > wrote: > > > > What I think is less clear is what that means for temporal primary > > keys. As Paul pointed out u