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 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 quote.

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 configuration

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 memo

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 Bitmapsets

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

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 wor

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 is

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 onc

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 tha

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. > > + */ +CAT

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 wher

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 concerns

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 _f

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] E

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 cr

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

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 me

<    1   2