errors building on windows using meson

2023-12-07 Thread Dave Cramer
Greetings, Getting the following error: state-exec: run failed: cannot create new executor meta: cannot get matching bin by path: no matching binary by path "C:\\Users\\Administrator\\AppData\\Local\\activestate\\cache\\b9117b06\\exec\\perl.EXE" state-exec: Not user serviceable; Please contact

Re: errors building on windows using meson

2023-12-07 Thread Dave Cramer
On Thu, 7 Dec 2023 at 13:53, Andres Freund wrote: > Hi, > > On 2023-12-07 12:54:27 -0500, Dave Cramer wrote: > > state-exec: run failed: cannot create new executor meta: cannot get > > matching bin by path: no matching binary by path > > >

Re: errors building on windows using meson

2023-12-07 Thread Dave Cramer
On Thu, 7 Dec 2023 at 14:34, Andres Freund wrote: > Hi, > > On 2023-12-07 14:16:52 -0500, Dave Cramer wrote: > > On Thu, 7 Dec 2023 at 13:53, Andres Freund wrote: > > > > > Hi, > > > > > > On 2023-12-07 12:54:27 -0500, Dave Cramer wrote: > > > > state-exec: run failed: cannot create new

Re: postgres_fdw test timeouts

2023-12-07 Thread Thomas Munro
On Thu, Dec 7, 2023 at 10:00 PM Alexander Lakhin wrote: > I think, I've found out what's going on here. > The culprit is WSAEnumNetworkEvents() assisted by non-trivial logic of > ExecAppendAsyncEventWait(). > For the case noccurred > 1, ExecAppendAsyncEventWait() performs a loop, > where

Re: Proposal to add page headers to SLRU pages

2023-12-07 Thread Debnath, Shawn
>> Sounds like a half-measure to me. If we really want to go down this >> rabbit hole IMO SLRU should be moved to shared buffers as proposed >> elsewhere [1]. > Thread that I cited stopped in 2018 for this exact reason. 5 years ago. Is > this argument still valid? Meanwhile checksums of buffer

Re: Remove MSVC scripts from the tree

2023-12-07 Thread Andres Freund
Hi, On 2023-12-07 13:49:44 -0500, Andrew Dunstan wrote: > On 2023-12-07 Th 12:34, Andres Freund wrote: > > However: I used godbolt to compile the test code on msvc, and it seems to > > build with 19.15 (which is the version Andrew referenced upthread), with a > > warning that's triggered

Re: [CAUTION!! freemail] Re: Partial aggregates pushdown

2023-12-07 Thread Bruce Momjian
On Thu, Dec 7, 2023 at 09:56:08AM -0500, Robert Haas wrote: > On Wed, Dec 6, 2023 at 7:11 PM fujii.y...@df.mitsubishielectric.co.jp > wrote: > > I would be grateful if we can resolve this issue gradually. I would also > > like to continue the discussion if possible in the future. > > I think

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-12-07 Thread Jeff Davis
On Tue, 2023-12-05 at 11:58 -0800, Jeff Davis wrote: > Also, I forward-declared config_generic in guc.h to eliminate the > cast. Looking more closely, I fixed an issue related to placeholder configs. We can't return a handle to a placeholder, because it's not stable, so in that case it falls back

Re: Proposal to add page headers to SLRU pages

2023-12-07 Thread Andrey Borodin
07.12.2023, 19:17, "Aleksander Alekseev" :Hi, +1 to the idea to protect SLRUs from corruption. I'm slightly leaning towards the idea of separating checksums from data pages, but anyway this checksums are better than no checksums. On 7 Dec 2023, at 10:06, Li, Yong wrote: I am still

Re: errors building on windows using meson

2023-12-07 Thread Andres Freund
Hi, On 2023-12-07 14:16:52 -0500, Dave Cramer wrote: > On Thu, 7 Dec 2023 at 13:53, Andres Freund wrote: > > > Hi, > > > > On 2023-12-07 12:54:27 -0500, Dave Cramer wrote: > > > state-exec: run failed: cannot create new executor meta: cannot get > > > matching bin by path: no matching binary by

Re: Remove MSVC scripts from the tree

2023-12-07 Thread Andrew Dunstan
On 2023-12-07 Th 12:34, Andres Freund wrote: Hi, On 2023-12-07 12:33:35 +0100, Alvaro Herrera wrote: Well, We have things like these typedef struct _archiveOpts { ... } ArchiveOpts; #define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__} XL_ROUTINE is quite similar. These are then

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Masahiko Sawada
On Fri, Dec 8, 2023 at 1:39 AM Andrew Dunstan wrote: > > > On 2023-12-07 Th 03:37, Junwang Zhao wrote: > > > > The point of this refactor (from my view) is to make it possible to add new > > copy handlers in extensions, just like access method. As Andres suggested, > > a system catalog like

Re: Remove MSVC scripts from the tree

