Re: ARRNELEMS Out-of-bounds possible errors

2022-12-22 Thread Nikita Malakhov
Hi, The most obvious solution I see is to check all calls and for cases like we both mentioned to pass a flag meaning safe or unsafe (for these cases) behavior is expected, like #define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x), false) ... int ArrayGetNItems(int ndim, const int

Re: Using WaitEventSet in the postmaster

2022-12-22 Thread Thomas Munro
I pushed the small preliminary patches. Here's a rebase of the main patch. From d23fba75cf693ffabc068a36424b7be22342c1b2 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Wed, 9 Nov 2022 22:59:58 +1300 Subject: [PATCH v7] Give the postmaster a WaitEventSet and a latch. Traditionally, the

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-12-22 Thread John Naylor
On Thu, Dec 22, 2022 at 10:00 PM Masahiko Sawada wrote: > If the value is a power of 2, it seems to work perfectly fine. But for > example if it's 700MB, the total memory exceeds the limit: > > 2*(1+2+4+8+16+32+64+128) = 510MB (72.8% of 700MB) -> keep going > 510 + 256 = 766MB -> stop but it

Re: Apply worker fails if a relation is missing on subscriber even if refresh publication has not been refreshed yet

2022-12-22 Thread Amit Kapila
On Thu, Dec 22, 2022 at 7:16 PM Melih Mutlu wrote: > > Hi hackers, > > I realized a behaviour of logical replication that seems unexpected to me, > but not totally sure. > > Let's say a new table is created and added into a publication and not created > on subscriber yet. Also "ALTER

RE: Support logical replication of DDLs

2022-12-22 Thread Takamichi Osumi (Fujitsu)
On Thursday, December 22, 2022 2:22 AM vignesh C wrote: > I have handled most of the comments for [1] in the v55 version patch attached. > I will handle the pending comments in the upcoming version and reply to it. > [1] - > https://www.postgresql.org/message-id/20221207122041.hbfj4hen3ibhdzgn% >

Re: Exit walsender before confirming remote flush in logical replication

2022-12-22 Thread Amit Kapila
On Fri, Dec 23, 2022 at 7:51 AM Kyotaro Horiguchi wrote: > > At Thu, 22 Dec 2022 17:29:34 +0530, Ashutosh Bapat > wrote in > > On Thu, Dec 22, 2022 at 11:16 AM Hayato Kuroda (Fujitsu) > > wrote: > > > In case of logical replication, however, we cannot support the use-case > > > that > > >

Re: Force streaming every change in logical decoding

2022-12-22 Thread 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 > think we also need to cover the case that there are lots of

Re: Force streaming every change in logical decoding

2022-12-22 Thread Amit Kapila
On Fri, Dec 23, 2022 at 10:48 AM Hayato Kuroda (Fujitsu) wrote: > > ``` > +* If logical_decoding_mode is immediate, loop until there's no > change. > +* Otherwise, loop until we reach under the memory limit. One might > think > +* that just by evicting the largest

Re: Force streaming every change in logical decoding

2022-12-22 Thread Amit Kapila
On Fri, Dec 23, 2022 at 10:32 AM Masahiko Sawada 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 > > think we also need to cover the case that there are

RE: Force streaming every change in logical decoding

2022-12-22 Thread Hayato Kuroda (Fujitsu)
Dear Shi, Thanks for updating the patch! Followings are comments. ReorderBufferCheckMemoryLimit() ``` + /* +* Bail out if logical_decoding_mode is disabled and we haven't exceeded +* the memory limit. +*/ ``` I think 'disabled' should be '"buffered"'. ``` +

Re: Force streaming every change in logical decoding

2022-12-22 Thread Masahiko Sawada
On Thu, Dec 22, 2022 at 9:48 PM shiy.f...@fujitsu.com wrote: > > On Thu, Dec 22, 2022 5:24 PM Amit Kapila wrote: > > > > On Thu, Dec 22, 2022 at 1:15 PM Kyotaro Horiguchi > > wrote: > > > > > > At Thu, 22 Dec 2022 12:35:46 +0530, Amit Kapila > > wrote in > > > > I have addressed these comments

Re: Windows default locale vs initdb

