Re: Optimize duplicate code and fix memory leak in function fetch_remote_table_info()

2024-01-19 Thread Yongtao Huang
Hi, > So whatever it leaks will be released at the transaction end. I learned it. thank you very much for your explanation. Regards, Yongtao Huang Tom Lane 于2024年1月20日周六 12:34写道: > Yongtao Huang writes: > > (1) I think *pfree(pub_names.data)* is necessary. > > Really? > > It looks to me

Re: Change GUC hashtable to use simplehash?

2024-01-19 Thread John Naylor
On Sat, Jan 20, 2024 at 7:13 AM Jeff Davis wrote: > > On Fri, 2024-01-19 at 13:38 -0800, Jeff Davis wrote: > > One post-commit question on 0aba255440: why do > > haszero64(pg_bswap64(chunk)) rather than just haszero64(chunk)? How > > does byteswapping affect whether a zero byte exists or not? > >

Re: Change GUC hashtable to use simplehash?

2024-01-19 Thread John Naylor
On Fri, Jan 19, 2024 at 11:54 PM Heikki Linnakangas wrote: > Thanks! I started to look at how to use this, and I have some questions. > I'd like to replace this murmurhash ussage in resowner.c with this: > > > /* > >* Most resource kinds store a pointer in 'value', and pointers are

Re: Synchronizing slots from primary to standby

2024-01-19 Thread Dilip Kumar
On Fri, Jan 19, 2024 at 5:24 PM Amit Kapila wrote: > > On Wed, Jan 17, 2024 at 4:00 PM shveta malik wrote: > > > > I had some off-list discussions with Sawada-San, Hou-San, and Shveta > on the topic of extending replication commands instead of using the > current model where we fetch the

Re: Optimize duplicate code and fix memory leak in function fetch_remote_table_info()

2024-01-19 Thread Tom Lane
Yongtao Huang writes: > (1) I think *pfree(pub_names.data)* is necessary. Really? It looks to me like copy_table, and thence fetch_remote_table_info, is called once within a transaction. So whatever it leaks will be released at transaction end. This is a good thing, because it's messy enough

Re: Optimize duplicate code and fix memory leak in function fetch_remote_table_info()

2024-01-19 Thread Yongtao Huang
Thanks for your review. (1) I think *pfree(pub_names.data)* is necessary. (2) Agree with you. Considering that the new function is only called twice, not encapsulating it into a function is not a huge problem. Best wishes Yongtao Huang Michael Paquier 于2024年1月20日周六 11:13写道: > On Fri, Jan

Re: Prefetch the next tuple's memory during seqscans

2024-01-19 Thread vignesh C
On Mon, 10 Jul 2023 at 15:04, Daniel Gustafsson wrote: > > > On 10 Jul 2023, at 11:32, Daniel Gustafsson wrote: > > > >> On 4 Apr 2023, at 06:50, David Rowley wrote: > > > >> Updated patches attached. > > > > This patch is marked Waiting on Author, but from the thread it seems Needs > > Review

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2024-01-19 Thread vignesh C
On Mon, 20 Feb 2023 at 16:06, David Geier wrote: > > Hi! > > On 2/14/23 13:48, David Geier wrote: > > > > It still fails. > > > > I'll get Cirrus-CI working on my own Github fork so I can make sure it > > really compiles on all platforms before I submit a new version. > > It took some time until

Re: MultiXact\SLRU buffers configuration

2024-01-19 Thread vignesh C
On Mon, 9 Jan 2023 at 09:49, Andrey Borodin wrote: > > On Tue, Jan 3, 2023 at 5:02 AM vignesh C wrote: > > does not apply on top of HEAD as in [1], please post a rebased patch: > > > Thanks! Here's the rebase. I'm seeing that there has been no activity in this thread for more than 1 year now,

Re: Optimize duplicate code and fix memory leak in function fetch_remote_table_info()

2024-01-19 Thread Michael Paquier
On Fri, Jan 19, 2024 at 10:42:46PM +0800, Yongtao Huang wrote: > This patch fixes two things in the function fetch_remote_table_info(). > > (1) *pfree(pub_names.data)* to avoid potential memory leaks. True that this code puts some effort in cleaning up the memory used locally. > (2) 2 pieces of

Re: fix stats_fetch_consistency value in postgresql.conf.sample

2024-01-19 Thread Michael Paquier
On Sat, Jan 20, 2024 at 07:59:22AM +0530, vignesh C wrote: > I'm seeing that there has been no activity in this thread for more > than 8 months, I'm planning to close this in the current commitfest > unless someone is planning to take it forward. Thanks, that seems right to me. I have been