2023-12-07 Thread Andres Freund
Hi, On 2023-12-07 12:33:35 +0100, Alvaro Herrera wrote: > Well, We have things like these > > typedef struct _archiveOpts > { > ... > } ArchiveOpts; > #define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__} > > XL_ROUTINE is quite similar. > > These are then used like >

Re: remaining sql/json patches

2023-12-07 Thread Alvaro Herrera
I noticed that JSON_TABLE uses an explicit FORMAT JSON in one of the rules, instead of using json_format_clause_opt like everywhere else. I wondered why, and noticed that it's because it wants to set coltype JTC_FORMATTED when the clause is present but JTC_REGULAR otherwise. This seemed a little

Re: errors building on windows using meson

2023-12-07 Thread Andres Freund
Hi, On 2023-12-07 12:54:27 -0500, Dave Cramer wrote: > state-exec: run failed: cannot create new executor meta: cannot get > matching bin by path: no matching binary by path > "C:\\Users\\Administrator\\AppData\\Local\\activestate\\cache\\b9117b06\\exec\\perl.EXE" > state-exec: Not user

Re: Proposal to add page headers to SLRU pages

2023-12-07 Thread Robert Haas
On Thu, Dec 7, 2023 at 1:28 PM Debnath, Shawn wrote: > What is being proposed now is the simple and core functionality of introducing > page headers to SLRU pages while continuing to be in the SLRU cache. This > allows the whole project to be iterative and reviewers to better reason about > the

Re: Remove MSVC scripts from the tree