2022-12-22 Thread Thomas Munro
On Fri, Jul 29, 2022 at 3:33 PM Thomas Munro wrote: > On Fri, Jul 22, 2022 at 11:59 PM Juan José Santamaría Flecha > wrote: > > TL;DR; What I want to show through this example is that Windows ACP is not > > modified by setlocale(), it can only be done through the Windows registry > > and only

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

2022-12-22 Thread Amit Langote
On Fri, Dec 23, 2022 at 1:04 PM Richard Guo wrote: > On Fri, Dec 23, 2022 at 11:22 AM Amit Langote wrote: >> Attached shows a test case I was able to come up with that I can see >> is broken by a61b1f74 though passes after applying Richard's patch. >> What's broken is that deparseUpdateSql()

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

2022-12-22 Thread Richard Guo
On Fri, Dec 23, 2022 at 11:22 AM Amit Langote wrote: > Attached shows a test case I was able to come up with that I can see > is broken by a61b1f74 though passes after applying Richard's patch. > What's broken is that deparseUpdateSql() outputs a remote UPDATE > statement with the wrong SET

Re: Force streaming every change in logical decoding

2022-12-22 Thread Masahiko Sawada
On Thu, Dec 22, 2022 at 6:19 PM Amit Kapila wrote: > > On Thu, Dec 22, 2022 at 12:47 PM Masahiko Sawada > wrote: > > > > On Thu, Dec 22, 2022 at 4:05 PM Amit Kapila wrote: > > > > > > > > I think > > > instead of adding new tests with this patch, it may be better to > > > change some of the

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-22 Thread Masahiko Sawada
On Fri, Dec 23, 2022 at 12:21 PM Amit Kapila wrote: > > On Thu, Dec 22, 2022 at 6:18 PM Masahiko Sawada wrote: > > > > On Thu, Dec 22, 2022 at 7:04 PM Amit Kapila wrote: > > > > > > On Thu, Dec 22, 2022 at 11:39 AM Masahiko Sawada > > > wrote: > > > > > > > > Thank you for updating the patch.

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

2022-12-22 Thread David Rowley
On Fri, 23 Dec 2022 at 16:22, Amit Langote wrote: > Attached shows a test case I was able to come up with that I can see > is broken by a61b1f74 though passes after applying Richard's patch. Thanks for the test case. I'll look at this now. +UPDATE rootp SET b = b || 'd' RETURNING a, b, c, d; +

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

2022-12-22 Thread Amit Langote
On Fri, Dec 23, 2022 at 12:22 PM Amit Langote wrote: > Attached shows a test case I was able to come up with that I can see > is broken by a61b1f74 though passes after applying Richard's patch. BTW, I couldn't help but notice in the output of the test case I wrote that a generated column of a

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

2022-12-22 Thread Justin Pryzby
On Fri, Dec 23, 2022 at 11:42:39AM +0900, Michael Paquier wrote: > Hmm. 0001 does a direct check on aclitem as data type used in an > attribute, > For now, I have fixed the most pressing part for tables to match with > the buildfarm +DO $$ + DECLARE +rec text; + col text; + BEGIN +

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

2022-12-22 Thread Amit Langote
Hi, Thanks everyone for noticing this. It is indeed very obviously broken. :( On Fri, Dec 23, 2022 at 11:26 AM David Rowley wrote: > On Fri, 23 Dec 2022 at 15:21, Richard Guo wrote: > > > > On Thu, Dec 22, 2022 at 5:22 PM David Rowley wrote: > >> I still think we should have a test to ensure

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-22 Thread Amit Kapila
On Thu, Dec 22, 2022 at 6:18 PM Masahiko Sawada wrote: > > On Thu, Dec 22, 2022 at 7:04 PM Amit Kapila wrote: > > > > On Thu, Dec 22, 2022 at 11:39 AM Masahiko Sawada > > wrote: > > > > > > Thank you for updating the patch. Here are some comments on v64 patches: > > > > > > While testing the

Re: Allow WindowFuncs prosupport function to use more optimal WindowClause options

2022-12-22 Thread Vik Fearing
On 12/23/22 00:47, David Rowley wrote: On Wed, 26 Oct 2022 at 14:38, David Rowley wrote: I've now pushed the final result. Thank you to everyone who provided input on this. This is a very good improvement. Thank you for working on it. -- Vik Fearing

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

2022-12-22 Thread Michael Paquier
On Thu, Dec 22, 2022 at 09:59:18AM +0300, Anton A. Melnikov wrote: > 2) v2-0002-Additional-dumps-filtering.patch + # Replace specific privilegies with ALL + $dump_contents =~ s/^(GRANT\s|REVOKE\s)(\S*)\s/$1ALL /mgx; This should not be in 0002, I guess.. > Yes. Made a hook that allows

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