Re: add function argument names to regex* functions.

2024-01-19 Thread jian he
On Sat, Jan 20, 2024 at 10:55 AM jian he wrote: > > > another regex* function argument changes: from "N" to "occurences", example: > + If occurrence is specified > + then the occurrence'th match of the pattern > + is located, > > but [2] says > Speaking of the "occurrence'th >

Re: add function argument names to regex* functions.

2024-01-19 Thread jian he
On Thu, Jan 18, 2024 at 4:17 PM Peter Eisentraut wrote: > > On 10.01.24 15:18, jian he wrote: > > I put the changes into the new patch. > > Reading back through the discussion, I wasn't quite able to interpret > the resolution regarding Oracle compatibility. From the patch, it looks > like you

Re: Re: Patch: Improve Boolean Predicate JSON Path Docs

2024-01-19 Thread Erik Wienhold
On 2024-01-19 22:15 +0100, Tom Lane wrote: > "David E. Wheeler" writes: > > [ v7-0001-Improve-boolean-predicate-JSON-Path-docs.patch ] > > + \set json '{ >"track": { > "segments": [ >{ > > I find the textual change rather unwieldy, but the bigger problem is > that this example

Re: Amcheck verification of GiST and GIN

2024-01-19 Thread vignesh C
On Mon, 27 Mar 2023 at 03:47, Andrey Borodin wrote: > > On Sun, Mar 19, 2023 at 4:00 PM Andrey Borodin wrote: > > > > Also, there are INCLUDEd attributes. Right now we just put them as-is > > to the bloom filter. Does this constitute a TOAST bug as in B-tree? > > If so, I think we should use a

Re: Inconsistency in reporting checkpointer stats

2024-01-19 Thread vignesh C
On Sun, 19 Feb 2023 at 15:28, Nitin Jadhav wrote: > > > This doesn't pass the tests, because the regression tests weren't adjusted: > > https://api.cirrus-ci.com/v1/artifact/task/5937624817336320/testrun/build/testrun/regress/regress/regression.diffs > > Thanks for sharing this. I have fixed this

Re: Make documentation builds reproducible

2024-01-19 Thread vignesh C
On Fri, 25 Aug 2023 at 01:23, Tristan Partin wrote: > > On Thu Aug 24, 2023 at 2:30 PM CDT, Tom Lane wrote: > > "Tristan Partin" writes: > > > On Wed Aug 23, 2023 at 2:24 PM CDT, Peter Eisentraut wrote: > > >> Somewhere at PGCon, I forgot exactly where, maybe in the same meeting > > >> where we

Re: fix stats_fetch_consistency value in postgresql.conf.sample

2024-01-19 Thread vignesh C
On Wed, 10 May 2023 at 06:07, Justin Pryzby wrote: > > On Wed, Mar 29, 2023 at 11:03:59PM -0500, Justin Pryzby wrote: > > On Wed, Jul 13, 2022 at 04:49:00PM -0700, Andres Freund wrote: > > > On 2022-07-14 08:46:02 +0900, Michael Paquier wrote: > > > > On Wed, Jul 13, 2022 at 12:30:00PM -0500,

Re: Dump-restore loosing 'attnotnull' bit for DEFERRABLE PRIMARY KEY column(s).

2024-01-19 Thread vignesh C
On Fri, 22 Sept 2023 at 18:45, Amul Sul wrote: > > > > On Wed, Sep 20, 2023 at 8:29 PM Alvaro Herrera > wrote: >> >> On 2023-Sep-20, Amul Sul wrote: >> >> > On the latest master head, I can see a $subject bug that seems to be >> > related >> > commit #b0e96f311985: >> > >> > Here is the table

Re: Collation version tracking for macOS

