Re: Logical Replication of sequences

2024-07-28 Thread vignesh C
On Fri, 26 Jul 2024 at 11:46, Peter Smith wrote: > > Hi Vignesh, > > There are still pending changes from my previous review of the > 0720-0003 patch [1], but here are some new review comments for your > latest patch v20240525-0003. > 2b. > Is it better to name these returned by-ref ptrs like 'ret

Re: Logical Replication of sequences

2024-07-28 Thread vignesh C
On Fri, 26 Jul 2024 at 08:04, Peter Smith wrote: > > Here are some review comments for latest patch v20240725-0002 > > == > doc/src/sgml/ref/create_publication.sgml > > nitpick - tweak to the description of the example. > > == > src/backend/parser/gram.y > > preprocess_pub_all_objtype_list

Re: Add mention of execution time memory for enable_partitionwise_* GUCs

2024-07-28 Thread David Rowley
On Fri, 19 Jul 2024 at 17:24, Ashutosh Bapat wrote: > I am fine if we want to mention that the executor may consume a large > amount of memory when these GUCs are turned ON. Users may decide to > turn those OFF if they can not afford to spend that much memory during > execution. But I don't like t

Re: Allow logical failover slots to wait on synchronous replication

2024-07-28 Thread Bertrand Drouvot
Hi John, On Thu, Jul 18, 2024 at 02:22:08PM -0700, John H wrote: > Hi Bertrand, > > > 1 === > > ... > > That's worth additional comments in the code. > > There's this comment already about caching the value already, not sure > if you prefer something more? > > /* Cache values to reduce contenti

Re: Flush pgstats file during checkpoints

2024-07-28 Thread Bertrand Drouvot
Hi, On Tue, Jul 23, 2024 at 12:52:11PM +0900, Michael Paquier wrote: > On Mon, Jul 22, 2024 at 07:01:41AM +, Bertrand Drouvot wrote: > > 3 === > > > > + /* > > +* Read the redo LSN stored in the file. > > +*/ > > + if (!read_chunk_s(fpin, &file_redo) || > > +

Re: Conflict detection and logging in logical replication

2024-07-28 Thread Amit Kapila
On Fri, Jul 26, 2024 at 4:28 PM shveta malik wrote: > > On Fri, Jul 26, 2024 at 3:56 PM Amit Kapila wrote: > > > > > One more thing we need to consider is whether we should LOG or ERROR > > for update/delete_differ conflicts. If we LOG as the patch is doing > > then we are intentionally overwriti

dikkop failed the pg_combinebackupCheck/006_db_file_copy.pl test

2024-07-28 Thread Alexander Lakhin
Hello Tomas, Please take a look at a recent dikkop's failure [1]. The regress_log_006_db_file_copy file from that run shows: [02:08:57.929](0.014s) # initializing database system by copying initdb template ... [02:09:22.511](24.583s) ok 1 - full backup ... [02:10:35.758](73.247s) not ok 2 - incre

RE: [Proposal] Add foreign-server health checks infrastructure

2024-07-28 Thread Hayato Kuroda (Fujitsu)
Dear Fujii-san, > > IIUC, the patch which adds user_name attribute to get_connection() can be > discussed > > in later stage, is it right? > > No, let's work on the patch at this stage :) OK, here is a rebased patch. - Changed the name of new API from `GetUserMappingFromOid` to `GetUserMapping

RE: [Proposal] Add foreign-server health checks infrastructure

2024-07-28 Thread Hayato Kuroda (Fujitsu)
Dear Fujii-san, Thanks for pushing and analyzing the failure! > The regression.diffs shows that pgfdw_conn_check returned 0 even though > pgfdw_conn_checkable() > returned true. This can happen if the "revents" from poll() indicates > something > other than > POLLRDHUP. I think that "revents" co

Re: Reuse child_relids in try_partitionwise_join was Re: Assert failure on bms_equal(child_joinrel->relids, child_joinrelids)

2024-07-28 Thread Ashutosh Bapat
Thanks a lot Richard. On Mon, Jul 29, 2024 at 8:56 AM Richard Guo wrote: > > On Fri, Jul 26, 2024 at 5:44 PM Richard Guo wrote: > > I've worked a bit more on the comments and commit message, and I plan > > to push the attached soon, barring any objections or comments. > > Pushed. > > Thanks > Ri

Re: Reuse child_relids in try_partitionwise_join was Re: Assert failure on bms_equal(child_joinrel->relids, child_joinrelids)

2024-07-28 Thread Richard Guo
On Fri, Jul 26, 2024 at 5:44 PM Richard Guo wrote: > I've worked a bit more on the comments and commit message, and I plan > to push the attached soon, barring any objections or comments. Pushed. Thanks Richard

Re: Allow logical failover slots to wait on synchronous replication

2024-07-28 Thread shveta malik
On Fri, Jul 26, 2024 at 5:11 PM Amit Kapila wrote: > > On Fri, Jul 26, 2024 at 3:28 PM shveta malik wrote: > > > > On Tue, Jul 23, 2024 at 10:35 AM Amit Kapila > > wrote: > > > > > > On Tue, Jul 9, 2024 at 12:39 AM John H wrote: > > > > > > > > > Out of curiosity, did you compare with > > > >

Re: Simplify create_merge_append_path a bit for clarity

2024-07-28 Thread Richard Guo
On Fri, Jul 26, 2024 at 1:28 PM Paul A Jungwirth wrote: > Is there a reason you don't want to remove the required_outer > parameter altogether? I guess because it is such a common pattern to > pass it? I think it's best to keep this parameter unchanged to maintain consistency with other functions

Re: Maybe don't process multi xmax in FreezeMultiXactId() if it is already marked as invalid?

2024-07-28 Thread Anton A. Melnikov
On 19.06.2024 21:06, Peter Geoghegan wrote: On Wed, Jun 19, 2024 at 1:39 PM Alvaro Herrera wrote: FWIW I don't think HEAP_XMAX_INVALID as purely a hint. HEAP_XMAX_COMMITTED is a hint, for sure, as is HEAP_XMIN_COMMITTED on its own; but as far as I recall, the INVALID flags must persist once s

Re: POC, WIP: OR-clause support for indexes

2024-07-28 Thread Alexander Korotkov
On Sun, Jul 28, 2024 at 12:59 PM Alena Rybakina wrote: > On 27.07.2024 13:56, Alexander Korotkov wrote: > > On Thu, Jul 25, 2024 at 5:04 PM Alena Rybakina > > wrote: > >> To be honest, I have found a big problem in this patch - we try to perform > >> the transformation every time we examime a c

Re: Optimize mul_var() for var1ndigits >= 8

2024-07-28 Thread Joel Jacobson
On Sun, Jul 28, 2024, at 21:18, Dean Rasheed wrote: > Attachments: > * v3-0002-Optimise-numeric-multiplication-using-base-NBASE-.patch > * v3-0001-Extend-mul_var_short-to-5-and-6-digit-inputs.patch Very nice. I've done some initial benchmarks on my Intel Core i9-14900K machine. To reduce noise,

Re: pg_upgrade failing for 200+ million Large Objects

2024-07-28 Thread Tom Lane
I wrote: > Alexander Korotkov writes: >> J4F, I have an idea to count number of ';' sings and use it for >> transaction size counter, since it is as upper bound estimate of >> number of SQL commands :-) > Hmm ... that's not a completely silly idea. Let's keep it in > the back pocket in case we c