2022-12-22 Thread David Rowley
On Fri, 23 Dec 2022 at 15:21, Richard Guo wrote: > > On Thu, Dec 22, 2022 at 5:22 PM David Rowley wrote: >> I still think we should have a test to ensure this is actually >> working. Do you want to write one? > > > I agree that we should have a test. According to the code coverage > report, the

Re: Force streaming every change in logical decoding

2022-12-22 Thread Kyotaro Horiguchi
At Thu, 22 Dec 2022 14:53:34 +0530, Amit Kapila wrote in > For this, I like your proposal for "buffered" as an explicit default value. Good to hear. > Okay, how about modifying it to: "When set to > immediate, stream each change if > streaming option (see optional parameters set by > CREATE

Re: Exit walsender before confirming remote flush in logical replication

2022-12-22 Thread Kyotaro Horiguchi
At Thu, 22 Dec 2022 17:29:34 +0530, Ashutosh Bapat wrote in > On Thu, Dec 22, 2022 at 11:16 AM Hayato Kuroda (Fujitsu) > wrote: > > In case of logical replication, however, we cannot support the use-case that > > switches the role publisher <-> subscriber. Suppose same case as above, > >

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

2022-12-22 Thread Richard Guo
On Thu, Dec 22, 2022 at 5:22 PM David Rowley wrote: > On Thu, 22 Dec 2022 at 21:18, Richard Guo wrote: > > My best guess is that this function is intended to share the same code > > pattern as in adjust_appendrel_attrs_multilevel. The recursion is > > needed as 'rel' can be more than one

Re: Small miscellaneus fixes (Part II)

2022-12-22 Thread Justin Pryzby
On Thu, Dec 22, 2022 at 02:29:11PM -0300, Ranier Vilela wrote: > Em ter., 20 de dez. de 2022 às 21:51, Justin Pryzby > escreveu: > > > On Fri, Nov 25, 2022 at 06:27:04PM -0300, Ranier Vilela wrote: > > > 5. Use boolean operator with boolean operands > > > (b/src/backend/commands/tablecmds.c) >

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

2022-12-22 Thread Michael Paquier
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 segment_number rather than segno? >> Fine by me. > > +1. Okay,

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-22 Thread Imseih (AWS), Sami
>I adjusted the FAILSAFE_EVERY_PAGES comments, which now point out that >FAILSAFE_EVERY_PAGES is a power-of-two. The implication is that the >compiler is all but guaranteed to be able to reduce the modulo >division into a shift in the lazy_scan_heap loop, at the point of the >

Re: Allow WindowFuncs prosupport function to use more optimal WindowClause options

2022-12-22 Thread David Rowley
On Wed, 26 Oct 2022 at 14:38, David Rowley wrote: > > On Sun, 23 Oct 2022 at 03:03, Vik Fearing wrote: > > Shouldn't it be able to detect that these two windows are the same and > > only do one WindowAgg pass? > > > > > > explain (verbose, costs off) > > select row_number() over w1, > >

Re: ARRNELEMS Out-of-bounds possible errors

