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: 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

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: 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: 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: 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: 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: 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: [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: 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: [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: 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: 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: 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 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: 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: 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: [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: 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: 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: 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 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 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
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: 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 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: 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: [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: 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: [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: [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: 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: [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: 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: 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: 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

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: 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: 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: 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: [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: 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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: 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: remaining sql/json patches

2023-12-07 Thread Robert Haas
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 concerns that Tom mentioned at [1] > > correctly, maybe we'd be

Re: Remove MSVC scripts from the tree

2023-12-07 Thread Andres Freund
Hi, On 2023-12-04 15:11:47 -0500, Andrew Dunstan wrote: > I just had a look at shifting bowerbird to use meson, and it got stymied at > the c99 test, which apparently doesn't compile with anything less than > VS2019. What error or warning is being raised by msvc? Andres

Re: Building PosgresSQL with LLVM fails on Solaris 11.4

2023-12-07 Thread Andres Freund
Hi, On 2023-12-07 13:43:55 +, Sacha Hottinger wrote: > Thanks a lot. > It now got much further but failed here with Sun Studio: > … > gmake[2]: Leaving directory > '/opt/cnd/opt28-2_13.3_gmake_all_llvm_fixV2/src/test/perl' > gmake -C backend/jit/llvm all > gmake[2]: Entering directory >

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

2023-12-07 Thread Andrew Dunstan
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 *pg_copy_handler*, if we split TO and FROM into two sets of routines, does

Re: Is WAL_DEBUG related code still relevant today?

2023-12-07 Thread Noah Misch
On Thu, Dec 07, 2023 at 04:50:30PM +0530, Bharath Rupireddy wrote: > 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

Re: Is WAL_DEBUG related code still relevant today?

2023-12-07 Thread Robert Haas
On Thu, Dec 7, 2023 at 6:20 AM Bharath Rupireddy wrote: > I'm just curious to know what sorts of problems WAL_DEBUG code helps > debug with. Is the WAL_DEBUG code (1) or (2) or (3) that helped you > the most? Is converting the LOG messages (3) to DEBUGX level going to > help in your case? Can you

Re: trying again to get incremental backup

2023-12-07 Thread Robert Haas
On Thu, Dec 7, 2023 at 9:42 AM Jakub Wartak wrote: > Comment: I was wondering if it wouldn't make some sense to teach > pg_resetwal to actually delete all WAL summaries after any any > WAL/controlfile alteration? I thought that this was a good idea so I decided to go implement it, only to

Re: I’ve come across what I think is a bug

2023-12-07 Thread Euler Taveira
On Thu, Dec 7, 2023, at 11:39 AM, John Scalia wrote: > 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 >

Re: Emitting JSON to file using COPY TO

2023-12-07 Thread Joe Conway
On 12/7/23 09:11, David G. Johnston wrote: Those are all the same breakage though - if truly interpreted as data rows the protocol is basically written such that the array format is not supportable and only the lines format can be used.  Hence my “format 0 doesn’t work” comment for array

Re: UBSan pointer overflow in xlogreader.c

2023-12-07 Thread Robert Haas
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? -- Robert Haas EDB: http://www.enterprisedb.com

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: 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

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: 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: 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: 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

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: 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: 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: 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 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: 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: 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: 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: 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 Andrew Dunstan
On 2023-12-06 We 17:56, David G. Johnston wrote: On Wed, Dec 6, 2023 at 3:38 PM Joe Conway wrote: So the questions are: 1. Do those two formats work for the initial implementation? Yes.  We provide a stream-oriented format and one atomic-import format. 2. Is the default correct

RE: Forbid the use of invalidated physical slots in streaming replication.

2023-12-07 Thread Zhijie Hou (Fujitsu)
On Thursday, December 7, 2023 7:43 PM Ashutosh Bapat wrote: Hi, > > On Wed, Dec 6, 2023 at 6:25 PM Zhijie Hou (Fujitsu) > wrote: > > > > When testing streaming replication with a physical slot. I found an > > unexpected behavior that the walsender could use an invalidated > > physical slot

Re: Memory consumed by paths during partitionwise join planning

2023-12-07 Thread David Rowley
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 worth it > b. getting rid of !IsA(old_path, IndexPath) - worth it >

Re: Transaction timeout

2023-12-07 Thread Andrey M. Borodin
> On 7 Dec 2023, at 06:25, Japin Li wrote: > > If idle_in_transaction_timeout is bigger than transaction_timeout, > the idle-in-transaction timeout don't needed, right? Yes, I think so. > >> TODO: as Yuhang pointed out prepared transactions must not be killed, thus >> name

Re: Transaction timeout

2023-12-07 Thread Andrey M. Borodin
Thanks Yuhang!On 7 Dec 2023, at 13:39, 邱宇航 wrote:I read the V6 patch and found something needs to be improved.Fixed. PFA v7.Best regards, Andrey Borodin. v7-0001-Introduce-transaction_timeout.patch Description: Binary data

Re: Emitting JSON to file using COPY TO

2023-12-07 Thread Joe Conway
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 text-pushing (appendStringInfoString) might be more useful than caching. The 7% spent in cache lookups

Re: remaining sql/json patches

2023-12-07 Thread Amit Langote
On Thu, Dec 7, 2023 at 7:39 PM jian he wrote: > based on: > json_behavior_clause_opt: > json_behavior ON EMPTY_P > { $$ = list_make2($1, NULL); } > | json_behavior ON ERROR_P > { $$ = list_make2(NULL, $1); } > | json_behavior ON EMPTY_P json_behavior ON ERROR_P > { $$ = list_make2($1, $4); } > |

Re: Reducing output size of nodeToString

2023-12-07 Thread David Rowley
On Thu, 7 Dec 2023 at 10:09, 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

Re: Is WAL_DEBUG related code still relevant today?

2023-12-07 Thread Bharath Rupireddy
On Thu, Dec 7, 2023 at 8:10 AM Michael Paquier wrote: > > On Wed, Dec 06, 2023 at 11:32:19PM -0300, Euler Taveira wrote: > > IIUC trace_recovery_messages was a debugging aid in the 9.0 era when the HS > > was > > introduced. I'm also wondering if anyone used it in the past years. > > FWIW, I'd

Re: Forbid the use of invalidated physical slots in streaming replication.

2023-12-07 Thread Ashutosh Bapat
On Wed, Dec 6, 2023 at 6:25 PM Zhijie Hou (Fujitsu) wrote: > > Hi, > > When testing streaming replication with a physical slot. I found an unexpected > behavior that the walsender could use an invalidated physical slot for > streaming. > > This occurs when the primary slot is invalidated due to

Re: Synchronizing slots from primary to standby

2023-12-07 Thread Amit Kapila
On Wed, Dec 6, 2023 at 4:53 PM shveta malik wrote: > > v43-001: > 1) Support of 'failover' dump in pg_dump. It was missing earlier. > Review v43-0001 1. + * However, we do not enable failover for slots created by the table sync + * worker. This is because the table sync slot

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

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: 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: 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: 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

  1   2   >