2024-01-19 Thread vignesh C
On Sat, 21 Jan 2023 at 02:24, Jeff Davis wrote: > > On Thu, 2023-01-19 at 00:11 -0800, Jeff Davis wrote: > > Attached are a new set of patches, including a major enhancement: the > > icu_multilib contrib module. > > Attached rebased v8. > > [ It looks like my email client truncated the last email

Re: Lockless queue of waiters in LWLock

2024-01-19 Thread vignesh C
On Sat, 26 Nov 2022 at 00:24, Pavel Borisov wrote: > > Hi, hackers! > In the measurements above in the thread, I've been using LIFO wake > queue in a primary lockless patch (and it was attached as the previous > versions of a patch) and an "inverted wake queue" (in faсt FIFO) as > the alternative

Re: Documentation for building with meson

2024-01-19 Thread vignesh C
On Wed, 29 Mar 2023 at 00:57, samay sharma wrote: > > Hi, > > On Wed, Mar 15, 2023 at 4:28 AM Peter Eisentraut > wrote: >> >> > [PATCH v8 1/5] Make minor additions and corrections to meson docs >> >> The last hunk revealed that there is some mixing up between meson setup >> and meson

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

2024-01-19 Thread Jeff Davis
On Wed, 2024-01-10 at 19:59 +0530, Bharath Rupireddy wrote: > I've addressed the above review comments and attached v19 patch-set. Regarding: - if (!WALRead(state, cur_page, targetPagePtr, XLOG_BLCKSZ, tli, -)) + if (!WALRead(state, cur_page,

Re: Change GUC hashtable to use simplehash?

2024-01-19 Thread Jeff Davis
On Fri, 2024-01-19 at 13:38 -0800, Jeff Davis wrote: > One post-commit question on 0aba255440: why do > haszero64(pg_bswap64(chunk)) rather than just haszero64(chunk)? How > does byteswapping affect whether a zero byte exists or not? I missed that it was used later when finding the rightmost one

Re: Oom on temp (un-analyzed table caused by JIT) V16.1 [Fixed Already]

2024-01-19 Thread Daniel Gustafsson
> On 19 Jan 2024, at 23:09, Kirk Wolak wrote: > From a FUTURE email, I noticed pg_jit_available() and it's set to f?? Right, then this installation does not contain the necessary library to JIT compile the query. > Okay, so does this require a special BUILD command? Yes, it requires that you

Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan

2024-01-19 Thread Peter Geoghegan
On Thu, Jan 18, 2024 at 11:39 AM Matthias van de Meent wrote: > > I'm not going to break out the planner changes, because they're *not* > > independent in any way. > > The planner changes depend on the btree changes, that I agree with. > However, I don't think that the btree changes depend on the

Re: [DOC] Add detail regarding resource consumption wrt max_connections

2024-01-19 Thread reid . thompson
On Sat, 2024-01-13 at 10:31 -0700, Roberto Mello wrote: > On Fri, Jan 12, 2024 at 3:15 PM Cary Huang > wrote: > > I think it is good to warn the user about the increased allocation > > of memory for certain parameters so that they do not abuse it by > > setting it to a huge number without knowing

Re: index prefetching

2024-01-19 Thread Tomas Vondra
On 1/19/24 16:19, Konstantin Knizhnik wrote: > > On 18/01/2024 5:57 pm, Tomas Vondra wrote: >> On 1/16/24 21:10, Konstantin Knizhnik wrote: >>> ... >>> 4. I think that performing prefetch at executor level is really great > idea and so prefetch can be used by all indexes, including

Re: Oom on temp (un-analyzed table caused by JIT) V16.1 [Fixed Already]

2024-01-19 Thread Kirk Wolak
On Fri, Jan 19, 2024 at 4:20 AM Laurenz Albe wrote: > On Thu, 2024-01-18 at 19:50 -0500, Kirk Wolak wrote: > > I did a little more checking and the reason I did not see the link > MIGHT be because EXPLAIN did not show a JIT attempt. > > I tried to use settings that FORCE a JIT... But to no

cleanup patches for dshash

2024-01-19 Thread Nathan Bossart
While working on the dynamic shared memory registry, I noticed a couple of potential improvements for code that uses dshash tables. * A couple of dshash_create() callers pass in 0 for the "void *arg" parameter, which seemed weird. I incorrectly assumed this was some sort of flags parameter

Re: index prefetching

2024-01-19 Thread Melanie Plageman
On Fri, Jan 12, 2024 at 11:42 AM Tomas Vondra wrote: > > On 1/9/24 21:31, Robert Haas wrote: > > On Thu, Jan 4, 2024 at 9:55 AM Tomas Vondra > > wrote: > >> Here's a somewhat reworked version of the patch. My initial goal was to > >> see if it could adopt the StreamingRead API proposed in [1],

Re: Change GUC hashtable to use simplehash?

2024-01-19 Thread Jeff Davis
On Fri, 2024-01-19 at 14:27 +0700, John Naylor wrote: > Pushed that way, thanks! Thank you. One post-commit question on 0aba255440: why do haszero64(pg_bswap64(chunk)) rather than just haszero64(chunk)? How does byteswapping affect whether a zero byte exists or not? Regards, Jeff Davis

Re: Patch: Improve Boolean Predicate JSON Path Docs

2024-01-19 Thread Tom Lane
I wrote: > I experimented with > SELECT ' > ... multiline json value ... > ' AS json > \gexec > but that didn't seem to work either. Anybody have a better idea? Oh, never mind, \gset is what I was reaching for. We can make it work with that. regards, tom lane

Re: Patch: Improve Boolean Predicate JSON Path Docs

2024-01-19 Thread Tom Lane
"David E. Wheeler" writes: > [ v7-0001-Improve-boolean-predicate-JSON-Path-docs.patch ] I started to review this, and got bogged down at @@ -17203,9 +17214,12 @@ array w/o UK? | t For example, suppose you have some JSON data from a GPS tracker that you - would like to parse, such

Re: introduce dynamic shared memory registry

2024-01-19 Thread Nathan Bossart
On Wed, Jan 17, 2024 at 08:00:00AM +0530, Bharath Rupireddy wrote: > The v8 patches look good to me. Committed. Thanks everyone for reviewing! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

GUC-ify walsender MAX_SEND_SIZE constant

2024-01-19 Thread Majid Garoosi
Hello all, Following the threads here and there , I decided to submit this patch. Following is the description which is also

Improving EXPLAIN's display of SubPlan nodes

2024-01-19 Thread Tom Lane
EXPLAIN has always been really poor at displaying SubPlan nodes in expressions: you don't get much more than "(SubPlan N)". This is mostly because every time I thought about it, I despaired of trying to represent all the information in a SubPlan accurately. However, a recent discussion[1] made me

Re: PG12 change to DO UPDATE SET column references

2024-01-19 Thread David G. Johnston
On Fri, Jan 19, 2024 at 10:01 AM James Coleman wrote: > Making this more confusing is the fact that if I want to do something > like "SET bar = foo.bar + 1" the table qualification cannot be present > on the setting column but is required on the reading column. > > There isn't anything in the

Re: UUID v7

2024-01-19 Thread Andrey Borodin
> On 19 Jan 2024, at 13:25, Andrey Borodin wrote: > > Also, I've added some documentation on all functions. Here's v12. Changes: 1. Documentation improvements 2. Code comments 3. Better commit message and reviews list Best regards, Andrey Borodin. v12-0001-Implement-UUID-v7.patch

Re: reorganize "Shared Memory and LWLocks" section of docs

2024-01-19 Thread Nathan Bossart
On Wed, Jan 17, 2024 at 06:48:37AM +0530, Bharath Rupireddy wrote: > LGTM. Committed. Thanks for reviewing! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Add system identifier to backup manifest

2024-01-19 Thread Amul Sul
On Thu, Jan 18, 2024 at 6:39 AM Sravan Kumar wrote: > I have also done a review of the patch and some testing. The patch looks > good, and I agree with Robert's comments. > Thank you for your review, testing and the offline discussion. Regards, Amul

Re: Build versionless .so for Android

2024-01-19 Thread Matthias Kuhn
Thanks, This patch brought it further and indeed, the resulting libpq.so file is unversioned when built for Android while it's versioned when built for linux. Matthias On Fri, Jan 19, 2024 at 3:00 PM Peter Eisentraut wrote: > On 19.01.24 11:08, Matthias Kuhn wrote: > > When trying to build

Re: Add system identifier to backup manifest

2024-01-19 Thread Amul Sul
On Wed, Jan 17, 2024 at 8:40 PM Robert Haas wrote: > On Wed, Jan 17, 2024 at 6:31 AM Amul Sul wrote: > > With the attached patch, the backup manifest will have a new key item as > > "System-Identifier" 64-bit integer whose value is derived from > pg_control while > > generating it, and the

PG12 change to DO UPDATE SET column references

2024-01-19 Thread James Coleman
Hello, I realize this is almost ancient history at this point, but I ran into a surprising behavior change from PG11->12 with ON CONFLICT ... DO UPDATE SET ... Suppose I have this table: create table foo (id int primary key); On PG11 this works: postgres=# insert into foo (id) values (1) on

Re: Change GUC hashtable to use simplehash?

2024-01-19 Thread Heikki Linnakangas
On 19/01/2024 09:27, John Naylor wrote: Pushed that way, thanks! After fixing another typo in big endian builds, an s390x member reported green, so I think that aspect is working now. I'll come back to follow-up topics shortly. Thanks! I started to look at how to use this, and I have some

Re: initdb's -c option behaves wrong way?

2024-01-19 Thread Tom Lane
Daniel Gustafsson writes: > I'll give some more time for opinions, then I'll go ahead with one of the > patches with a backpatch to v16. OK, I take back my previous complaint that just using strncasecmp would be enough --- I was misremembering how the code worked, and you're right that it would

Re: index prefetching

2024-01-19 Thread Konstantin Knizhnik
On 18/01/2024 5:57 pm, Tomas Vondra wrote: On 1/16/24 21:10, Konstantin Knizhnik wrote: ... 4. I think that performing prefetch at executor level is really great idea and so prefetch can be used by all indexes, including custom indexes. But prefetch will be efficient only if index can

[PATCH] pg_receivewal skip WAL file size checking

2024-01-19 Thread Sergey Sergey
We have a huge amount of WAL files at backup site. A listing of the directory takes several seconds. During startup pg_receivewal checks size of all theus files. It does not check file integrity or gaps between files. It takes several hours for our setup. I have add an options that skip this file

Re: initdb's -c option behaves wrong way?

2024-01-19 Thread Daniel Gustafsson
> On 18 Jan 2024, at 05:49, Kyotaro Horiguchi wrote: > > Thank you for upicking this up. > > At Wed, 17 Jan 2024 23:47:41 +0100, Daniel Gustafsson wrote > in >>> On 17 Jan 2024, at 21:33, Tom Lane wrote: >>> >>> I wrote: However ... I don't like the patch much. It seems to have left

Optimize duplicate code and fix memory leak in function fetch_remote_table_info()

2024-01-19 Thread Yongtao Huang
This patch fixes two things in the function fetch_remote_table_info(). (1) *pfree(pub_names.data)* to avoid potential memory leaks. (2) 2 pieces of code can do the same work, ``` C foreach(lc, MySubscription->publications) { if (foreach_current_index(lc) > 0)

Re: [PATCH] Exponential backoff for auth_delay

2024-01-19 Thread Abhijit Menon-Sen
At 2024-01-19 15:08:36 +0100, mba...@gmx.net wrote: > > I wonder whether maybe auth_delay.max_seconds should either be renamed > to auth_delay.exponential_backoff_max_seconds (but then it is rather > long) in order to make it clearer it only applies in that context or > alternatively just apply to

Re: pgsql: Clean up role created in new subscription test.

2024-01-19 Thread Peter Eisentraut
On 19.01.24 15:26, Daniel Gustafsson wrote: On 18 Jan 2024, at 01:57, vignesh C wrote: There are a lot of failures in CFBot at [1] with: More details of the same are available at [2]. Do we need to clean up the objects leftover for the reported issues in the test? Not really, these

Re: Assertion failure with epoch when replaying standby records for 2PC

2024-01-19 Thread Alexander Korotkov
On Wed, Jan 17, 2024 at 11:08 PM Alexander Korotkov wrote: > On Wed, Jan 17, 2024 at 7:47 AM Michael Paquier wrote: > > rorqual has failed today with a very interesting failure: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=rorqual=2024-01-17%2005%3A06%3A31 > > > > This has caused

Re: pgsql: Clean up role created in new subscription test.

2024-01-19 Thread Daniel Gustafsson
> On 18 Jan 2024, at 01:57, vignesh C wrote: > There are a lot of failures in CFBot at [1] with: > More details of the same are available at [2]. > Do we need to clean up the objects leftover for the reported issues in the > test? Not really, these should not need cleaning up, and it's quite

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

2024-01-19 Thread torikoshia
On 2024-01-19 22:27, Alexander Korotkov wrote: Hi! On Fri, Jan 19, 2024 at 2:37 PM torikoshia wrote: Thanks for making the patch! The patch is pushed! The proposed changes are incorporated excluding this. > - /* If SAVE_ERROR_TO is specified, skip rows > with

Re: POC: GROUP BY optimization

2024-01-19 Thread Alexander Korotkov
I've done this in the revised patchset. I'm going to push this if there are no objections. -- Regards, Alexander Korotkov 0002-Explore-alternative-orderings-of-group-by-p-20240119.patch Description: Binary data 0001-Generalize-common-code-of-adding-sort-befor-20240119.patch Description: Binary data

Re: [PATCH] Exponential backoff for auth_delay

2024-01-19 Thread Michael Banck
On Fri, Jan 19, 2024 at 03:08:36PM +0100, Michael Banck wrote: > I went through your comments (a lot of which pertained to the original > larger patch I took code from), attached is a reworked version 2. Oops, we are supposed to be at version 3, attached. Michael >From

Re: [PATCH] Exponential backoff for auth_delay

2024-01-19 Thread Michael Banck
Hi, many thanks for the review! I went through your comments (a lot of which pertained to the original larger patch I took code from), attached is a reworked version 2. Other changes: 1. Ignore STATUS_EOF, this led to auth_delay being applied twice (maybe due to the gss/kerberos auth psql is

Re: generate syscache info automatically

2024-01-19 Thread Peter Eisentraut
On 19.01.24 06:28, John Naylor wrote: On Wed, Jan 17, 2024 at 7:46 PM Peter Eisentraut wrote: I updated the patch to use this style (but I swapped the first two arguments from my example, so that the thing being created is named first). I also changed the names of the output files a bit to

Re: Build versionless .so for Android

2024-01-19 Thread Peter Eisentraut
On 19.01.24 11:08, Matthias Kuhn wrote: When trying to build with meson, including the patch which was provided by Andres Freud (thanks), I am currently stuck with the following error: Configuring pg_config_ext.h using configuration

Re: BUG: Former primary node might stuck when started as a standby

2024-01-19 Thread Alexander Lakhin
Hi Aleksander, 19.01.2024 14:45, Aleksander Alekseev wrote: it might not go online, due to the error: new timeline N forked off current database system timeline M before current recovery point X/X [...] In this case, node1 wrote to it's WAL record 0/304DC68, but sent to node2 only record

Re: Use of backup_label not noted in log

2024-01-19 Thread David Steele
On 11/20/23 15:08, David Steele wrote: On 11/20/23 14:27, Andres Freund wrote: I've wondered whether it's worth also adding an explicit message just after ReachedEndOfBackup(), but it seems far less urgent due to the existing "consistent recovery state reached at %X/%X" message. I think the

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

2024-01-19 Thread Alexander Korotkov
Hi! On Fri, Jan 19, 2024 at 2:37 PM torikoshia wrote: > Thanks for making the patch! The patch is pushed! The proposed changes are incorporated excluding this. > > - /* If SAVE_ERROR_TO is specified, skip rows > > with soft errors */ > > + /* If

Re: System username in pg_stat_activity

2024-01-19 Thread Julien Rouhaud
Hi, On Thu, Jan 18, 2024 at 11:01 PM Magnus Hagander wrote: > > I did. Here it is, and also including that suggested docs fix as well > as a rebase on current master. +if (MyClientConnectionInfo.authn_id) +strlcpy(lbeentry.st_auth_identity, MyClientConnectionInfo.authn_id,

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

2024-01-19 Thread torikoshia
On 2024-01-18 23:59, jian he wrote: Hi. patch refactored based on "on_error {stop|ignore}" doc changes: --- a/doc/src/sgml/ref/copy.sgml +++ b/doc/src/sgml/ref/copy.sgml @@ -43,7 +43,7 @@ COPY { table_name [ ( column_name [, ...] ) | * } FORCE_NOT_NULL { ( column_name [, ...] ) | * }

Re: index prefetching

2024-01-19 Thread Tomas Vondra
On 1/19/24 09:34, Konstantin Knizhnik wrote: > > On 18/01/2024 6:00 pm, Tomas Vondra wrote: >> On 1/17/24 09:45, Konstantin Knizhnik wrote: >>> I have integrated your prefetch patch in Neon and it actually works! >>> Moreover, I combined it with prefetch of leaf pages for IOS and it also >>>

Re: psql JSON output format

2024-01-19 Thread Laurenz Albe
On Wed, 2024-01-17 at 14:52 -0500, Robert Haas wrote: > Let me start by clarifying that I'm OK with sacrificing > round-trippability here as long as we do it thoughtfully. Got you. > I'm not quite sure that addresses all the issues, though. For > instance, consider that 1.00::numeric and

Re: Synchronizing slots from primary to standby

2024-01-19 Thread Amit Kapila
On Wed, Jan 17, 2024 at 4:00 PM shveta malik wrote: > I had some off-list discussions with Sawada-San, Hou-San, and Shveta on the topic of extending replication commands instead of using the current model where we fetch the required slot information via SQL using a database connection. I would

Re: BUG: Former primary node might stuck when started as a standby

2024-01-19 Thread Aleksander Alekseev
Hi, > it might not go online, due to the error: > new timeline N forked off current database system timeline M before current > recovery point X/X > [...] > In this case, node1 wrote to it's WAL record 0/304DC68, but sent to node2 > only record 0/304DBF0, then node2, being promoted to primary,

Re: System username in pg_stat_activity

2024-01-19 Thread Aleksander Alekseev
Hi, > > Did you forget to share the new revision (aka v4)? I can only see the > > "reorder_parallel_worker_bestart.patch" attached. > > I did. Here it is, and also including that suggested docs fix as well > as a rebase on current master. ``` +lbeentry.st_auth_method =

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

2024-01-19 Thread John Naylor
I wrote: > On Thu, Jan 18, 2024 at 8:31 AM Masahiko Sawada wrote: > > During trying this idea, I realized that there is a visibility problem > > in the radix tree template > > If it's broken even without the embedding I'll look into this (I don't > know if this configuration has ever been

Re: Simplify documentation related to Windows builds

2024-01-19 Thread Andrew Dunstan
On 2024-01-19 Fr 04:38, Nazir Bilal Yavuz wrote: At the end, the main issue that I have with this part of the documentation is the lack of consistency leading to a confusing user experience in the builds of Windows. My recent impressions were that Andrew has picked up Chocolatey in some

Re: UUID v7

2024-01-19 Thread Aleksander Alekseev
Hi, > No. > > Timestamp and TimestampTz are absolutely the same thing. The only > difference is how they are shown to the user. TimestampTz uses session > context in order to be displayed in the TZ chosen by the user. Thus > typically it is somewhat more confusing to the users and thus I asked >

Re: Synchronizing slots from primary to standby

2024-01-19 Thread shveta malik
On Thu, Jan 18, 2024 at 4:49 PM Amit Kapila wrote: > 2. > +synchronize_one_slot(WalReceiverConn *wrconn, RemoteSlot *remote_slot) > { > ... > + LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE); > + xmin_horizon = GetOldestSafeDecodingTransactionId(true); > + SpinLockAcquire(>mutex); > +

Re: remaining sql/json patches

2024-01-19 Thread jian he
play with domain types. in ExecEvalJsonCoercion, seems func json_populate_type cannot cope with domain type. tests: drop domain test; create domain test as int[] check ( array_length(value,1) =2 and (value[1] = 1 or value[2] = 2)); SELECT * from JSON_QUERY(jsonb'{"rec": "{1,2,3}"}', '$.rec'

Re: Increasing IndexTupleData.t_info from uint16 to uint32

2024-01-19 Thread Aleksander Alekseev
Hi, > > The overall trend in machine learning embedding sizes has been growing > > rapidly over the last few years from 128 up to 4K dimensions yielding > > additional value and quality improvements. It's not clear when this trend > > in growth will ease. The leading text embedding models

Re: Synchronizing slots from primary to standby

2024-01-19 Thread shveta malik
On Fri, Jan 19, 2024 at 10:35 AM Masahiko Sawada wrote: > > > Thank you for updating the patch. I have some comments: > > --- > +latestWalEnd = GetWalRcvLatestWalEnd(); > +if (remote_slot->confirmed_lsn > latestWalEnd) > +{ > +elog(ERROR, "exiting from slot

Re: Build versionless .so for Android

2024-01-19 Thread Matthias Kuhn
Hi On Thu, Jan 18, 2024 at 9:27 AM Peter Eisentraut wrote: > On 14.01.24 12:37, Matthias Kuhn wrote: > > What I try to do is packaging an app with androiddeployqt which fails > > with an error: > > > > The bundled library lib/libpq.so.5 doesn't end with .so. Android only > > supports

Re: Oom on temp (un-analyzed table caused by JIT) V16.1 [Fixed Already]

2024-01-19 Thread Daniel Gustafsson
> On 19 Jan 2024, at 11:04, Michael Banck wrote: > > Hi, > > On Fri, Jan 19, 2024 at 10:48:12AM +0100, Daniel Gustafsson wrote: >> This does bring up an interesting point, I don't think there is a way >> for a user to know whether the server is jit enabled or not (apart >> from explaining a

Re: Oom on temp (un-analyzed table caused by JIT) V16.1 [Fixed Already]

2024-01-19 Thread Michael Banck
Hi, On Fri, Jan 19, 2024 at 10:48:12AM +0100, Daniel Gustafsson wrote: > This does bring up an interesting point, I don't think there is a way > for a user to know whether the server is jit enabled or not (apart > from explaining a query with costs adjusted but that's not all that >

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

2024-01-19 Thread John Naylor
On Fri, Jan 19, 2024 at 2:26 PM Masahiko Sawada wrote: > > On Thu, Jan 18, 2024 at 1:30 PM John Naylor wrote: > > I'm not quite sure what the point of "num_items" is anymore, because > > it was really tied to the array in VacDeadItems. dead_items->num_items > > is essential to reading/writing

Re: Oom on temp (un-analyzed table caused by JIT) V16.1 [Fixed Already]

2024-01-19 Thread Daniel Gustafsson
> On 19 Jan 2024, at 01:50, Kirk Wolak wrote: > I did a little more checking and the reason I did not see the link MIGHT be > because EXPLAIN did not show a JIT attempt. > I tried to use settings that FORCE a JIT... But to no avail. Are you sure you are running a JIT enabled server? Did

Re: Simplify documentation related to Windows builds

2024-01-19 Thread Nazir Bilal Yavuz
Hi, On Sun, 31 Dec 2023 at 09:13, Michael Paquier wrote: > > Hi all, > > As promised around thread [1] that has moved the docs related to > Windows into a new sub-section for Visual, here is a follow-up to > improve portions of its documentation, for discussion in the next CF. > > Some of my

Re: Oom on temp (un-analyzed table caused by JIT) V16.1 [Fixed Already]

2024-01-19 Thread Laurenz Albe
On Thu, 2024-01-18 at 19:50 -0500, Kirk Wolak wrote: >   I did a little more checking and the reason I did not see the link MIGHT be > because EXPLAIN did not show a JIT attempt. > I tried to use settings that FORCE a JIT...  But to no avail. > >   I am now concerned that the problem is more

Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed

2024-01-19 Thread Bertrand Drouvot
Hi, On Fri, Jan 19, 2024 at 09:00:01AM +0300, Alexander Lakhin wrote: > Hello, > > 15.01.2024 12:00, Alexander Lakhin wrote: > > If this approach looks promising to you, maybe we could add a submodule to > > perl/PostgreSQL/Test/ and use this functionality in other tests (e.g., in > >

Re: speed up a logical replica setup

2024-01-19 Thread Shubham Khanna
On Tue, Jan 16, 2024 at 11:58 AM Shubham Khanna wrote: > > On Thu, Dec 21, 2023 at 11:47 AM Amit Kapila wrote: > > > > On Wed, Dec 6, 2023 at 12:53 PM Euler Taveira wrote: > > > > > > On Thu, Nov 9, 2023, at 8:12 PM, Michael Paquier wrote: > > > > > > On Thu, Nov 09, 2023 at 03:41:53PM +0100,

Re: pgbnech: allow to cancel queries during benchmark

2024-01-19 Thread Tatsuo Ishii
>> +/* send cancel requests to all connections */ >> +static void >> +cancel_all() >> +{ >> +for (int i = 0; i < nclients; i++) >> +{ >> +char errbuf[1]; >> +if (client_states[i].cancel != NULL) >> +(void) PQcancel(client_states[i].cancel,

Re: Parent/child context relation in pg_get_backend_memory_contexts()

2024-01-19 Thread torikoshia
On 2024-01-16 18:41, Melih Mutlu wrote: Hi, Thanks for reviewing. torikoshia , 10 Oca 2024 Çar, 09:37 tarihinde şunu yazdı: + + + context_id int4 + + + Current context id. Note that the context id is a temporary id and may + change in each

Re: index prefetching

2024-01-19 Thread Konstantin Knizhnik
On 18/01/2024 6:00 pm, Tomas Vondra wrote: On 1/17/24 09:45, Konstantin Knizhnik wrote: I have integrated your prefetch patch in Neon and it actually works! Moreover, I combined it with prefetch of leaf pages for IOS and it also seems to work. Cool! And do you think this is the right

Re: UUID v7

2024-01-19 Thread Andrey Borodin
> On 19 Jan 2024, at 08:24, David G. Johnston > wrote: > > > You are mixing POSIX and ISO-8601 conventions and, as noted in our appendix, > they disagree on the direction that is positive. Thanks! Now everything seems on its place. I want to include in the patch following tests: --

Re: subscription disable_on_error not working after ALTER SUBSCRIPTION set bad conninfo

2024-01-19 Thread Masahiko Sawada
On Thu, Jan 18, 2024 at 6:54 PM Amit Kapila wrote: > > On Thu, Jan 18, 2024 at 11:15 AM Peter Smith wrote: > > > > On Thu, Jan 18, 2024 at 12:55 PM Masahiko Sawada > > wrote: > > > > > ... > > > > > > Although we can improve it to handle this case too, I'm not sure it's > > > a bug. The doc

Re: Synchronizing slots from primary to standby

2024-01-19 Thread Bertrand Drouvot
Hi, On Fri, Jan 19, 2024 at 11:46:51AM +0530, shveta malik wrote: > On Fri, Jan 19, 2024 at 11:23 AM Amit Kapila wrote: > > > > > > 5 === (coming from v62-0002) > > > > + Assert(tuplestore_tuple_count(res->tuplestore) == 1); > > > > > > > > Is it even possible for the related query to not

Re: Emitting JSON to file using COPY TO

2024-01-19 Thread Masahiko Sawada
On Thu, Dec 7, 2023 at 10:10 AM Joe Conway wrote: > > On 12/6/23 18:09, Joe Conway wrote: > > On 12/6/23 14:47, Joe Conway wrote: > >> On 12/6/23 13:59, Daniel Verite wrote: > >>> Andrew Dunstan wrote: > >>> > IMNSHO, we should produce either a single JSON > document (the ARRAY