2022-12-22 Thread Ranier Vilela
Em qui., 22 de dez. de 2022 às 15:45, Nikita Malakhov escreveu: > Hi, > > Actually, there would be much more sources affected, like > nbytes += subbytes[outer_nelems]; > subnitems[outer_nelems] = ArrayGetNItems(this_ndims, >

Re: Array initialisation notation in syscache.c

2022-12-22 Thread Thomas Munro
On Thu, Dec 22, 2022 at 5:36 AM Peter Eisentraut wrote: > This looks like a good improvement to me. Thanks both. Pushed. > (I have also thought about having this generated from the catalog > definition files somehow, but one step at a time ...) Good plan.

Re: Schema variables - new implementation for Postgres 15 (typo)

2022-12-22 Thread Dmitry Dolgov
> On Thu, Dec 22, 2022 at 08:45:57PM +0100, Pavel Stehule wrote: > > From the first look it seems some major topics the discussion is evolving > > are about: > > > > * Validity of the use case. Seems to be quite convincingly addressed in > > [1] and > > [2]. > > > > * Complicated logic around

Re: checking snapshot argument for index_beginscan

2022-12-22 Thread Pavel Borisov
On Fri, 23 Dec 2022 at 00:36, Ted Yu wrote: >> >> Hi, >> I was looking at commit 941aa6a6268a6a66f6895401aad6b5329111d412 . >> >> I think it would be better to move the assertion into >> `index_beginscan_internal` because it is called by index_beginscan and >> index_beginscan_bitmap >> >> In

Re: checking snapshot argument for index_beginscan

2022-12-22 Thread Ted Yu
> > Hi, > I was looking at commit 941aa6a6268a6a66f6895401aad6b5329111d412 . > > I think it would be better to move the assertion into > `index_beginscan_internal` because it is called by index_beginscan > and index_beginscan_bitmap > > In the future, when a new variant of `index_beginscan_XX` is

Re: Schema variables - new implementation for Postgres 15 (typo)

2022-12-22 Thread Pavel Stehule
čt 22. 12. 2022 v 17:15 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > Hi, > > I'm continuing review the patch slowly, and have one more issue plus one > philosophical question. > > The issue have something to do with variables invalidation. Enabling > debug_discard_caches = 1 (about

Re: dynamic result sets support in extended query protocol

2022-12-22 Thread Alvaro Herrera
On 2022-Dec-21, Alvaro Herrera wrote: > I suppose that in order for this to work, we would have to find another > way to "advance" the queue that doesn't rely on the status being > PGASYNC_READY. I think the way to make this work is to increase the coupling between fe-exec.c and fe-protocol.c by

Re: ARRNELEMS Out-of-bounds possible errors

2022-12-22 Thread Nikita Malakhov
Hi, Actually, there would be much more sources affected, like nbytes += subbytes[outer_nelems]; subnitems[outer_nelems] = ArrayGetNItems(this_ndims, ARR_DIMS(array)); nitems += subnitems[outer_nelems]; havenulls |=

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-22 Thread Peter Geoghegan
On Tue, Dec 20, 2022 at 9:44 AM Imseih (AWS), Sami wrote: > Attached is a patch to check scanned pages rather > than blockno. Pushed, thanks! I adjusted the FAILSAFE_EVERY_PAGES comments, which now point out that FAILSAFE_EVERY_PAGES is a power-of-two. The implication is that the compiler is

Re: [PATCH] Infinite loop while acquiring new TOAST Oid

2022-12-22 Thread Nikita Malakhov
Hi hackers! Any suggestions on the previous message (64-bit toast value ID with individual counters)? On Tue, Dec 13, 2022 at 1:41 PM Nikita Malakhov wrote: > Hi hackers! > > I've prepared a patch with a 64-bit TOAST Value ID. It is a kind of > prototype > and needs some further work, but it

Re: [PATCH] Add function to_oct

2022-12-22 Thread Eric Radman
On Thu, Dec 22, 2022 at 10:08:17AM +, Dag Lem wrote: > > The calculation of quotient and remainder can be replaced by less costly > masking and shifting. > > Defining > > #define OCT_DIGIT_BITS 3 > #define OCT_DIGIT_BITMASK 0x7 > > the content of the loop can be replaced by > >

Re: Small miscellaneus fixes (Part II)

2022-12-22 Thread Ranier Vilela
Em ter., 20 de dez. de 2022 às 21:51, Justin Pryzby escreveu: > On Fri, Nov 25, 2022 at 06:27:04PM -0300, Ranier Vilela wrote: > > 5. Use boolean operator with boolean operands > > (b/src/backend/commands/tablecmds.c) > > tablecmds.c: right. Since 074c5cfbf > > pg_dump.c: right. Since

Re: Add LZ4 compression in pg_dump

2022-12-22 Thread Justin Pryzby
There's a couple of lz4 bits which shouldn't be present in 002: file extension and comments.

Re: Error-safe user functions

2022-12-22 Thread Tom Lane
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 minor nitpick is that we usually write "(Datum)

Re: Schema variables - new implementation for Postgres 15 (typo)

2022-12-22 Thread Dmitry Dolgov
Hi, I'm continuing review the patch slowly, and have one more issue plus one philosophical question. The issue have something to do with variables invalidation. Enabling debug_discard_caches = 1 (about which I've learned from this thread) and running this subset of the test suite:

