RE: speed up a logical replica setup

2024-06-23 Thread Hayato Kuroda (Fujitsu)
Dear Noah, > pg_createsubscriber fails on a dbname containing a space. Use > appendConnStrVal() here and for other params in get_sub_conninfo(). See the > CVE-2016-5424 commits for more background. For one way to test this > scenario, > see generate_db() in the pg_upgrade test suite. Thanks fo

Re: speed up a logical replica setup

2024-06-23 Thread Amit Kapila
On Sun, Jun 23, 2024 at 11:52 AM Noah Misch wrote: > > > +static char * > > +create_logical_replication_slot(PGconn *conn, struct LogicalRepInfo > > *dbinfo) > > +{ > > + PQExpBuffer str = createPQExpBuffer(); > > + PGresult *res = NULL; > > + const char *slot_name = dbinfo->replslo

Re: Inconsistency between try_mergejoin_path and create_mergejoin_plan

2024-06-23 Thread Richard Guo
On Wed, Jun 19, 2024 at 10:24 PM Alexander Pyhalov wrote: > Richard Guo писал(а) 2024-06-19 16:30: > > I think we can simply verify the validity of commutators for clauses in > > the form "inner op outer" when selecting mergejoin/hash clauses. If a > > clause lacks a commutator, we should conside

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

2024-06-23 Thread Bharath Rupireddy
Hi, On Mon, Jun 17, 2024 at 5:55 PM Bharath Rupireddy wrote: > > Here are my thoughts on when to do the XID age invalidation. In all > the patches sent so far, the XID age invalidation happens in two > places - one during the slot acquisition, and another during the > checkpoint. As the suggestio

Re: Support "Right Semi Join" plan shapes

2024-06-23 Thread Li Japin
Hi, Richard > On Apr 25, 2024, at 11:28, Richard Guo wrote: > > Here is another rebase with a commit message to help review. I also > tweaked some comments. Thank you for updating the patch, here are some comments on the v5 patch. + /* +* For now we do not support RIGHT_SEMI joi

Re: Proposal: Division operator for (interval / interval => double precision)

2024-06-23 Thread David G. Johnston
On Sun, Jun 23, 2024 at 5:57 PM Gurjeet Singh wrote: > Is there a desire to have a division operator / that takes dividend > and divisor of types interval, and results in a quotient of type > double precision. [...] > ('365 days'::interval / '3 days'::interval) => 121 > ('365 days'::interval % '

Buildfarm animal caiman showing a plperl test issue with newer Perl versions

2024-06-23 Thread Alexander Lakhin
Hello hackers, As recent caiman failures ([1], [2], ...) show, plperl.sql is incompatible with Perl 5.40. (The last successful test runs took place when cayman had Perl 5.38.2 installed: [3].) FWIW, I've found an already-existing fix for the issue [4] and a note describing the change for Perl 5.

Re: Proposal: Division operator for (interval / interval => double precision)

2024-06-23 Thread Kashif Zeeshan
Hi Its always a good idea to extend the functionality of PG. Thanks Kashif Zeeshan On Mon, Jun 24, 2024 at 5:57 AM Gurjeet Singh wrote: > Is there a desire to have a division operator / that takes dividend > and divisor of types interval, and results in a quotient of type > double precision. >

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Yugo NAGATA
On Sun, 23 Jun 2024 22:34:03 -0300 Ranier Vilela wrote: > Em dom., 23 de jun. de 2024 às 22:14, Ranier Vilela > escreveu: > > > Em dom., 23 de jun. de 2024 às 22:05, Ranier Vilela > > escreveu: > > > >> Em dom., 23 de jun. de 2024 às 21:54, Michael Paquier < > >> mich...@paquier.xyz> escreveu:

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Richard Guo
On Mon, Jun 24, 2024 at 7:51 AM Ranier Vilela wrote: > In src/include/access/xlogbackup.h, the field *name* > has one byte extra to store null-termination. > > But, in the function *do_pg_backup_start*, > I think that is a mistake in the line (8736): > > memcpy(state->name, backupidstr, strlen(bac

RE: Improve EXPLAIN output for multicolumn B-Tree Index

2024-06-23 Thread Masahiro.Ikeda
> > * Is this feature useful? Is there a possibility it will be accepted? > > I think adding such information to EXPLAIN outputs is useful because it will > help users > confirm the effect of a multicolumn index on a certain query and decide to > whether > leave, drop, or recreate the index, and

Re: Pgoutput not capturing the generated columns

2024-06-23 Thread Peter Smith
Hi, here are some patch v9-0001 comments. I saw Kuroda-san has already posted comments for this patch so there may be some duplication here. == GENERAL 1. The later patches 0002 etc are checking to support only STORED gencols. But, doesn't that restriction belong in this patch 0001 so VIRTUA

RE: Improve EXPLAIN output for multicolumn B-Tree Index

2024-06-23 Thread Masahiro.Ikeda
> I am unable to decide whether reporting the bound quals is just enough to > decide the efficiency of index without knowing the difference in the number > of index tuples selectivity and heap tuple selectivity. The difference seems > to be a better indicator of index efficiency whereas the boun

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Ranier Vilela
Em dom., 23 de jun. de 2024 às 22:14, Ranier Vilela escreveu: > Em dom., 23 de jun. de 2024 às 22:05, Ranier Vilela > escreveu: > >> Em dom., 23 de jun. de 2024 às 21:54, Michael Paquier < >> mich...@paquier.xyz> escreveu: >> >>> On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote: >>>

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Ranier Vilela
Em dom., 23 de jun. de 2024 às 22:05, Ranier Vilela escreveu: > Em dom., 23 de jun. de 2024 às 21:54, Michael Paquier > escreveu: > >> On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote: >> > It's not critical code, so I think it's ok to use strlen, even because >> the >> > result of

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Ranier Vilela
Em dom., 23 de jun. de 2024 às 21:54, Michael Paquier escreveu: > On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote: > > It's not critical code, so I think it's ok to use strlen, even because > the > > result of strlen will already be available using modern compilers. > > > > So, I th

Proposal: Division operator for (interval / interval => double precision)

2024-06-23 Thread Gurjeet Singh
Is there a desire to have a division operator / that takes dividend and divisor of types interval, and results in a quotient of type double precision. This would be helpful in calculating how many times the divisor interval can fit into the dividend interval. To complement this division operator,

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Michael Paquier
On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote: > It's not critical code, so I think it's ok to use strlen, even because the > result of strlen will already be available using modern compilers. > > So, I think it's ok to use memcpy with strlen + 1. It seems to me that there is a pr

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Ranier Vilela
Em dom., 23 de jun. de 2024 às 21:24, Michael Paquier escreveu: > On Sun, Jun 23, 2024 at 09:08:47PM -0300, Fabrízio de Royes Mello wrote: > > Doesn’t “sizeof” solve the problem? It take in account the > null-termination > > character. > > The size of BackupState->name is fixed with MAXPGPATH + 1

Re: replace strtok()

2024-06-23 Thread Michael Paquier
On Sat, Jun 22, 2024 at 11:48:21AM -0400, Tom Lane wrote: > Peter Eisentraut writes: > > On 18.06.24 13:43, Ranier Vilela wrote: > >> I found another implementation of strsep, it seems lighter to me. > >> I will attach it for consideration, however, I have not done any testing. > > > Yeah, surely

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Ranier Vilela
Em dom., 23 de jun. de 2024 às 21:08, Fabrízio de Royes Mello < fabriziome...@gmail.com> escreveu: > > On Sun, 23 Jun 2024 at 20:51 Ranier Vilela wrote: > >> Hi. >> >> In src/include/access/xlogbackup.h, the field *name* >> has one byte extra to store null-termination. >> >> But, in the function

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Michael Paquier
On Sun, Jun 23, 2024 at 09:08:47PM -0300, Fabrízio de Royes Mello wrote: > Doesn’t “sizeof” solve the problem? It take in account the null-termination > character. The size of BackupState->name is fixed with MAXPGPATH + 1, so it would be a better practice to use strlcpy() with sizeof(name) anyway?

Re: Unable parse a comment in gram.y

2024-06-23 Thread Tatsuo Ishii
>>> +1. It's easier to understand at least for me. > >> +1 > > OK. I looked through the rest of src/backend/parser/ and couldn't > find any other similar wording. There's plenty of "As with ..." > and "As in ...", but at least to me those don't seem confusing. > I'll plan to push the attached a

Re: Optimize numeric.c mul_var() using the Karatsuba algorithm

2024-06-23 Thread Michael Paquier
On Sun, Jun 23, 2024 at 09:00:29AM +0200, Joel Jacobson wrote: > Attached, rebased version of the patch that implements the Karatsuba > algorithm in numeric.c's mul_var(). It's one of these areas where Dean Rasheed would be a good match for a review, so adding him in CC. He has been doing a lot

Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Fabrízio de Royes Mello
On Sun, 23 Jun 2024 at 20:51 Ranier Vilela wrote: > Hi. > > In src/include/access/xlogbackup.h, the field *name* > has one byte extra to store null-termination. > > But, in the function *do_pg_backup_start*, > I think that is a mistake in the line (8736): > > memcpy(state->name, backupidstr, strl

Avoid incomplete copy string (src/backend/access/transam/xlog.c)

2024-06-23 Thread Ranier Vilela
Hi. In src/include/access/xlogbackup.h, the field *name* has one byte extra to store null-termination. But, in the function *do_pg_backup_start*, I think that is a mistake in the line (8736): memcpy(state->name, backupidstr, strlen(backupidstr)); memcpy with strlen does not copy the whole strin

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

2024-06-23 Thread Michael Paquier
On Sun, Jun 23, 2024 at 08:48:46AM +0200, Joel Jacobson wrote: > On Sat, Jun 22, 2024, at 11:44, Joel Jacobson wrote: >> * v5-0001-Add-pg_get_acl.patch >> * v2-0002-Add-pg_get_acl-overloads.patch > > Rename files to ensure cfbot applies them in order; both need to > have same version prefix. +

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

2024-06-23 Thread Jelte Fennema-Nio
On Sat, 22 Jun 2024 at 17:00, Alexander Lakhin wrote: > @@ -2775,6 +2775,7 @@ > SET LOCAL statement_timeout = '10ms'; > select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- > this takes very long > ERROR: canceling statement due to statement timeout > +WARNING: could

Re: Unable parse a comment in gram.y

2024-06-23 Thread Tom Lane
"David G. Johnston" writes: > On Saturday, June 22, 2024, Tatsuo Ishii wrote: >>> Perhaps s/As func_expr/Like func_expr/ would be less confusing? >> +1. It's easier to understand at least for me. > +1 OK. I looked through the rest of src/backend/parser/ and couldn't find any other similar wor

Re: recoveryCheck/008_fsm_truncation is failing on dodo in v14- (due to slow fsync?)

2024-06-23 Thread Alexander Lakhin
22.06.2024 12:00, Alexander Lakhin wrote: On the other hand, backporting a7f417107 could fix the issue too, but I'm afraid we'll still see other tests (027_stream_regress) failing like [4]. When similar failures were observed on Andres Freund's animals, Andres came to conclusion that they were ca

Re: Meson far from ready on Windows

2024-06-23 Thread Andrew Dunstan
On 2024-06-21 Fr 11:15 AM, Robert Haas wrote: As a practical matter, I don't think MSVC is coming back. The buildfarm was already changed over to use meson, and it would be pretty disruptive to try to re-add buildfarm coverage for a resurrected MSVC on the eve of beta2. I think we should focus o

Re: PATCH: Add query for operators unusable with RLS to documentation

2024-06-23 Thread Yugo NAGATA
On Sat, 18 May 2024 16:54:52 -0700 Josh Snyder wrote: > When deploying RLS, I was surprised to find that certain queries which used > only builtin indexes and operators had dramatically different query plans > when > a policy is applied. In my case, the query `tsvector @@ tsquery` over a GIN >

RE: Partial aggregates pushdown

2024-06-23 Thread fujii.y...@df.mitsubishielectric.co.jp
Hi Alexander, hackers. > From: Alexander Pyhalov > Sent: Tuesday, May 28, 2024 2:45 PM > The fix was to set child_agg->agg_partial to orig_agg->agg_partial in > convert_combining_aggrefs(), it's already in the patch, as well as the > example - > without this fix I've just realized that you've ad

Re: Optimize numeric.c mul_var() using the Karatsuba algorithm

2024-06-23 Thread Joel Jacobson
On Fri, Jun 14, 2024, at 03:07, Aaron Altman wrote: > Thanks for the detailed background and comments, Joel! > > The new status of this patch is: Ready for Committer Thanks for reviewing. Attached, rebased version of the patch that implements the Karatsuba algorithm in numeric.c's mul_var(). /J