Re: Parent/child context relation in pg_get_backend_memory_contexts()

2024-07-28 Thread David Rowley
On Mon, 29 Jul 2024 at 04:31, Tom Lane wrote: > It is not clear to me exactly which of these pointers should be > presumed to be possibly-null, but certainly testing ident after > storing through it is pretty pointless. Maybe what was intended > was > > - if (ident && strcmp(*name, "dynahas

Re: Pluggable cumulative statistics

2024-07-28 Thread Dmitry Dolgov
> On Sun, Jul 28, 2024 at 10:20:45PM GMT, Michael Paquier wrote: > I would like to apply this new infrastructure stuff and move on to the > problems related to the scability of pg_stat_statements. So, are > there any objections with all that? So far I've got nothing against :)

Re: Speed up collation cache

2024-07-28 Thread Jeff Davis
On Sun, 2024-07-28 at 00:14 +0200, Andreas Karlsson wrote: > But even without that extra optimization I think this patch is worth > merging and the patch is small, simple and clean and easy to > understand > and a just a clear speed up. Feels like a no brainer. I think that it > is > ready for c

Re: why is pg_upgrade's regression run so slow?

2024-07-28 Thread Andrew Dunstan
On 2024-07-27 Sa 6:48 PM, Tom Lane wrote: Andrew Dunstan writes: On 2024-07-27 Sa 10:20 AM, Tom Lane wrote: Just to add some more fuel to the fire: I do *not* observe such an effect on my own animals. The culprit appears to be meson. When I tested running crake with "using_meson => 0" I got

Re: Optimize mul_var() for var1ndigits >= 8

2024-07-28 Thread Dean Rasheed
On Fri, 12 Jul 2024 at 13:34, Dean Rasheed wrote: > > Then I tried compiling with -m32, and unfortunately this made the > patch slower than HEAD for small inputs: > > -- var1ndigits1=5, var2ndigits2=5 [-m32, SIMD disabled] > call rate=5.052332e+06 -- HEAD > call rate=3.883459e+06 -- v2 patch > >

Re: UUID v7

2024-07-28 Thread Andrey M. Borodin
> On 24 Jul 2024, at 04:09, Sergey Prokhorenko > wrote: > > Implementations MAY alter the actual timestamp. Hmm… looks like we slightly misinterpreted words about clock source. Well, that’s great, let’s get offset back. PFA version accepting offset interval. It works like this: postgres=# sel

Re: race condition in pg_class

2024-07-28 Thread Tom Lane
Noah Misch writes: > On Sun, Jul 28, 2024 at 11:50:33AM -0400, Tom Lane wrote: >> Is it time to worry yet? If this were HEAD only, I'd not be too >> concerned; but two of these three are on allegedly-stable branches. >> And we have releases coming up fast. > I don't know; neither decision feels

Re: race condition in pg_class

2024-07-28 Thread Noah Misch
On Sun, Jul 28, 2024 at 11:50:33AM -0400, Tom Lane wrote: > Noah Misch writes: > > On Sat, Jul 20, 2024 at 11:00:00AM +0300, Alexander Lakhin wrote: > >> A recent buildfarm test failure [1] showed that the > >> intra-grant-inplace-db.spec test added with 0844b3968 may fail > > >> But as the test

Re: Parent/child context relation in pg_get_backend_memory_contexts()

2024-07-28 Thread Tom Lane
David Rowley writes: > I ended up fixing that another way as the above seems to be casting > away the const for those variables. Instead, I changed the signature > of the function to: > static void get_memory_context_name_and_ident(MemoryContext context, > const char **const name, const char **co

Re: race condition in pg_class

2024-07-28 Thread Tom Lane
Noah Misch writes: > On Sat, Jul 20, 2024 at 11:00:00AM +0300, Alexander Lakhin wrote: >> A recent buildfarm test failure [1] showed that the >> intra-grant-inplace-db.spec test added with 0844b3968 may fail >> on a slow machine >> But as the test going to be modified by the inplace110-successors

Re: [PATCH] TODO “Allow LISTEN on patterns”

2024-07-28 Thread Alexander Cheshev
Hi Emanuel, I did a review on the new patch version and I observed that the identifier > passed to the LISTEN command is handled differently between outer and > inner > levels. > We have the following grammar: notify_channel: ColId {

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

2024-07-28 Thread Junwang Zhao
Hi Sutou, On Wed, Jul 24, 2024 at 4:31 PM Sutou Kouhei wrote: > > Hi, > > In <9172d4eb-6de0-4c6d-beab-8210b7a22...@enterprisedb.com> > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Mon, 22 Jul 2024 14:36:40 +0200, > Tomas Vondra wrote: > > > Thanks for the s

Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin

2024-07-28 Thread Masahiko Sawada
On Fri, Jul 26, 2024 at 1:27 PM Melanie Plageman wrote: > > On Mon, Jul 22, 2024 at 9:26 PM Masahiko Sawada wrote: > > > > + CREATE TABLE ${table1}(col1 int) > > + WITH (autovacuum_enabled=false, fillfactor=10); > > + INSERT INTO $table1 VALUES(7); > > + INSERT INTO $table1 SELECT gen

Re: pg_attribute.atttypmod for interval type

2024-07-28 Thread Chapman Flack
On 07/27/24 00:32, Tom Lane wrote: > Interval typmods include a fractional-seconds-precision field as well > as a bitmask indicating the allowed interval fields (per the SQL > standard's weird syntax such as INTERVAL DAY TO SECOND). Looking at > the source code for intervaltypmodout() might be hel

Re: Pluggable cumulative statistics

2024-07-28 Thread Michael Paquier
On Sat, Jul 27, 2024 at 03:49:42PM +0200, Dmitry Dolgov wrote: > Agree, looks good. I've tried to quickly sketch out such a fixed > statistic for some another extension, everything was fine and pretty > straightforward. That's my hope. Thanks a lot for the feedback. > One question, why don't you

Re: Fix overflow in pg_size_pretty

2024-07-28 Thread David Rowley
On Sun, 28 Jul 2024 at 16:30, Joseph Koshakow wrote: > Attached is an updated patch with your approach. I removed the 0 from > the negative case because I think it was unnecessary, but happy to add > it back in if I missed something. I made a few adjustments and pushed this. I did keep the 0 - p

Re: Protocol question regarding Portal vs Cursor

2024-07-28 Thread Dave Cramer
On Sat, 27 Jul 2024 at 19:06, Tatsuo Ishii wrote: > > Yes, sorry, I should have said one can not create a with hold portal > using > > the BIND command > > Ok. > > It would be possible to add a new parameter to the BIND command to > create such a portal. But it needs some changes to the existing

Re: POC, WIP: OR-clause support for indexes

2024-07-28 Thread Alena Rybakina
On 27.07.2024 13:56, Alexander Korotkov wrote: On Thu, Jul 25, 2024 at 5:04 PM Alena Rybakina wrote: To be honest, I have found a big problem in this patch - we try to perform the transformation every time we examime a column: for (indexcol = 0; indexcol < index->nkeycolumns; indexcol++) { .

Re: improve ssl error code, 2147483650

2024-07-28 Thread Peter Eisentraut
On 25.07.24 11:36, Daniel Gustafsson wrote: On 24 Jul 2024, at 15:32, Peter Eisentraut wrote: On 25.06.24 16:21, Tom Lane wrote: Peter Eisentraut writes: On 21.06.24 16:53, Tom Lane wrote: Most of libpq gets at strerror_r via SOCK_STRERROR for Windows portability. Is that relevant here? L