Re: Optimization issue of branching UNION ALL

2022-12-22 Thread Tom Lane
Andrey Lepikhov writes: > Thanks, I have written the letter because of some doubts too. But only > one weak point I could imagine - if someday sql standard will be changed. Yeah, if they ever decide that LATERAL should be allowed to reference a previous sub-query of UNION ALL, that'd probably

ARRNELEMS Out-of-bounds possible errors

2022-12-22 Thread Ranier Vilela
Hi. Per Coverity. The commit ccff2d2 , changed the behavior function ArrayGetNItems, with the introduction of the function ArrayGetNItemsSafe. Now ArrayGetNItems may return -1, according to the comment. "

Re: daitch_mokotoff module

2022-12-22 Thread Dag Lem
Dag Lem writes: > Hi Ian, > > Ian Lawrence Barwick writes: > [...] >> I see you provided some feedback on >> https://commitfest.postgresql.org/36/3468/, >> though the patch seems to have not been accepted (but not >> conclusively rejected >> either). If you still have the chance to review

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-12-22 Thread Masahiko Sawada
On Thu, Dec 22, 2022 at 7:24 PM John Naylor wrote: > > > On Wed, Dec 21, 2022 at 3:09 PM Masahiko Sawada wrote: > > > > On Tue, Dec 20, 2022 at 3:09 PM John Naylor > > wrote: > > > > https://www.postgresql.org/message-id/20220704211822.kfxtzpcdmslzm2dy%40awork3.anarazel.de > > > > > > I'm

Re: daitch_mokotoff module

2022-12-22 Thread Dag Lem
Dag Lem writes: > I noticed that the Meson builds failed in Cfbot, the updated patch adds > a missing "include_directories" line to meson.build. > This should hopefully fix the last Cfbot failures, by exclusion of daitch_mokotoff.h from headerscheck and cpluspluscheck. Best regards Dag Lem

Re: fixing CREATEROLE

2022-12-22 Thread Alvaro Herrera
Reading 0001: +However, CREATEROLE does not convey the ability to +create SUPERUSER roles, nor does it convey any +power over SUPERUSER roles that already exist. +Furthermore, CREATEROLE does not convey the power +to create REPLICATION users, nor the

Apply worker fails if a relation is missing on subscriber even if refresh publication has not been refreshed yet

2022-12-22 Thread Melih Mutlu
Hi hackers, I realized a behaviour of logical replication that seems unexpected to me, but not totally sure. Let's say a new table is created and added into a publication and not created on subscriber yet. Also "ALTER SUBSCRIPTION ... REFRESH PUBLICATION" has not been called yet. What I expect

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

2022-12-22 Thread Ashutosh Bapat
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 same transaction. There were a few thousand tables whose privileges

Re: daitch_mokotoff module

2022-12-22 Thread Dag Lem
I noticed that the Meson builds failed in Cfbot, the updated patch adds a missing "include_directories" line to meson.build. Best regards Dag Lem diff --git a/contrib/fuzzystrmatch/Makefile b/contrib/fuzzystrmatch/Makefile index 0704894f88..12baf2d884 100644 --- a/contrib/fuzzystrmatch/Makefile

RE: Force streaming every change in logical decoding