2023-12-07 Thread Thomas Munro
On Thu, Dec 7, 2023 at 5:27 AM Andrew Dunstan wrote: > But the VS2019 compiler implements enough of C99 to pass our meson test, > unlike VS2017. Maybe the test is too strict. After all, we know we can > in fact build with the earlier versions. . o O { I wish master would systematically drop

Improve upcasting for INT range and multi range types

2023-12-07 Thread Federico
Hi, Postgresql seems to be missing upcasting when doing INT range and multi-range operation, for example when checking if an int4 is inside an int8 range. Some non working example are the following SELECT 2::INT4 <@ '[1, 4)'::INT8RANGE -- ERROR: operator does not exist: integer <@

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-12-07 Thread Jeff Davis
On Tue, 2023-11-21 at 09:24 -0500, Robert Haas wrote: > As to the first, could we > remove the setjmp() and instead have abort-time processing know > something about this? For example, imagine we just push something > onto > a stack like we do for ErrorContextCallback, do whatever, and then > pop

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

2023-12-07 Thread Jeff Davis
On Thu, 2023-12-07 at 15:59 +0530, Bharath Rupireddy wrote: > In the attached v17 patch 0001 could impact performance could be impacted in a few ways: * There's one additional write barrier inside AdvanceXLInsertBuffer() * AdvanceXLInsertBuffer() already holds WALBufMappingLock, so

Re: [HACKERS] pg_upgrade vs vacuum_cost_delay

2023-12-07 Thread Bruce Momjian
On Fri, Nov 24, 2023 at 06:20:28PM +0100, Magnus Hagander wrote: > On Fri, Nov 24, 2023 at 5:34 PM Bruce Momjian wrote: > > > > On Fri, Nov 24, 2023 at 01:10:01PM +0100, Michael Banck wrote: > > > Hi, > > > > > > On Fri, Nov 24, 2023 at 12:17:56PM +0100, Magnus Hagander wrote: > > > > On Fri, Nov

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

2023-12-07 Thread John Naylor
On Fri, Dec 8, 2023 at 8:57 AM Masahiko Sawada wrote: > It's still unclear to me why the value doesn't need to contain the size. > > If I understand you correctly, in RT_GET(), the tree allocs a new > memory and updates the slot where the value is embedded with the > pointer to the allocated

Re: Is WAL_DEBUG related code still relevant today?

2023-12-07 Thread Michael Paquier
On Thu, Dec 07, 2023 at 05:29:55PM +0530, Bharath Rupireddy wrote: > The comment atop trace_recovery [1] function says it should go away > eventually and seems to have served the purpose when the recovery > related code was introduced in PG 9.0. > > FWIW, the attached patch is what I've left with

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

2023-12-07 Thread Masahiko Sawada
On Fri, Dec 8, 2023 at 1:37 PM John Naylor wrote: > > On Fri, Dec 8, 2023 at 8:57 AM Masahiko Sawada wrote: > > > It's still unclear to me why the value doesn't need to contain the size. > > > > If I understand you correctly, in RT_GET(), the tree allocs a new > > memory and updates the slot

Re: Memory consumed by paths during partitionwise join planning

2023-12-07 Thread David Rowley
On Fri, 8 Dec 2023 at 18:02, Ashutosh Bapat wrote: > given path. E.g. we have three path chains as follows > 1. joinpath_1->joinpath_2->seqpath_1, > 2. joinpath_3->joinpath_4->seqpath_1, > 3. joinpath_5->joinpath_2->seqpath_1 > > Please note that this is not full path tree/forest. It is difficult

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Michael Paquier
On Fri, Dec 08, 2023 at 10:32:27AM +0800, Junwang Zhao wrote: > I can see FDW related utility commands but no TABLESAMPLE related, > and there is a pg_foreign_data_wrapper system catalog which has > a *fdwhandler* field. + */ +CATALOG(pg_copy_handler,4551,CopyHandlerRelationId) Using a catalog

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Masahiko Sawada
On Fri, Dec 8, 2023 at 2:17 PM Michael Paquier wrote: > > On Fri, Dec 08, 2023 at 10:32:27AM +0800, Junwang Zhao wrote: > > I can see FDW related utility commands but no TABLESAMPLE related, > > and there is a pg_foreign_data_wrapper system catalog which has > > a *fdwhandler* field. > > + */

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2023-12-07 Thread Alena Rybakina
Thank you for your work. Unfortunately, your code contained errors during the make installation: 'SAVEPOINT' after 'SAVE_ERROR' in unreserved_keyword list is misplaced 'SAVEPOINT' after 'SAVE_ERROR' in bare_label_keyword list is misplaced make[2]: *** [../../../src/Makefile.global:783: gram.c]

Re: Remove MSVC scripts from the tree

2023-12-07 Thread Michael Paquier
On Fri, Dec 08, 2023 at 08:50:47AM +1300, Thomas Munro wrote: > . o O { I wish master would systematically drop support for compilers > that were out of 'mainstream' vendor support. } Calling for a patch once, twice ;p FWIW, I would not mind marking VS 2019 as the minimum requirement on HEAD

Re: remaining sql/json patches

2023-12-07 Thread Amit Langote
On Fri, Dec 8, 2023 at 2:19 AM Robert Haas wrote: > On Wed, Dec 6, 2023 at 10:26 AM Alvaro Herrera > wrote: > > > I think I'm inclined toward adapting the LA-token fix (attached 0005), > > > because we've done that before with SQL/JSON constructors patch. > > > Also, if I understand the

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Michael Paquier
On Fri, Dec 08, 2023 at 03:42:06PM +0900, Masahiko Sawada wrote: > So a custom COPY extension would not be able to define SQL functions > just like arrow(internal) for example. We might need to define a rule > like the function returning copy_in/out_handler must be defined as > _to(internal) and

Re: Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'

2023-12-07 Thread Alexander Pyhalov
Andrei Lepikhov писал(а) 2023-12-08 07:37: On 28/11/2023 01:37, Alexander Korotkov wrote: On Mon, Nov 27, 2023 at 8:07 PM Andres Freund wrote: Sorry for the late answer, I missed this thread because of vacation. On 2023-11-27 11:29:48 +0530, Ashutosh Bapat wrote: How do we ensure that we are

Re: Extending SMgrRelation lifetimes

2023-12-07 Thread Heikki Linnakangas
On 29/11/2023 14:41, Heikki Linnakangas wrote: 2. A funny case with foreign tables: ANALYZE on a foreign table calls visibilitymap_count(). A foreign table has no visibility map so it returns 0, but before doing so it calls RelationGetSmgr on the foreign table, which has 0/0/0 rellocator. That

Re: Rename ShmemVariableCache and initialize it in more standard way

2023-12-07 Thread Heikki Linnakangas
On 05/12/2023 05:40, Richard Guo wrote: On Tue, Dec 5, 2023 at 12:31 AM Tristan Partin wrote: On Mon Dec 4, 2023 at 6:49 AM CST, Heikki Linnakangas wrote: > Here's a patch to allocate and initialize it with a pair of ShmemSize > and ShmemInit functions, like all other shared

Re: [PATCH] New [relation] option engine

2023-12-07 Thread Michael Paquier
On Fri, Dec 08, 2023 at 08:10:29AM +0300, Yura Sokolov wrote: > I've rebased patch, so it could be add to commitfest again. This is a 270kB patch with quite a few changes, and a lot of code moved around: > 47 files changed, 2592 insertions(+), 2326 deletions(-) Could it be possible to split

Re: introduce dynamic shared memory registry

2023-12-07 Thread Michael Paquier
On Mon, Dec 04, 2023 at 09:46:47PM -0600, Nathan Bossart wrote: > The attached 0001 introduces a "DSM registry" to solve this problem. The > API provides an easy way to allocate/initialize a segment or to attach to > an existing one. The registry itself is just a dshash table that stores > the

micro-optimizing json.c

2023-12-07 Thread Nathan Bossart
Moving this to a new thread... On Thu, Dec 07, 2023 at 07:15:28AM -0500, Joe Conway wrote: > On 12/6/23 21:56, Nathan Bossart wrote: >> On Wed, Dec 06, 2023 at 03:20:46PM -0500, Tom Lane wrote: >> > If Nathan's perf results hold up elsewhere, it seems like some >> > micro-optimization around the

Re: Synchronizing slots from primary to standby

2023-12-07 Thread shveta malik
On Thu, Dec 7, 2023 at 2:57 PM Drouvot, Bertrand wrote: > > Hi, > > On 12/7/23 10:07 AM, shveta malik wrote: > > On Thu, Dec 7, 2023 at 1:19 PM Drouvot, Bertrand > > wrote: > >> Might be worth to add comments in the code (around the WalRcv->latestWalEnd > >> checks) that no "lagging" sync are

Re: micro-optimizing json.c

2023-12-07 Thread John Naylor
On Fri, Dec 8, 2023 at 10:32 AM Nathan Bossart wrote: > > On Fri, Dec 08, 2023 at 04:11:52PM +1300, David Rowley wrote: > > + seplen = use_line_feeds ? sizeof(",\n ") - 1 : sizeof(",") - 1; > > > > Most modern compilers will be fine with just: > > > > seplen = strlen(sep); > > > > I had to go

Re: micro-optimizing json.c

2023-12-07 Thread Jeff Davis
On Thu, 2023-12-07 at 17:12 -0600, Nathan Bossart wrote: > Here's a patch that removes a couple of strlen() calls that showed up > prominently in perf for a COPY TO (FORMAT json) on 110M integers.  On > my > laptop, I see a 20% speedup from ~23.6s to ~18.9s for this test. Nice improvement. The

Re: micro-optimizing json.c

2023-12-07 Thread Tom Lane
Jeff Davis writes: > Nice improvement. The use of (len = ...) in a conditional is slightly > out of the ordinary, but it makes the conditionals a bit simpler and > you have a comment, so it's fine with me. Yeah. It's a little not per project style, but I don't see a nice way to do it

Re: Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'

2023-12-07 Thread Andrei Lepikhov
On 28/11/2023 01:37, Alexander Korotkov wrote: On Mon, Nov 27, 2023 at 8:07 PM Andres Freund wrote: Sorry for the late answer, I missed this thread because of vacation. On 2023-11-27 11:29:48 +0530, Ashutosh Bapat wrote: How do we ensure that we are not making unnecessary copies of

Re: Memory consumed by paths during partitionwise join planning

2023-12-07 Thread Ashutosh Bapat
On Thu, Dec 7, 2023 at 6:19 PM David Rowley wrote: > > On Fri, 1 Dec 2023 at 19:59, Ashutosh Bapat > wrote: > > I am fine to work on this further if the community thinks it is > > acceptable. It seems from your point of view the worth of this work is > > as follows > > a. memory savings - not

Re: micro-optimizing json.c

2023-12-07 Thread David Rowley
On Fri, 8 Dec 2023 at 12:13, Nathan Bossart wrote: > Here's a patch that removes a couple of strlen() calls that showed up > prominently in perf for a COPY TO (FORMAT json) on 110M integers. On my > laptop, I see a 20% speedup from ~23.6s to ~18.9s for this test. + seplen = use_line_feeds ?

Re: UBSan pointer overflow in xlogreader.c

2023-12-07 Thread Thomas Munro
On Fri, Dec 8, 2023 at 3:57 AM Robert Haas wrote: > On Tue, Dec 5, 2023 at 4:01 PM Nathan Bossart > wrote: > > +1 > > So, Thomas ... any chance you could commit this? So that my patch > stops making cfbot sad? Done. Thanks both for the reviews.

Re: micro-optimizing json.c

2023-12-07 Thread Tom Lane
David Rowley writes: > I might be neater to get rid of the if condition and have: > [ calls of appendBinaryStringInfo with len 0 ] Hmm, if we are trying to micro-optimize, I seriously doubt that that's an improvement. regards, tom lane

Re: micro-optimizing json.c

2023-12-07 Thread Nathan Bossart
On Thu, Dec 07, 2023 at 07:40:30PM -0500, Tom Lane wrote: > Hmm ... I think that might not be the way to think about it. What > I'm wondering is why we need a test as expensive as IsValidJsonNumber > in the first place, given that we know this is a numeric data type's > output. ISTM we only need

Re: micro-optimizing json.c

2023-12-07 Thread Tom Lane
Nathan Bossart writes: > I did both of these in v2, although I opted to test that the first > character after the optional '-' was a digit instead of testing that it was > _not_ an 'I' or 'N'. Yeah, I thought about that too after sending my message. This version LGTM, although maybe the comment

Re: micro-optimizing json.c

2023-12-07 Thread Nathan Bossart
On Fri, Dec 08, 2023 at 04:11:52PM +1300, David Rowley wrote: > + seplen = use_line_feeds ? sizeof(",\n ") - 1 : sizeof(",") - 1; > > Most modern compilers will be fine with just: > > seplen = strlen(sep); > > I had to go back to clang 3.4.1 and GCC 4.1.2 to see the strlen() call > with that

Re: micro-optimizing json.c

2023-12-07 Thread Nathan Bossart
On Thu, Dec 07, 2023 at 10:28:50PM -0500, Tom Lane wrote: > Nathan Bossart writes: >> I did both of these in v2, although I opted to test that the first >> character after the optional '-' was a digit instead of testing that it was >> _not_ an 'I' or 'N'. > > Yeah, I thought about that too after

Re: GUC names in messages

2023-12-07 Thread Peter Smith
On Fri, Dec 1, 2023 at 7:38 AM Peter Eisentraut wrote: > > On 30.11.23 06:59, Michael Paquier wrote: > > ereport(elevel, > > (errcode(ERRCODE_UNDEFINED_OBJECT), > > - errmsg("unrecognized

Re: micro-optimizing json.c

2023-12-07 Thread Tom Lane
Nathan Bossart writes: > On Thu, Dec 07, 2023 at 10:28:50PM -0500, Tom Lane wrote: >> Yeah, I thought about that too after sending my message. This version >> LGTM, although maybe the comment could be slightly more verbose with >> explicit reference to Inf/NaN as being the cases we need to

Re: Synchronizing slots from primary to standby

2023-12-07 Thread Peter Smith
Hi. Here is another review comment for the patch v43-0001. == src/bin/pg_dump/pg_dump.c 1. getSubscriptions + if (fout->remoteVersion >= 17) + appendPQExpBufferStr(query, + " subfailoverstate\n"); + else + appendPQExpBuffer(query, + " '%c' AS subfailoverstate\n", +

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

2023-12-07 Thread Masahiko Sawada
On Wed, Dec 6, 2023 at 3:39 PM John Naylor wrote: > > On Wed, Dec 6, 2023 at 4:34 AM Masahiko Sawada wrote: > > > > On Mon, Dec 4, 2023 at 5:21 PM John Naylor wrote: > > > > > Given variable-length value support, RT_GET() would have to do > > > > repalloc() if the existing value size is not big

Re: [HACKERS] psql casts aspersions on server reliability

2023-12-07 Thread Bruce Momjian
On Fri, Nov 24, 2023 at 10:19:29AM -0500, Bruce Momjian wrote: > On Fri, Nov 24, 2023 at 04:06:22AM +0100, Laurenz Albe wrote: > > On Thu, 2023-11-23 at 11:12 -0500, Bruce Momjian wrote: > > > On Wed, Nov 22, 2023 at 10:25:14PM -0500, Bruce Momjian wrote: > > > > Yes, you are correct. Here is a

Re: postgres_fdw test timeouts

2023-12-07 Thread Nathan Bossart
On Fri, Dec 08, 2023 at 09:55:58AM +1300, Thomas Munro wrote: > Oh, wow. Nice detective work! Thank you for figuring that out. +1 > Now we have the question of whether to go forwards (commit the "socket > table" thing), or backwards (revert 04a09ee for now to clear the CI > failures). I don't

Re: Test 002_pg_upgrade fails with olddump on Windows

2023-12-07 Thread Michael Paquier
On Thu, Dec 07, 2023 at 05:44:53PM +0900, Michael Paquier wrote: > Hmm. Yes, it looks like you're right here. That should allow all the > scenarios we expect to work to update the paths for the functions. And done this one as well down to v15, where not only meson, but also vpath could have

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

2023-12-07 Thread Masahiko Sawada
On Thu, Dec 7, 2023 at 12:27 PM John Naylor wrote: > > On Mon, Nov 27, 2023 at 1:45 PM Masahiko Sawada wrote: > > > > On Sat, Oct 28, 2023 at 5:56 PM John Naylor wrote: > > > bool > > RT_SET(RT_RADIX_TREE *tree, uint64 key, RT_VALUE_TYPE *value_p); > > or for variable-length value support, > >

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Junwang Zhao
On Fri, Dec 8, 2023 at 3:27 AM Masahiko Sawada wrote: > > On Fri, Dec 8, 2023 at 1:39 AM Andrew Dunstan wrote: > > > > > > On 2023-12-07 Th 03:37, Junwang Zhao wrote: > > > > > > The point of this refactor (from my view) is to make it possible to add > > > new > > > copy handlers in extensions,

Re: Synchronizing slots from primary to standby

2023-12-07 Thread Peter Smith
Hi. Here are my review comments for patch v43-0002. == Commit message 1. The nap time of worker is tuned according to the activity on the primary. The worker starts with nap time of 10ms and if no activity is observed on the primary for some time, then nap time is increased to 10sec. And if

Re: Something seems weird inside tts_virtual_copyslot()

2023-12-07 Thread David Rowley
On Fri, 1 Dec 2023 at 14:30, David Rowley wrote: > > On Fri, 1 Dec 2023 at 13:14, Andres Freund wrote: > > So I think adding an assert to ExecCopySlot(), perhaps with a comment saying > > that the restriction could be lifted with a bit of work, would be fine. > > How about the attached? I wrote

Re: Wrong results with grouping sets

2023-12-07 Thread Richard Guo
On Mon, Sep 25, 2023 at 3:11 PM Richard Guo wrote: > If the grouping expression is a Var or PHV, we can just set its > nullingrels, very straightforward. For an expression that is neither a > Var nor a PHV, I'm not quite sure how to set the nullingrels. I tried > the idea of wrapping it in a

Re: remaining sql/json patches

2023-12-07 Thread Peter Eisentraut
Here are a couple of small patches to tidy up the parser a bit in your v28-0004 (JSON_TABLE) patch. It's not a lot; the rest looks okay to me. (I don't have an opinion on the concurrent discussion on resolving some precedence issues.) From 0dc7e7852702272f0bf12aaa4b56b9ac60c4d969 Mon Sep 17

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Junwang Zhao
On Thu, Dec 7, 2023 at 8:39 AM Michael Paquier wrote: > > On Wed, Dec 06, 2023 at 10:07:51PM +0800, Junwang Zhao wrote: > > I read the thread[1] you posted and I think Andres's suggestion sounds > > great. > > > > Should we extract both *copy to* and *copy from* for the first step, in that > >

Re: Test 002_pg_upgrade fails with olddump on Windows

2023-12-07 Thread Michael Paquier
On Wed, Dec 06, 2023 at 11:00:01AM +0300, Alexander Lakhin wrote: > So it looks like >     my $newregresssrc = "$srcdir/src/test/regress"; > is incorrect for meson. > Maybe it should be?: >     my $newregresssrc = dirname($ENV{REGRESS_SHLIB}); > (With this line the test passes for me on Windows

Re: Synchronizing slots from primary to standby

2023-12-07 Thread Drouvot, Bertrand
Hi, On 12/7/23 10:07 AM, shveta malik wrote: On Thu, Dec 7, 2023 at 1:19 PM Drouvot, Bertrand wrote: Might be worth to add comments in the code (around the WalRcv->latestWalEnd checks) that no "lagging" sync are possible if the walreceiver is not started though? I am a bit confused. Do you

Re: backtrace_on_internal_error

2023-12-07 Thread Peter Eisentraut
On 05.12.23 11:55, Peter Eisentraut wrote: I think the implementation would be very simple, something like diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 6aeb855e49..45d40abe92 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c

Re: Proposal to add page headers to SLRU pages

2023-12-07 Thread Andrey M. Borodin
Hi Yong! +1 to the idea to protect SLRUs from corruption. I'm slightly leaning towards the idea of separating checksums from data pages, but anyway this checksums are better than no checksums. > On 7 Dec 2023, at 10:06, Li, Yong wrote: > > I am still working on patching the pg_upgrade. Just

Re: remaining sql/json patches

2023-12-07 Thread Erik Rijkers
echoing - seemed best to leave it in. (I'm using patch; should be all right, no? Am I doing it wrong?) -- [2023.12.07 11:29:39 json_table2] patch 1 of 5 (json_table2) [/home/aardvark/download/pgpatches/0170/json_table/20231207/v29-0001-Add-soft-error-handling-to-some-expression-nodes.patch] rv

Re: remaining sql/json patches

2023-12-07 Thread Alvaro Herrera
On 2023-Dec-07, Erik Rijkers wrote: > Hm, this set doesn't apply for me. 0003 gives error, see below (sorrty for > my interspersed bash echoing - seemed best to leave it in. > (I'm using patch; should be all right, no? Am I doing it wrong?) There's definitely something wrong with the patch file;

Removing const-false IS NULL quals and redundant IS NOT NULL quals

2023-12-07 Thread David Rowley
(Moving discussion from -bugs [1] to -hackers for more visibility.) Background: This started out as a performance fix for bug #17540 but has now extended beyond that as fixing that only requires we don't add redundant IS NOT NULL quals to Min/Max aggregate rewrites. The attached gets rid of all

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

2023-12-07 Thread Bharath Rupireddy
On Mon, Nov 13, 2023 at 7:02 PM Bharath Rupireddy wrote: > > On Fri, Nov 10, 2023 at 2:28 AM Andres Freund wrote: > > > I think the code needs to make sure that *never* happens. That seems > > unrelated > > to holding or not holding WALBufMappingLock. Even if the page header is > > already

Re: Reducing output size of nodeToString

2023-12-07 Thread Matthias van de Meent
On Thu, 7 Dec 2023 at 11:26, Peter Eisentraut wrote: > > On 06.12.23 22:08, Matthias van de Meent wrote: > > PFA a patch that reduces the output size of nodeToString by 50%+ in > > most cases (measured on pg_rewrite), which on my system reduces the > > total size of pg_rewrite by 33% to 472KiB.

Re: Is WAL_DEBUG related code still relevant today?

2023-12-07 Thread Bharath Rupireddy
On Mon, Dec 4, 2023 at 12:37 AM Noah Misch wrote: > > On Sun, Dec 03, 2023 at 08:30:24PM +0530, Bharath Rupireddy wrote: > > On Sun, Dec 3, 2023 at 4:00 AM Nathan Bossart > > wrote: > > > On Sat, Dec 02, 2023 at 07:36:29PM +0530, Bharath Rupireddy wrote: > > > > b) Remove both the WAL_DEBUG

Re: pg_upgrade and logical replication

2023-12-07 Thread vignesh C
On Thu, 7 Dec 2023 at 07:20, Masahiko Sawada wrote: > > On Mon, Dec 4, 2023 at 8:01 PM Amit Kapila wrote: > > > > On Fri, Dec 1, 2023 at 11:24 PM vignesh C wrote: > > > > > > The attached v22 version patch has the changes for the same. > > > > > > > I have made minor changes in the comments and

Re: Synchronizing slots from primary to standby

2023-12-07 Thread shveta malik
On Thu, Dec 7, 2023 at 1:19 PM Drouvot, Bertrand wrote: > > Hi, > > On 12/6/23 11:58 AM, shveta malik wrote: > > On Wed, Dec 6, 2023 at 3:00 PM Drouvot, Bertrand > > wrote: > >> > >> Hi, > >> > >> On 12/6/23 7:18 AM, shveta malik wrote: > >>> On Wed, Dec 6, 2023 at 10:56 AM Amit Kapila > >>>

Reduce useless changes before reassembly during logical replication

2023-12-07 Thread li jie
Hi hackers, During logical replication, if there is a large write transaction, some spill files will be written to disk, depending on the setting of logical_decoding_work_mem. This behavior can effectively avoid OOM, but if the transaction generates a lot of change before commit, a large number

Re: pg_upgrade and logical replication

2023-12-07 Thread vignesh C
On Tue, 5 Dec 2023 at 10:56, Michael Paquier wrote: > > On Mon, Dec 04, 2023 at 04:30:49PM +0530, Amit Kapila wrote: > > I have made minor changes in the comments and code at various places. > > See and let me know if you are not happy with the changes. I think > > unless there are more

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Junwang Zhao
On Thu, Dec 7, 2023 at 1:05 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Wed, 6 Dec 2023 22:07:51 +0800, > Junwang Zhao wrote: > > > Should we extract both *copy to* and *copy from* for the first step, in that > >

Re: postgres_fdw test timeouts

2023-12-07 Thread Alexander Lakhin
Hello Thomas, 03.12.2023 09:00, Thomas Munro wrote: On Sun, Dec 3, 2023 at 6:00 PM Alexander Lakhin wrote: I've managed to reproduce the failure locally when running postgres_fdw_x/ regress in parallel (--num-processes 10). It reproduced for me on on 04a09ee94 (iterations 1, 2, 4), but not on

Configure problem when cross-compiling PostgreSQL 16.1

2023-12-07 Thread Dominik Michael Rauh
Hi all, I was trying to cross-compile PostgreSQL 16.1 using Buildroot which worked fine until I executed "initdb" on my target device, where I faced the following error: 2023-12-06 07:10:18.568 UTC [31] FATAL: could not load library "/usr/lib/postgresql/dict_snowball.so":

Re: Reducing output size of nodeToString

2023-12-07 Thread Peter Eisentraut
On 06.12.23 22:08, Matthias van de Meent wrote: PFA a patch that reduces the output size of nodeToString by 50%+ in most cases (measured on pg_rewrite), which on my system reduces the total size of pg_rewrite by 33% to 472KiB. This does keep the textual pg_node_tree format alive, but reduces its

Re: Transaction timeout

2023-12-07 Thread 邱宇航
Hi, I read the V6 patch and found something needs to be improved. Prepared transactions should also be documented. A value of zero (the default) disables the timeout. +This timeout is not applied to prepared transactions. Only transactions +with user connections are

Re: remaining sql/json patches

2023-12-07 Thread jian he
two JsonCoercionState in src/tools/pgindent/typedefs.list. +JsonCoercionState JsonConstructorExpr JsonConstructorExprState JsonConstructorType JsonEncoding +JsonExpr +JsonExprOp +JsonExprPostEvalState +JsonExprState +JsonCoercionState + post_eval->jump_eval_coercion =

Re: Emitting JSON to file using COPY TO

2023-12-07 Thread Daniel Verite
Joe Conway wrote: > The attached should fix the CopyOut response to say one column. I.e. it > ought to look something like: Spending more time with the doc I came to the opinion that in this bit of the protocol, in CopyOutResponse (B) ... Int16 The number of columns in the data to be

Re: Emitting JSON to file using COPY TO

2023-12-07 Thread Joe Conway
On 12/7/23 08:35, Daniel Verite wrote: Joe Conway wrote: The attached should fix the CopyOut response to say one column. I.e. it ought to look something like: Spending more time with the doc I came to the opinion that in this bit of the protocol, in CopyOutResponse (B) ... Int16 The

Re: Emitting JSON to file using COPY TO

2023-12-07 Thread Joe Conway
On 12/7/23 08:52, Joe Conway wrote: Or maybe this is preferred? 8<-- [{"ss":{"f1":1,"f2":1}}, {"ss":{"f1":1,"f2":2}}, {"ss":{"f1":1,"f2":3}}] 8<-- I don't know why my mail client keeps adding extra spaces, but the intention here is a single space in front

Re: initdb caching during tests

2023-12-07 Thread Daniel Gustafsson
> On 7 Dec 2023, at 14:50, Matthias van de Meent > wrote: > Attached a patch that fixes this for both make and meson, by adding > --no-clean to the initdb template. Makes sense. While in there I think we should rename -N to the long optoin --no-sync to make it easier to grep for and make the

Re: Proposal to add page headers to SLRU pages

2023-12-07 Thread Aleksander Alekseev
Hi, > +1 to the idea to protect SLRUs from corruption. I'm slightly leaning towards > the idea of separating checksums from data pages, but anyway this checksums > are better than no checksums. > > On 7 Dec 2023, at 10:06, Li, Yong wrote: > > I am still working on patching the pg_upgrade.

Re: backtrace_on_internal_error

2023-12-07 Thread Tom Lane
Peter Eisentraut writes: > Something else to note: I wrote the above code to check the error code; > it doesn't check whether the original code write elog() or ereport(). > There are some internal errors that are written as ereport() now. > Others might be changed from time to time; until now

Re: initdb caching during tests

2023-12-07 Thread Matthias van de Meent
On Thu, 7 Dec 2023 at 15:06, Daniel Gustafsson wrote: > > > On 7 Dec 2023, at 14:50, Matthias van de Meent > > wrote: > > > Attached a patch that fixes this for both make and meson, by adding > > --no-clean to the initdb template. > > Makes sense. While in there I think we should rename -N to

Re: trying again to get incremental backup

2023-12-07 Thread Jakub Wartak
On Tue, Dec 5, 2023 at 7:11 PM Robert Haas wrote: [..v13 patchset] The results with v13 patchset are following: * - requires checkpoint on primary when doing incremental on standby when it's too idle, this was explained by Robert in [1], something AKA too-fast-incremental backup due to

Re: Emitting JSON to file using COPY TO

2023-12-07 Thread David G. Johnston
On Thursday, December 7, 2023, Daniel Verite wrote: > Joe Conway wrote: > > > The attached should fix the CopyOut response to say one column. I.e. it > > ought to look something like: > > Spending more time with the doc I came to the opinion that in this bit > of the protocol, in

Re: initdb caching during tests

2023-12-07 Thread Matthias van de Meent
On Fri, 25 Aug 2023 at 00:16, Andres Freund wrote: > > Hi, > > On 2023-08-23 10:10:31 +0200, Daniel Gustafsson wrote: > > > On 23 Aug 2023, at 03:17, Andres Freund wrote: > > > On 2023-08-22 23:47:24 +0200, Daniel Gustafsson wrote: > > > > >> My only small gripe is that I keep thinking about

Re: pg_upgrade failing for 200+ million Large Objects

2023-12-07 Thread Kumar, Sachin
> I have updated the patch to use heuristic, During pg_upgrade we count > Large objects per database. During pg_restore execution if db large_objects > count is greater than LARGE_OBJECTS_THRESOLD (1k) we will use > --restore-blob-batch-size. I think both SECTION_DATA and SECTION_POST_DATA can

Re: Emitting JSON to file using COPY TO

2023-12-07 Thread David G. Johnston
On Thursday, December 7, 2023, Joe Conway wrote: > On 12/7/23 08:35, Daniel Verite wrote: > >> Joe Conway wrote: >> >> The attached should fix the CopyOut response to say one column. I.e. it >>> ought to look something like: >>> >> >> Spending more time with the doc I came to the opinion

Re: Configure problem when cross-compiling PostgreSQL 16.1

2023-12-07 Thread Tom Lane
Dominik Michael Rauh writes: > Apparently when cross-compiling the linker is automatically assumed to not > understand "--export-dynamic", leading to aforementioned problem on my end. > ... > There is also at least one additional linker flag "--as-needed" that is not > being used when

I’ve come across what I think is a bug

2023-12-07 Thread John Scalia
In the documentation, Under CREATE PUBLICATION under parameters publish (string) This parameter determines which DML operations will be published by the new publication to the subscribers. The value is comma-separated list of operations. The default is to publish all

Re: [CAUTION!! freemail] Re: Partial aggregates pushdown

2023-12-07 Thread Robert Haas
On Wed, Dec 6, 2023 at 7:11 PM fujii.y...@df.mitsubishielectric.co.jp wrote: > I would be grateful if we can resolve this issue gradually. I would also like > to continue the discussion if possible in the future. I think that would be good. Thanks for your work on this. It is a hard problem.

Re: Remove MSVC scripts from the tree

2023-12-07 Thread Alvaro Herrera
On 2023-Dec-07, Peter Eisentraut wrote: > On 06.12.23 21:52, Andrew Dunstan wrote: > > Yes, if I comment out the call to structfunc() the test passes on VS2017 > > (compiler version 19.15.26726) > > This is strange, because we use code like that in the tree. There must be > some small detail

  1   2   >