Re: Force streaming every change in logical decoding

2022-12-23 Thread Amit Kapila
On Fri, Dec 23, 2022 at 10:31 PM Masahiko Sawada wrote: > > On Fri, Dec 23, 2022 at 5:32 PM shiy.f...@fujitsu.com > wrote: > > > > On Fri, Dec 23, 2022 1:50 PM Amit Kapila > > > > > > On Thu, Dec 22, 2022 at 6:18 PM shiy.f...@fujitsu.com > > > wrote: > > > > > > > > > > > > Besides, I tried to

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Michael Paquier
On Fri, Dec 23, 2022 at 10:39:25AM -0600, Justin Pryzby wrote: > On Fri, Dec 23, 2022 at 05:51:28PM +0900, Michael Paquier wrote: >> FWIW, I find the use of a FOR loop with a DO block much cleaner to >> follow in this context, so something like the attached would be able >> to group the two

Re: daitch_mokotoff module

2022-12-23 Thread Dag Lem
Alvaro Herrera writes: > On 2022-Dec-23, Alvaro Herrera wrote: > [...] > I tried downloading a list of surnames from here > https://www.bibliotecadenombres.com/apellidos/apellidos-espanoles/ > pasted that in a text file and \copy'ed it into a table. Then I ran > this query > > select

Re: Infinite Interval

2022-12-23 Thread Joseph Koshakow
Hi Ashutosh, I ended up doing some more work on this today. All of the major features should be implemented now. Below are what I think are the outstanding TODOs: - Clean up error messages and error codes - Figure out how to correctly implement interval_part for infinite intervals. For now I

Re: daitch_mokotoff module

2022-12-23 Thread Dag Lem
Alvaro Herrera writes: > I wonder why do you have it return the multiple alternative codes as a > space-separated string. Maybe an array would be more appropriate. Even > on your documented example use, the first thing you do is split it on > spaces. In the example, the *input* is split on

Re: daitch_mokotoff module

2022-12-23 Thread Dag Lem
Tom Lane writes: > Alvaro Herrera writes: >> On 2022-Dec-22, Dag Lem wrote: >>> This should hopefully fix the last Cfbot failures, by exclusion of >>> daitch_mokotoff.h from headerscheck and cpluspluscheck. > >> Hmm, maybe it'd be better to move the typedefs to the .h file instead. > > Indeed,

Re: fixing CREATEROLE

2022-12-23 Thread Robert Haas
On Thu, Dec 22, 2022 at 9:14 AM Alvaro Herrera wrote: > The contents looks good to me other than that problem, and I agree to > backpatch it. Cool. Thanks for the review. > Why did you choose to use two dots for ellipses in some command > s rather than three? I know I've made that choice too

Re: Error-safe user functions

2022-12-23 Thread Tom Lane
Ted Yu writes: > On Fri, Dec 23, 2022 at 1:22 PM Tom Lane wrote: >> Ted Yu writes: >>> + /* See regexp.c for explanation */ >>> + CHECK_FOR_INTERRUPTS(); >> Yes, it is. We don't want a query-cancel transformed into a soft error. >

Re: daitch_mokotoff module

2022-12-23 Thread Dag Lem
Andres Freund writes: > On 2022-12-22 14:27:54 +0100, Dag Lem wrote: >> This should hopefully fix the last Cfbot failures, by exclusion of >> daitch_mokotoff.h from headerscheck and cpluspluscheck. > > Btw, you can do the same tests as cfbot in your own repo by enabling CI > in a github repo.

Re: Error-safe user functions

2022-12-23 Thread Ted Yu
On Fri, Dec 23, 2022 at 1:22 PM Tom Lane wrote: > Ted Yu writes: > > In makeItemLikeRegex : > > > + /* See regexp.c for explanation */ > > + CHECK_FOR_INTERRUPTS(); > > + pg_regerror(re_result, _tmp, errMsg, > > sizeof(errMsg));

Re: Error-safe user functions