2022-12-22 Thread shiy.f...@fujitsu.com
On Thu, Dec 22, 2022 5:24 PM Amit Kapila wrote: > > On Thu, Dec 22, 2022 at 1:15 PM Kyotaro Horiguchi > wrote: > > > > At Thu, 22 Dec 2022 12:35:46 +0530, Amit Kapila > wrote in > > > I have addressed these comments in the attached. Additionally, I have > > > modified the docs and commit

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-22 Thread Masahiko Sawada
On Thu, Dec 22, 2022 at 7:04 PM Amit Kapila wrote: > > On Thu, Dec 22, 2022 at 11:39 AM Masahiko Sawada > wrote: > > > > Thank you for updating the patch. Here are some comments on v64 patches: > > > > While testing the patch, I realized that if all streamed transactions > > are handled by

Re: appendBinaryStringInfo stuff

2022-12-22 Thread John Naylor
On Thu, Dec 22, 2022 at 4:19 PM David Rowley wrote: > > Test 1 (from earlier) > > master + escape_json using appendStringInfoCharMacro > $ pgbench -n -T 60 -f bench.sql -M prepared postgres | grep latency > latency average = 1.807 ms > latency average = 1.800 ms > latency average = 1.812 ms

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-22 Thread Amit Kapila
On Wed, Dec 21, 2022 at 11:02 AM houzj.f...@fujitsu.com wrote: > > Attach the new patch set which also includes some > cosmetic comment changes. > Few minor comments: = 1. + t = spill the changes of in-progress transactions to+ disk and apply at once after the

Re: Exit walsender before confirming remote flush in logical replication

2022-12-22 Thread Ashutosh Bapat
On Thu, Dec 22, 2022 at 11:16 AM Hayato Kuroda (Fujitsu) wrote: > > Dear hackers, > (I added Amit as CC because we discussed in another thread) > > This is a fork thread from time-delayed logical replication [1]. > While discussing, we thought that we could extend the condition of walsender >

Re: Optimization issue of branching UNION ALL

2022-12-22 Thread Andrey Lepikhov
On 22/12/2022 06:50, Tom Lane wrote: 2. Iterative passes along the append_rel_list for replacing vars in the translated_vars field. I can't grasp real necessity of passing all the append_rel_list during flattening of an union all leaf subquery. No one can reference this leaf, isn't it? After

Re: Small miscellaneus fixes (Part II)

2022-12-22 Thread Ranier Vilela
Em qua., 21 de dez. de 2022 às 04:10, Michael Paquier escreveu: > On Tue, Dec 20, 2022 at 06:51:34PM -0600, Justin Pryzby wrote: > > On Fri, Nov 25, 2022 at 06:27:04PM -0300, Ranier Vilela wrote: > > > 5. Use boolean operator with boolean operands > > > (b/src/backend/commands/tablecmds.c) > > >

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

2022-12-22 Thread Bharath Rupireddy
On Thu, Dec 22, 2022 at 4:57 PM Michael Paquier wrote: > > On Thu, Dec 22, 2022 at 05:19:24PM +0900, Kyotaro Horiguchi wrote: > > In the first place "file sequence number" and "segno" can hardly be > > associated by appearance by readers, I think. (Yeah, we can identify > > that since the

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

2022-12-22 Thread Michael Paquier
On Thu, Dec 22, 2022 at 05:19:24PM +0900, Kyotaro Horiguchi wrote: > In the first place "file sequence number" and "segno" can hardly be > associated by appearance by readers, I think. (Yeah, we can identify > that since the another parameter is identifiable alone.) Why don't we > spell out the

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-12-22 Thread John Naylor
On Wed, Dec 21, 2022 at 3:09 PM Masahiko Sawada wrote: > > On Tue, Dec 20, 2022 at 3:09 PM John Naylor > wrote: > > https://www.postgresql.org/message-id/20220704211822.kfxtzpcdmslzm2dy%40awork3.anarazel.de > > > > I'm guessing the hash join case can afford to be precise about memory because it

Re: [PATCH] Add function to_oct

2022-12-22 Thread Dag Lem
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested This is a mini-review of to_oct :-) The function seems useful to me, and is

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-22 Thread Amit Kapila
On Thu, Dec 22, 2022 at 11:39 AM Masahiko Sawada wrote: > > Thank you for updating the patch. Here are some comments on v64 patches: > > While testing the patch, I realized that if all streamed transactions > are handled by parallel workers, there is no chance for the leader to > call