2022-12-23 Thread Tom Lane
Ted Yu writes: > In makeItemLikeRegex : > + /* See regexp.c for explanation */ > + CHECK_FOR_INTERRUPTS(); > + pg_regerror(re_result, _tmp, errMsg, > sizeof(errMsg)); > + ereturn(escontext, false, > Since an

Re: Error-safe user functions

2022-12-23 Thread Ted Yu
On Fri, Dec 23, 2022 at 9:20 AM Andrew Dunstan wrote: > > On 2022-12-22 Th 11:44, Tom Lane wrote: > > Andrew Dunstan writes: > >> Yeah, I started there, but it's substantially more complex - unlike cube > >> the jsonpath scanner calls the error routines as well as the parser. > >> Anyway,

Re: Making Vars outer-join aware

2022-12-23 Thread Tom Lane
Ted Yu writes: > For v8-0012-invent-join-domains.patch, in `distribute_qual_to_rels`, it > seems that `pseudoconstant` and `root->hasPseudoConstantQuals` carry the > same value. > Can the variable `pseudoconstant` be omitted ? Surely not. 'pseudoconstant' tells whether the current qual clause

Re: Making Vars outer-join aware

2022-12-23 Thread Ted Yu
On Fri, Dec 23, 2022 at 10:21 AM Tom Lane wrote: > Here's a new edition of this patch series. > > I shoved some preliminary refactoring into the 0001 patch, > notably splitting deconstruct_jointree into two passes. > 0002-0009 cover the same ground as they did before, though > with some

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-12-23 Thread David Christensen
On Fri, Dec 23, 2022 at 12:57 PM David Christensen wrote: > > On Wed, Dec 21, 2022 at 5:47 AM Bharath Rupireddy > wrote: [snip] > > 2. +$node->init(extra => ['-k'], allows_streaming => 1); > > When enabled with allows_streaming, there are a bunch of things that > > happen to the node while

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-12-23 Thread David Christensen
On Mon, Dec 19, 2022 at 12:23 AM Michael Paquier wrote: > > On Thu, Dec 15, 2022 at 05:17:46PM -0600, David Christensen wrote: > > On Thu, Dec 15, 2022 at 12:36 AM Michael Paquier > > wrote: > > This v10 should incorporate your feedback as well as Bharath's. > > Thanks for the new version. I

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-12-23 Thread David Christensen
On Wed, Dec 21, 2022 at 5:47 AM Bharath Rupireddy wrote: > > On Fri, Dec 16, 2022 at 4:47 AM David Christensen > wrote: > > > > On Thu, Dec 15, 2022 at 12:36 AM Michael Paquier > > wrote: > > > > > > On Wed, Dec 14, 2022 at 04:44:34PM -0600, David Christensen wrote: > > > > I can get one sent

Re: Error-safe user functions

2022-12-23 Thread Tom Lane
Andrew Dunstan writes: > On 2022-12-22 Th 11:44, Tom Lane wrote: >> (I wonder why this is using RE_compile_and_cache at all, really, >> rather than some other API. There doesn't seem to be value in >> forcing the regex into the cache at this point.) > I agree. The attached uses pg_regcomp

Re: Error-safe user functions

2022-12-23 Thread Andrew Dunstan
On 2022-12-22 Th 11:44, Tom Lane wrote: > Andrew Dunstan writes: >> Yeah, I started there, but it's substantially more complex - unlike cube >> the jsonpath scanner calls the error routines as well as the parser. >> Anyway, here's a patch. > I looked through this and it seems generally OK. A

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-12-23 Thread Magnus Hagander
On Fri, Dec 23, 2022 at 2:06 AM Michael Paquier wrote: > On Thu, Dec 22, 2022 at 05:03:35PM +0530, Bharath Rupireddy wrote: > > On Thu, Dec 22, 2022 at 4:57 PM Michael Paquier > wrote: > >> As in using "sequence number" removing "file" from the docs and > >> changing the OUT parameter name to

Re: Force streaming every change in logical decoding

2022-12-23 Thread Masahiko Sawada
On Fri, Dec 23, 2022 at 5:32 PM shiy.f...@fujitsu.com wrote: > > On Fri, Dec 23, 2022 1:50 PM Amit Kapila > > > > On Thu, Dec 22, 2022 at 6:18 PM shiy.f...@fujitsu.com > > wrote: > > > > > > > > > Besides, I tried to reduce data size in streaming subscription tap tests > > > by this > > > new

Re: pgsql: Doc: Explain about Column List feature.

2022-12-23 Thread Alvaro Herrera
On 2022-Dec-21, Peter Smith wrote: > On Wed, Dec 21, 2022 at 6:59 PM Alvaro Herrera > wrote: > > > Oh, I see. It's been so long that I haven't looked at the PDFs, that I > > failed to realize that they don't use color. I agree that would be a > > problem. Maybe we can change the title to

Re: [RFC] building postgres with meson - v13

2022-12-23 Thread Justin Pryzby
> From 680ff3f7b4da1dbf21d0c7cd87af9bb5ee8b230c Mon Sep 17 00:00:00 2001 > From: Andres Freund > Date: Wed, 21 Sep 2022 20:36:36 -0700 > Subject: [PATCH v17 01/23] meson: ci: wip: move compilerwarnings task to meson >always: > gcc_warning_script: | > - time ./configure \ > -

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Justin Pryzby
On Fri, Dec 23, 2022 at 05:51:28PM +0900, Michael Paquier wrote: > On Thu, Dec 22, 2022 at 09:27:24PM -0600, Justin Pryzby wrote: > > This would do a single seqscan: > > SELECT format('ALTER TABLE %I ALTER COLUMN %I TYPE TEXT', > > attrelid::regclass, attname) FROM pg_attribute WHERE > >

RE: Time delayed LR (WAS Re: logical replication restrictions)

2022-12-23 Thread Takamichi Osumi (Fujitsu)
On Thursday, December 22, 2022 3:02 PM Takamichi Osumi (Fujitsu) wrote: > Attached the updated patch. > Again, I used one basic patch in another thread to wake up logical replication > worker shared in [2] for TAP tests. The v11 caused a cfbot failure in [1]. But, failed tests looked irrelevant

Re: daitch_mokotoff module

2022-12-23 Thread Tom Lane
Alvaro Herrera writes: > On 2022-Dec-22, Dag Lem wrote: >> This should hopefully fix the last Cfbot failures, by exclusion of >> daitch_mokotoff.h from headerscheck and cpluspluscheck. > Hmm, maybe it'd be better to move the typedefs to the .h file instead. Indeed, that sounds like exactly the

Re: Error-safe user functions

2022-12-23 Thread Andrew Dunstan
On 2022-12-22 Th 01:10, Tom Lane wrote: > Andrew Dunstan writes: >> And here's another for contrib/seg >> I'm planning to commit these two in the next day or so. > I didn't look at the jsonpath one yet. The seg patch passes > an eyeball check, with one minor nit: in seg_atof, > > + *result

Re: daitch_mokotoff module

2022-12-23 Thread Alvaro Herrera
On 2022-Dec-23, Alvaro Herrera wrote: > I wonder why do you have it return the multiple alternative codes as a > space-separated string. Maybe an array would be more appropriate. Even > on your documented example use, the first thing you do is split it on > spaces. I tried downloading a list

Re: daitch_mokotoff module

2022-12-23 Thread Alvaro Herrera
I wonder why do you have it return the multiple alternative codes as a space-separated string. Maybe an array would be more appropriate. Even on your documented example use, the first thing you do is split it on spaces. -- Álvaro Herrera PostgreSQL Developer —

Re: Avoid lost result of recursion (src/backend/optimizer/util/inherit.c)

2022-12-23 Thread Ranier Vilela
Em sex., 23 de dez. de 2022 às 09:10, David Rowley escreveu: > > I've now pushed your fix plus that test. > Thank you all for getting involved to resolve this. regards, Ranier Vilela

Re: appendBinaryStringInfo stuff

2022-12-23 Thread David Rowley
On Fri, 23 Dec 2022 at 22:04, Peter Eisentraut wrote: > > On 19.12.22 23:48, David Rowley wrote: > > On Tue, 20 Dec 2022 at 11:42, Tom Lane wrote: > >> I think Peter is entirely right to question whether *this* type's > >> output function is performance-critical. Who's got large tables with >

Re: daitch_mokotoff module

2022-12-23 Thread Alvaro Herrera
On 2022-Dec-22, Dag Lem wrote: > This should hopefully fix the last Cfbot failures, by exclusion of > daitch_mokotoff.h from headerscheck and cpluspluscheck. Hmm, maybe it'd be better to move the typedefs to the .h file instead. -- Álvaro Herrera PostgreSQL Developer —

RE: Exit walsender before confirming remote flush in logical replication

2022-12-23 Thread Hayato Kuroda (Fujitsu)
Dear Horiguchi-san, > Thus how about before entering an apply_delay, logrep worker sending a > kind of crafted feedback, which reports commit_data.end_lsn as > flushpos? A little tweak is needed in send_feedback() but seems to > work.. Thanks for replying! I tested your saying but it could not

Re: Avoid lost result of recursion (src/backend/optimizer/util/inherit.c)

2022-12-23 Thread David Rowley
On Fri, 23 Dec 2022 at 17:04, Richard Guo wrote: > Thanks for the test! I looked at this and found that with WCO > constraints we can also hit the buggy code. Based on David's test case, > I came up with the following in the morning. I ended up going with a WCO option test in the end. I

Re: cirrus scripts could use make -k

2022-12-23 Thread Andres Freund
Hi, On 2022-12-15 12:31:26 +0100, Peter Eisentraut wrote: > I would find it useful if the cirrus scripts used make -k (and ninja -k) to > keep building everything in the presence of errors. For example, I once had > some issue in code that caused a bunch of compiler warnings on Windows. The >

Re: daitch_mokotoff module

2022-12-23 Thread Andres Freund
On 2022-12-22 14:27:54 +0100, Dag Lem wrote: > This should hopefully fix the last Cfbot failures, by exclusion of > daitch_mokotoff.h from headerscheck and cpluspluscheck. Btw, you can do the same tests as cfbot in your own repo by enabling CI in a github repo. See src/tools/ci/README

Exposing the lock manager's WaitForLockers() to SQL

2022-12-23 Thread Will Mortensen
Hi there, We'd like to be able to call the lock manager's WaitForLockers() and WaitForLockersMultiple() from SQL. Below I describe our use case, but basically I'm wondering if this: 1. Seems like a reasonable thing to do 2. Would be of interest upstream 3. Should be done with a new

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2022-12-23 Thread Bharath Rupireddy
On Mon, Dec 12, 2022 at 8:27 AM Kyotaro Horiguchi wrote: > Thanks for providing thoughts. > At Fri, 9 Dec 2022 14:33:39 +0530, Bharath Rupireddy > wrote in > > The patch introduces concurrent readers for the WAL buffers, so far > > only there are concurrent writers. In the patch, WALRead()

Re: Force streaming every change in logical decoding

2022-12-23 Thread shveta malik
On Fri, Dec 23, 2022 at 2:03 PM shiy.f...@fujitsu.com wrote: > > On Fri, Dec 23, 2022 1:50 PM Amit Kapila > > > > On Thu, Dec 22, 2022 at 6:18 PM shiy.f...@fujitsu.com > > wrote: > > > > > > > > > Besides, I tried to reduce data size in streaming subscription tap tests by this > > > new GUC

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Anton A. Melnikov
Sorry, didn't get to see the last letter! On 23.12.2022 11:51, Michael Paquier wrote: FWIW, I find the use of a FOR loop with a DO block much cleaner to follow in this context, so something like the attached would be able to group the two queries and address your point on O(N^2). Do you like

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Anton A. Melnikov
Hello! On 23.12.2022 06:27, Justin Pryzby wrote: This would do a single seqscan: SELECT format('ALTER TABLE %I ALTER COLUMN %I TYPE TEXT', attrelid::regclass, attname) FROM pg_attribute WHERE atttypid='aclitem'::regtype; -- AND ... \gexec Touched a bit on how long it takes to execute

Re: Timeout when changes are filtered out by the core during logical replication

2022-12-23 Thread Amit Kapila
On Thu, Dec 22, 2022 at 6:58 PM Ashutosh Bapat wrote: > > Hi All, > A customer ran a script dropping a few dozens of users in a transaction. > Before dropping a user they change the ownership of the tables owned by that > user to another user and revoking all the accesses from that user in the

RE: Force streaming every change in logical decoding

2022-12-23 Thread Hayato Kuroda (Fujitsu)
Dear Shi, > I also fixed Kuroda-san's comments[1]. Thanks for updating the patch! I confirmed that my comments were fixed and your patch could pass subscription and test_decoding tests. I think we can change the status to "Ready for Committer". Best Regards, Hayato Kuroda FUJITSU LIMITED

Re: appendBinaryStringInfo stuff

2022-12-23 Thread Peter Eisentraut
On 19.12.22 23:48, David Rowley wrote: On Tue, 20 Dec 2022 at 11:42, Tom Lane wrote: I think Peter is entirely right to question whether *this* type's output function is performance-critical. Who's got large tables with jsonpath columns? It seems to me the type would mostly only exist as

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Michael Paquier
On Thu, Dec 22, 2022 at 09:27:24PM -0600, Justin Pryzby wrote: > This would do a single seqscan: > SELECT format('ALTER TABLE %I ALTER COLUMN %I TYPE TEXT', > attrelid::regclass, attname) FROM pg_attribute WHERE > atttypid='aclitem'::regtype; -- AND ... > \gexec FWIW, I find the use of a FOR loop

Re: ARRNELEMS Out-of-bounds possible errors

2022-12-23 Thread Kyotaro Horiguchi
At Fri, 23 Dec 2022 17:37:55 +0900 (JST), Kyotaro Horiguchi wrote in > At Thu, 22 Dec 2022 12:35:58 -0300, Ranier Vilela wrote > in > > Hi. > > > > Per Coverity. > > > > The commit ccff2d2 > > , > >

Re: ARRNELEMS Out-of-bounds possible errors

2022-12-23 Thread Kyotaro Horiguchi
At Thu, 22 Dec 2022 12:35:58 -0300, Ranier Vilela wrote in > Hi. > > Per Coverity. > > The commit ccff2d2 > , > changed the behavior function ArrayGetNItems, > with the introduction of the function

Re: File API cleanup

2022-12-23 Thread Peter Eisentraut
On 01.12.22 09:25, Peter Eisentraut wrote: Here are a couple of patches that clean up the internal File API and related things a bit: Here are two follow-up patches that clean up some stuff related to the earlier patch set. I suspect these are all historically related.

RE: Force streaming every change in logical decoding

2022-12-23 Thread shiy.f...@fujitsu.com
On Fri, Dec 23, 2022 1:50 PM Amit Kapila > > On Thu, Dec 22, 2022 at 6:18 PM shiy.f...@fujitsu.com > wrote: > > > > > > Besides, I tried to reduce data size in streaming subscription tap tests by > > this > > new GUC (see 0002 patch). But I didn't covert all streaming tap tests > because I > >

Re: Force streaming every change in logical decoding

2022-12-23 Thread Amit Kapila
On Fri, Dec 23, 2022 at 1:12 PM Hayato Kuroda (Fujitsu) wrote: > > Dear hackers, > > > I will check and report the test coverage if I can. > > I ran make coverage. PSA the screen shot that shows results. > According to the result the coverage seemed to be not changed > even if the elapsed time