Re: Force streaming every change in logical decoding

2022-12-22 Thread Amit Kapila
On Thu, Dec 22, 2022 at 1:15 PM Kyotaro Horiguchi wrote: > > At Thu, 22 Dec 2022 12:35:46 +0530, Amit Kapila > wrote in > > I have addressed these comments in the attached. Additionally, I have > > modified the docs and commit messages to make those clear. I think > > instead of adding new

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

2022-12-22 Thread David Rowley
On Thu, 22 Dec 2022 at 21:18, Richard Guo wrote: > My best guess is that this function is intended to share the same code > pattern as in adjust_appendrel_attrs_multilevel. The recursion is > needed as 'rel' can be more than one inheritance level below the top > parent. I think we can keep the

Re: appendBinaryStringInfo stuff

2022-12-22 Thread David Rowley
On Thu, 22 Dec 2022 at 20:56, Tom Lane wrote: > > David Rowley writes: > > 22.57% postgres [.] escape_json > > Hmm ... shouldn't we do something like > > -appendStringInfoString(buf, "\\b"); > +appendStringInfoCharMacro(buf, '\\'); > +

Re: Force streaming every change in logical decoding

2022-12-22 Thread Amit Kapila
On Thu, Dec 22, 2022 at 12:47 PM Masahiko Sawada wrote: > > On Thu, Dec 22, 2022 at 4:05 PM Amit Kapila wrote: > > > > > I think > > instead of adding new tests with this patch, it may be better to > > change some of the existing tests related to streaming to use this > > parameter as that will

Re: Force streaming every change in logical decoding

2022-12-22 Thread Amit Kapila
On Thu, Dec 22, 2022 at 1:55 PM Kyotaro Horiguchi wrote: > > At Thu, 22 Dec 2022 16:59:30 +0900, Masahiko Sawada > wrote in > > On Thu, Dec 22, 2022 at 4:18 PM Hayato Kuroda (Fujitsu) > > wrote: > > > > > > Dear Amit, > > > > > > Thank you for updating the patch. I have also checked the patch

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-22 Thread Masahiko Sawada
On Wed, Dec 21, 2022 at 2:44 AM Imseih (AWS), Sami wrote: > > Attached is a patch to check scanned pages rather > than blockno. Thank you for the patch. It looks good to me. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-22 Thread Masahiko Sawada
On Sat, Nov 12, 2022 at 12:28 AM Imseih (AWS), Sami wrote: > > >Yeah, it's a little inconsistent. > > Yes, this should be corrected by calling the failsafe > inside the parallel vacuum loops and handling the case by exiting > the loop and parallel vacuum if failsafe kicks in. I agree it's

Re: Force streaming every change in logical decoding

2022-12-22 Thread Kyotaro Horiguchi
At Thu, 22 Dec 2022 16:59:30 +0900, Masahiko Sawada wrote in > On Thu, Dec 22, 2022 at 4:18 PM Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Amit, > > > > Thank you for updating the patch. I have also checked the patch > > and basically it has worked well. Almost all things I found were

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

2022-12-22 Thread Kyotaro Horiguchi
At Thu, 22 Dec 2022 10:09:23 +0530, Bharath Rupireddy wrote in > On Thu, Dec 22, 2022 at 7:57 AM Michael Paquier wrote: > > > > On Wed, Dec 21, 2022 at 10:22:02PM +0100, Magnus Hagander wrote: > > > Basically, we take one thing and turn it into 3. That very naturally rings > > > with "split"

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

2022-12-22 Thread Richard Guo
On Wed, Dec 21, 2022 at 9:45 AM David Rowley wrote: > Also, I think it might be better to take the opportunity to rewrite > the function to not use recursion. I don't quite see the need for it > here and it looks like that might have helped contribute to the > reported issue. Can't we just

Re: Force streaming every change in logical decoding

2022-12-22 Thread Masahiko Sawada
On Thu, Dec 22, 2022 at 4:18 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Amit, > > Thank you for updating the patch. I have also checked the patch > and basically it has worked well. Almost all things I found were modified > by v4. > > One comment: while setting logical_decoding_mode to wrong