Re: doc: modify the comment in function libpqrcv_check_conninfo()

2024-07-08 Thread ikedarintarof
- * Validate connection info string, and determine whether it might cause - * local filesystem access to be attempted. + * The function + * 1. validates connection info string and + * 2. checks a password is provided if must_use_password is true. IMO, "Validate connection info string" is suffici

Re: Pluggable cumulative statistics

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 02:07:58PM +, Bertrand Drouvot wrote: > It looks pretty straightforward, just one comment: > > + ptr = ((char *) ctl) + kind_info->shared_ctl_off; > + kind_info->init_shmem_cb((void *) ptr); > > I don't think we need to cast

Re: Meson far from ready on Windows

2024-07-08 Thread Andres Freund
Hi, I've been hacking on addressing some of the complaints (after having been off-work in a somewhat unplanned way for most of the last two weeks). With some already opened and soon-to-be-proposed PRs to Dave's winbuild and the attached changes I think the concerns can largely be addressed. Her

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-07-08 Thread Tatsuo Ishii
>> Yes, I think so. I'd keep each as a separate patch so they can be >> considered independently. Doing all of them should hopefully ensure we >> strike the right balance of what code to put in explain.c and what >> code to put in tuplestore.c. > +1 > > + if (es->format != EXPLAIN_FORMAT_TEXT) > +

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-07-08 Thread Ashutosh Bapat
On Tue, Jul 9, 2024 at 8:20 AM David Rowley wrote: > > On Tue, 9 Jul 2024 at 14:44, Tatsuo Ishii wrote: > > BTW, it seems these executor nodes (other than Materialize and Window > > Aggregate node) use tuplestore for their own purpose. > > > > CTE Scan > > Recursive Union > > Table Function Scan

Re: MAINTAIN privilege -- what do we need to un-revert it?

2024-07-08 Thread Michael Paquier
On Sun, Jun 30, 2024 at 03:23:44PM -0700, Noah Misch wrote: > I've audited NewGUCNestLevel() calls that didn't get this addition. Among > those, these need the addition: > > - Each in ComputeIndexAttrs() -- they arise when the caller is DefineIndex() > - In DefineIndex(), after comment "changed a

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 12:30:09PM +0300, Aleksander Alekseev wrote: > TWIMC this is currently listed as an open item for PG17 [1]. > Sorry if everyone interested is already aware. > > [1]: https://wiki.postgresql.org/wiki/PostgreSQL_17_Open_Items The proposed patch looks rather incomplete to me,

Re: walsender.c comment with no context is hard to understand

2024-07-08 Thread Peter Smith
On Mon, Jul 8, 2024 at 4:19 PM Bertrand Drouvot wrote: > > Hi, > > On Mon, Jul 08, 2024 at 11:20:45AM +0530, Amit Kapila wrote: > > On Mon, Jul 8, 2024 at 11:08 AM Bertrand Drouvot > > wrote: > > > > > > On Mon, Jul 08, 2024 at 08:46:19AM +0530, Amit Kapila wrote: > > > > This sounds better but i

Re: Pluggable cumulative statistics

2024-07-08 Thread Bertrand Drouvot
Hi, On Tue, Jul 09, 2024 at 10:45:05AM +0900, Michael Paquier wrote: > On Mon, Jul 08, 2024 at 07:22:32AM +, Bertrand Drouvot wrote: > > Yeah, what I meant to say is that one could think for example that's the > > PgStatShared_Archiver size while in fact it's the PgStat_ArchiverStats size. > >

RE: Is it expected behavior index only scan shows "OPERATOR(pg_catalog." for EXPLAIN?

2024-07-08 Thread Masahiro.Ikeda
Thanks for your comments. Tom Lane writes: > Tomas Vondra writes: > > I honestly don't know if this is the correct solution. It seems to me > > handling this at the EXPLAIN level might just mask the issue - it's > > not clear to me why adding "indexqualorig" would remove the ambiguity > > (if t

Re: Injection point locking

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 04:21:37PM +0300, Heikki Linnakangas wrote: > I came up with the attached. It replaces the shmem hash table with an array > that's scanned linearly. On each slot in the array, there's a generation > number that indicates whether the slot is in use, and allows detecting > con

Re: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-08 Thread Amit Kapila
On Mon, Jul 8, 2024 at 5:25 PM Amit Kapila wrote: > > > I see that in 0003/0004, the patch first aborts pending prepared > transactions, update's catalog, and then change slot's property via > walrcv_alter_slot. What if there is any ERROR (say the remote node is > not reachable or there is an erro

Lock-free compaction. Why not?

2024-07-08 Thread Ahmed Yarub Hani Al Nuaimi
So anyways I talked last week about lock-free vacuum. Since then I almost finished creating a plugin that works on all Jetbrains products. It hooks to the internal database tool and displays the internals of the database and some stats. I would use this for my next phase: autovacuum with compaction

Re: Pgoutput not capturing the generated columns

2024-07-08 Thread Peter Smith
Hi Shlok, here are my review comments for v16-0003. == src/backend/replication/logical/proto.c On Mon, Jul 8, 2024 at 10:04 PM Shlok Kyal wrote: > > On Mon, 8 Jul 2024 at 13:20, Peter Smith wrote: > > > > > > 2. logicalrep_write_tuple and logicalrep_write_attrs > > > > I thought all the co

Re: Injection point locking

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 10:17:49AM -0400, Tom Lane wrote: > Heikki Linnakangas writes: >> Note that until we actually add an injection point to a function that >> runs in the postmaster, there's no risk. If we're uneasy about that, we >> could add an assertion to InjectionPointRun() to prevent i

Re: optimizing pg_upgrade's once-in-each-database steps

2024-07-08 Thread Nathan Bossart
I finished parallelizing everything in pg_upgrade I could easily parallelize with the proposed async task API. There are a few remaining places where I could not easily convert to the new API for whatever reason. AFAICT those remaining places are either not showing up prominently in my tests, or t

Re: Doc Rework: Section 9.16.13 SQL/JSON Query Functions

2024-07-08 Thread Amit Langote
On Tue, Jul 9, 2024 at 10:39 AM jian he wrote: > On Mon, Jul 8, 2024 at 8:57 PM Amit Langote wrote: > > > > Updated patch attached. > > > > Returns true if the SQL/JSON > path_expression > -applied to the context_item using the > -PASSING values yields > any > -

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-07-08 Thread David Rowley
On Tue, 9 Jul 2024 at 14:44, Tatsuo Ishii wrote: > BTW, it seems these executor nodes (other than Materialize and Window > Aggregate node) use tuplestore for their own purpose. > > CTE Scan > Recursive Union > Table Function Scan > > I have already implemented that for CTE Scan. Do you think other

Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE

2024-07-08 Thread David Rowley
On Tue, 9 Jul 2024 at 11:51, David Rowley wrote: > I think we should consider aligning Parallel Hash > with the other Parallel node behaviour. I looked at that and quickly realised that it makes sense that Parallel Hash does something different here. All the workers are contributing to building

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-07-08 Thread Tatsuo Ishii
> On Sat, 6 Jul 2024 at 23:23, Tatsuo Ishii wrote: >> So I wanted to Add memory/disk usage for WindowAgg. Patch attached. > > Thanks for working on that. Thank you for the infrastructure you created in tuplestore.c and explain.c. BTW, it seems these executor nodes (other than Materialize and Wi

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

2024-07-08 Thread Alena Rybakina
Hi! Thank you for your review! Sorryforthe delayin responding. Irewrotethe patchasyourequested,butnowI'm facedwiththe problemof processingthe elementsof the or_entries list.For somereason, thepointerto thelistis cleared and I couldn't find the place where it happened.MaybeI'mmissingsomethingsi

Re: array_in sub function ReadArrayDimensions error message

2024-07-08 Thread jian he
On Mon, Jul 8, 2024 at 10:42 PM Tom Lane wrote: > > jian he writes: > > while reviewing the json query doc, > > I found out the following error message was not quite right. > > > select '[1,2]'::int[]; > > ERROR: malformed array literal: "[1,2]" > > LINE 1: select '[1,2]'::int[]; > >

Re: Pluggable cumulative statistics

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 07:22:32AM +, Bertrand Drouvot wrote: > Yeah, what I meant to say is that one could think for example that's the > PgStatShared_Archiver size while in fact it's the PgStat_ArchiverStats size. > I think it's more confusing when writing the stats. Here we are manipulating

Re: Pgoutput not capturing the generated columns

2024-07-08 Thread Peter Smith
Hi Shlok, Here are my review comments for v16-0002 == src/backend/replication/logical/tablesync.c 1. fetch_remote_table_info + if ((server_version >= 12 && server_version < 18) || + !MySubscription->includegencols) + appendStringInfo(&cmd, " AND a.attgenerated = ''"); I felt this co

Re: jsonpath: Inconsistency of timestamp_tz() Output

2024-07-08 Thread Junwang Zhao
On Mon, Jul 1, 2024 at 11:02 PM David E. Wheeler wrote: > > Hackers, > > There’s an odd difference in the behavior of timestamp_tz() outputs. Running > with America/New_York as my TZ, it looks fine for a full timestamptz, > identical to how casting the types directly works: > > david=# set time

Re: Doc Rework: Section 9.16.13 SQL/JSON Query Functions

2024-07-08 Thread jian he
On Mon, Jul 8, 2024 at 8:57 PM Amit Langote wrote: > > Updated patch attached. > Returns true if the SQL/JSON path_expression -applied to the context_item using the -PASSING values yields any -items. +applied to the context_item doesn't yield +any

Re: Parallel CREATE INDEX for GIN indexes

2024-07-08 Thread Andy Fan
Andy Fan writes: I just realize all my replies is replied to sender only recently, probably because I upgraded the email cient and the short-cut changed sliently, resent the lastest one only >>> Suppose RBTree's output is: >>> >>> batch-1 at RBTree: >>> 1 [tid1, tid8, tid100] >>> 2 [tid1

Re: Built-in CTYPE provider

2024-07-08 Thread Tom Lane
Noah Misch writes: > It sounds like you're very comfortable with $SUBJECT proceeding in its current > form. Is that right? I don't have an opinion on whether the overall feature design is well-chosen. But the mere fact that Unicode updates will from time to time change the behavior (presumably

Re: Built-in CTYPE provider

2024-07-08 Thread Noah Misch
On Sat, Jul 06, 2024 at 04:19:21PM -0400, Tom Lane wrote: > Noah Misch writes: > > As a released feature, NORMALIZE() has a different set of remedies to choose > > from, and I'm not proposing one. I may have sidetracked this thread by > > talking about remedies without an agreement that pg_c_utf8

Re: MIN/MAX functions for a record

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 08:54:31PM -0400, Tom Lane wrote: > Don't recall right at this instant, but I've put myself down as > reviewer of this patch to remind me to look at it in the next > day or two. Thanks for the update. WFM. -- Michael signature.asc Description: PGP signature

Re: MIN/MAX functions for a record

2024-07-08 Thread Tom Lane
Michael Paquier writes: > I am not sure to get the concerns of upthread regarding the type > caching in the context of an aggregate, which is the business with > lookup_type_cache(), especially since there is a btree operator > relying on record_cmp(). Tom, what were your concerns here? Don't re

Re: MIN/MAX functions for a record

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 12:20:30PM +0300, Aleksander Alekseev wrote: > Here is the corrected patch. 313f87a17155 is one example of a similar change with pg_lsn, with four entries added to pg_proc and two to pg_aggregate. That's what this patch is doing from what I can see. -and arrays of

Re: pg_wal_summary_contents() and pg_walsummary may return different results on the same WAL summary file

2024-07-08 Thread Fujii Masao
On 2024/07/08 22:50, Robert Haas wrote: On Thu, Jul 4, 2024 at 6:16 AM Fujii Masao wrote: Yes, so I updated the commit message. I borrowed your description and used it in the message. Attached is the revised version of the patch. If there are no objections, I will commit and backpatch it.

Re: doc: modify the comment in function libpqrcv_check_conninfo()

2024-07-08 Thread Fujii Masao
On 2024/07/08 20:44, ikedarintarof wrote: I remove the unclear part from the previous patch and add some explanation for  later part of the function. - * Validate connection info string, and determine whether it might cause - * local filesystem access to be attempted. + * The function + * 1

Re: Faster "SET search_path"

2024-07-08 Thread Noah Misch
On Mon, Jul 08, 2024 at 04:39:21PM -0700, Jeff Davis wrote: > On Sun, 2024-06-30 at 15:30 -0700, Noah Misch wrote: > > You're caching the result of object_aclcheck(NamespaceRelationId, > > ...), so > > pg_auth_members changes > > Thank you for the report. > > Question: to check for changes to pg_

Re: Why do we define HAVE_GSSAPI_EXT_H?

2024-07-08 Thread Andres Freund
Hi, On 2024-07-08 19:05:32 -0400, Tom Lane wrote: > Andres Freund writes: > > configure/meson define HAVE_GSSAPI_EXT_H / HAVE_GSSAPI_GSSAPI_EXT_H - but > > afaict we don't use those anywhere? > > It looks to me like it's just a byproduct of the autoconf macros > we use to verify that you have a

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2024-07-08 Thread Noah Misch
On Mon, Jul 08, 2024 at 02:09:21PM -0700, Jacob Champion wrote: > On Sun, Jun 30, 2024 at 10:48 AM Noah Misch wrote: > > That said, it > > may be more fruitful to arrange for authentication timeout to cut through > > PAM > > etc. > > That seems mostly out of our hands -- the misbehaving modules

Re: pgsql: Add pg_get_acl() to get the ACL for a database object

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 11:55:28AM +0200, Joel Jacobson wrote: > Patch didn't apply to HEAD nor on top of any of the previous commits either, > but I couldn't figure out why based on the .rej files, strange. > I copy/pasted the parts from the patch to test it. Let me know if you need a > rebased ve

Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE

2024-07-08 Thread David Rowley
On Mon, 8 Jul 2024 at 15:43, David Rowley wrote: > > On Sun, 18 Feb 2024 at 11:31, Tomas Vondra > wrote: > > 2) Leader vs. worker counters > > > > It seems to me this does nothing to add the per-worker values from "Heap > > Blocks" into the leader, which means we get stuff like this: > > > >

Re: Faster "SET search_path"

2024-07-08 Thread Jeff Davis
On Sun, 2024-06-30 at 15:30 -0700, Noah Misch wrote: > You're caching the result of object_aclcheck(NamespaceRelationId, > ...), so > pg_auth_members changes Thank you for the report. Question: to check for changes to pg_auth_members, it seems like either AUTHMEMROLEMEM or AUTHMEMMEMROLE work, an

Re: Why do we define HAVE_GSSAPI_EXT_H?

2024-07-08 Thread Tom Lane
Andres Freund writes: > configure/meson define HAVE_GSSAPI_EXT_H / HAVE_GSSAPI_GSSAPI_EXT_H - but > afaict we don't use those anywhere? It looks to me like it's just a byproduct of the autoconf macros we use to verify that you have a sane installation: if test "$with_gssapi" = yes ; then AC_CH

Re: 010_pg_basebackup.pl vs multiple filesystems

2024-07-08 Thread Andres Freund
On 2024-07-08 17:45:16 -0400, Andrew Dunstan wrote: > OK, done like this. Thanks!

Why do we define HAVE_GSSAPI_EXT_H?

2024-07-08 Thread Andres Freund
Hi, Since commit f7431bca8b0138bdbce7025871560d39119565a0 Author: Stephen Frost Date: 2023-04-13 08:55:13 -0400 Explicitly require MIT Kerberos for GSSAPI WHen building with GSSAPI support, explicitly require MIT Kerberos and check for gssapi_ext.h in configure.ac and meson.build

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-07-08 Thread David Rowley
On Sat, 6 Jul 2024 at 23:23, Tatsuo Ishii wrote: > So I wanted to Add memory/disk usage for WindowAgg. Patch attached. Thanks for working on that. > Since WindowAgg node could create multiple tuplestore for each Window > partition, we need to track each tuplestore storage usage so that the > max

Re: SupportRequestRows support function for generate_series_timestamptz

2024-07-08 Thread David Rowley
On Mon, 8 Jul 2024 at 17:52, jian he wrote: > > On Mon, Jul 8, 2024 at 1:16 PM David Rowley wrote: > > Updated patch attached. > > looking good to me. Thanks for reviewing. I've pushed the patch now. David

Re: 010_pg_basebackup.pl vs multiple filesystems

2024-07-08 Thread Andrew Dunstan
On 2024-07-08 Mo 4:31 PM, Andres Freund wrote: Hi, On 2024-07-07 09:10:48 -0400, Andrew Dunstan wrote: On 2024-07-07 Su 7:28 AM, Andrew Dunstan wrote: I'll be happy to hear of one. I agree it's a mess.  Maybe we could test that the temp directory is on the same device on Windows and skip the

Re: tests fail on windows with default git settings

2024-07-08 Thread Andres Freund
Hi, On 2024-07-08 16:56:10 -0400, Andrew Dunstan wrote: > On 2024-07-08 Mo 4:16 PM, Andres Freund wrote: > > I'm actually mildly surprised that the tests don't fail when *not* using > > autocrlf, because afaict test_json_parser_incremental.c doesn't set stdout > > to > > binary and thus we presum

Re: Document use of ldapurl with LDAP simple bind

2024-07-08 Thread Jacob Champion
On Fri, Jun 28, 2024 at 12:11 AM Peter Eisentraut wrote: > This appears to imply that specifying ldapurl is only applicable for > search+bind. Maybe that whole message should be simplified to something > like > > "configuration mixes arguments for simple bind and search+bind" > > (The old wording

Re: 010_pg_basebackup.pl vs multiple filesystems

2024-07-08 Thread Andres Freund
Hi, On 2024-07-08 16:45:42 -0400, Robert Haas wrote: > On Sun, Jul 7, 2024 at 3:02 AM Andres Freund wrote: > > While working on [1] I encountered the issue that, on github-actions, > > 010_pg_basebackup.pl fails on windows. > > > > The reason for that is that github actions uses two drives, with

Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade

2024-07-08 Thread Nathan Bossart
Committed. -- nathan

Re: 010_pg_basebackup.pl vs multiple filesystems

2024-07-08 Thread Andrew Dunstan
On 2024-07-08 Mo 4:45 PM, Robert Haas wrote: On Sun, Jul 7, 2024 at 3:02 AM Andres Freund wrote: While working on [1] I encountered the issue that, on github-actions, 010_pg_basebackup.pl fails on windows. The reason for that is that github actions uses two drives, with TMP/TEMP located on c

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2024-07-08 Thread Jacob Champion
On Sun, Jun 30, 2024 at 10:48 AM Noah Misch wrote: > That looks like a reasonable user experience. Is any field newly-nullable? Technically I think the answer is no, since backends such as walwriter already have null database and user fields. It's new for a client backend to have nulls there, th

Re: tests fail on windows with default git settings

2024-07-08 Thread Andrew Dunstan
On 2024-07-08 Mo 4:16 PM, Andres Freund wrote: On 2024-07-07 06:30:57 -0400, Andrew Dunstan wrote: On 2024-07-07 Su 1:26 AM, Tom Lane wrote: Andres Freund writes: Do we want to support checking out with core.autocrlf? -1. It would be a constant source of breakage, and you could never expec

Re: 010_pg_basebackup.pl vs multiple filesystems

2024-07-08 Thread Robert Haas
On Sun, Jul 7, 2024 at 3:02 AM Andres Freund wrote: > While working on [1] I encountered the issue that, on github-actions, > 010_pg_basebackup.pl fails on windows. > > The reason for that is that github actions uses two drives, with TMP/TEMP > located on c:, the tested code on d:. This causes th

Re: tests fail on windows with default git settings

2024-07-08 Thread Tom Lane
Andres Freund writes: > On 2024-07-07 06:30:57 -0400, Andrew Dunstan wrote: >> ISTM the right fix is probably to use PG_BINARY_R mode instead of "r" when >> opening the files, at least in the case if the test_json_parser tests. > That approach does seem to mildly conflict with Tom and your prefer

Re: 010_pg_basebackup.pl vs multiple filesystems

2024-07-08 Thread Andres Freund
Hi, On 2024-07-07 09:10:48 -0400, Andrew Dunstan wrote: > On 2024-07-07 Su 7:28 AM, Andrew Dunstan wrote: > > I'll be happy to hear of one. I agree it's a mess.  Maybe we could test > > that the temp directory is on the same device on Windows and skip the > > test if not? You could still get the t

Re: Should we work around msvc failing to compile tab-complete.c?

2024-07-08 Thread Tom Lane
Andres Freund writes: > Given that - afaict - tab completion never used to work with msvc, I think > it'd be ok to just do it in 17 or 16+17 or such. Obviously nobody is currently > building with readline support for windows - not sure if any packager is going > to go back and add support for it i

Re: Interrupts vs signals

2024-07-08 Thread Robert Haas
On Mon, Jul 8, 2024 at 5:38 AM Heikki Linnakangas wrote: > Another approach would be to move the responsibility of background > worker state notifications out of postmaster completely. When a new > background worker is launched, the worker process itself could send the > notification that it has s

Re: tests fail on windows with default git settings

2024-07-08 Thread Andres Freund
On 2024-07-07 06:30:57 -0400, Andrew Dunstan wrote: > > On 2024-07-07 Su 1:26 AM, Tom Lane wrote: > > Andres Freund writes: > > > Do we want to support checking out with core.autocrlf? > > -1. It would be a constant source of breakage, and you could never > > expect that (for example) making a t

Re: Should we work around msvc failing to compile tab-complete.c?

2024-07-08 Thread Andres Freund
Hi, On 2024-07-08 14:18:03 -0400, Tom Lane wrote: > Andres Freund writes: > > Compiling postgres on windows with tab-completion support fails either with > > "fatal error C1026: parser stack overflow, program too complex”. > > or (in recent versions) with > > "…/src/bin/psql/tab-complete.c(4023):

Re: ssl tests fail due to TCP port conflict

2024-07-08 Thread Andrew Dunstan
On 2024-07-08 Mo 8:00 AM, Alexander Lakhin wrote: Hello, 07.06.2024 17:25, Tom Lane wrote: Andrew Dunstan writes: I still think my patch to force TCP mode for the SSL test makes sense as well. +1 to both things.  If that doesn't get the failure rate down to an acceptable level, we can loo

Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal

2024-07-08 Thread Robert Haas
On Thu, Jul 4, 2024 at 10:35 AM Fujii Masao wrote: > +1 for v18 or later. However, since the reported issue is in v17, > it needs to be addressed without such a improved check mechanism. Here is a draft patch for that. This is only lightly tested at this point, so further testing would be greatly

Re: Improve the connection failure error messages

2024-07-08 Thread Tom Lane
Nisha Moond writes: > Attached v5 patch with the translator comments as suggested. I looked at this, and I agree with the goal, but I find just about all of the translator comments unnecessary. The ones that are useful are useful only because the message is violating one of our message style gui

Re: allow changing autovacuum_max_workers without restarting

2024-07-08 Thread Nathan Bossart
Here is a rebased patch. One thing that still bugs me is that there is no feedback sent to the user when autovacuum_max_workers is set higher than autovacuum_worker_slots. I think we should at least emit a WARNING, perhaps from the autovacuum launcher, i.e., once when the launcher starts and then

Re: Allow logical failover slots to wait on synchronous replication

2024-07-08 Thread John H
Hi Amit, Thanks for taking a look. On Tue, Jun 18, 2024 at 10:34 PM Amit Kapila wrote: > > > The reading indicates when you set 'standby_slot_names_from_syncrep', > the TPS reduces as compared to when it is not set. It would be better > to see the data comparing 'standby_slot_names_from_syncrep

Re: Allow logical failover slots to wait on synchronous replication

2024-07-08 Thread John H
Hi, Thanks Bertrand for taking a look at the patch. On Mon, Jun 17, 2024 at 8:19 AM Bertrand Drouvot wrote: > > + int mode = SyncRepWaitMode; > > It's set to SyncRepWaitMode and then never change. Worth to get rid of "mode"? > I took a deeper look at this with GDB and I think it'

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

2024-07-08 Thread Melanie Plageman
On Tue, Jul 2, 2024 at 7:07 PM Melanie Plageman wrote: > > On Mon, Jun 24, 2024 at 4:27 AM Heikki Linnakangas wrote: > > > > Would it be possible to make it robust so that we could always run it > > with "make check"? This seems like an important corner case to > > regression test. > > Okay, I've

Re: Should we work around msvc failing to compile tab-complete.c?

2024-07-08 Thread Tom Lane
Andres Freund writes: > Compiling postgres on windows with tab-completion support fails either with > "fatal error C1026: parser stack overflow, program too complex”. > or (in recent versions) with > "…/src/bin/psql/tab-complete.c(4023): fatal error C1001: Internal compiler > error." > It's pret

Re: Confine vacuum skip logic to lazy_scan_skip

2024-07-08 Thread Melanie Plageman
On Sun, Jul 7, 2024 at 10:49 AM Noah Misch wrote: > > On Fri, Jun 28, 2024 at 05:36:25PM -0400, Melanie Plageman wrote: > > I've attached a WIP v11 streaming vacuum patch set here that is > > rebased over master (by Thomas), so that I could add a CF entry for > > it. It still has the problem with

Re: Detoasting optionally to make Explain-Analyze less misleading

2024-07-08 Thread Michael Christofides
> I'm not sure there's a need for it. When a query runs under > auto_explain, the output values will be sent to the client, > so those cycles should be accounted for anyway, no? > Yes, great point, the total duration reported by auto_explain includes it. Explicit serialization stats might still b

Re: debugging what might be a perf regression in 17beta2

2024-07-08 Thread MARK CALLAGHAN
A writeup for the benchmark results is here - https://smalldatum.blogspot.com/2024/07/postgres-17beta2-vs-sysbench-looking.html pg17beta2 and pg17beta1 look good so far On Mon, Jul 8, 2024 at 10:49 AM MARK CALLAGHAN wrote: > My results have too much variance so this is a false alarm. One day I >

Re: debugging what might be a perf regression in 17beta2

2024-07-08 Thread MARK CALLAGHAN
My results have too much variance so this is a false alarm. One day I might learn whether the noise is from HW, Postgres or my test method. I ended up trying 10 builds between 17beta1 and 17beta2, but even with that I don't have a clear signal. On Fri, Jul 5, 2024 at 8:48 PM David Rowley wrote:

Should we work around msvc failing to compile tab-complete.c?

2024-07-08 Thread Andres Freund
Hi, Compiling postgres on windows with tab-completion support fails either with "fatal error C1026: parser stack overflow, program too complex”. or (in recent versions) with "…/src/bin/psql/tab-complete.c(4023): fatal error C1001: Internal compiler error." I've reported this to the visual studio

Re: jsonpath: Inconsistency of timestamp_tz() Output

2024-07-08 Thread David E. Wheeler
On Jul 2, 2024, at 10:53, David E. Wheeler wrote: > ``` patch > --- a/src/test/regress/expected/jsonb_jsonpath.out > +++ b/src/test/regress/expected/jsonb_jsonpath.out > @@ -2914,7 +2914,7 @@ HINT: Use *_tz() function for time zone support. > select jsonb_path_query_tz('"2023-08-15"', '$.timesta

Re: Windows: openssl & gssapi dislike each other

2024-07-08 Thread Andres Freund
Hi, On 2024-06-13 00:12:51 +0900, Imran Zaheer wrote: > I removed the macro from the sslinfo.c as suggested by Andrew. Then I > was thinking maybe we can undo some other similar code. What precisely do you mean by that? Just getting rid of the "ordered include" of openssl headers in {fe,be}-secu

Re: Detoasting optionally to make Explain-Analyze less misleading

2024-07-08 Thread Tom Lane
Michael Christofides writes: > While looking to add support for SERIALIZE in an explain visualisation tool > I work on, I realised there isn't yet an equivalent auto_explain parameter > for SERIALIZE. I'm not sure if this is a deliberate omission (perhaps for a > similar reason planning time is no

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David E. Wheeler
On Jul 8, 2024, at 12:17, David G. Johnston wrote: > We created a data type named: jsonpath. Does the standard actually have that > data type and defined parsing behavior or does it just have functions where > one of the inputs is text whose contents are a path expression? Ah, got it. D

Re: Detoasting optionally to make Explain-Analyze less misleading

2024-07-08 Thread Michael Christofides
> > So thanks again! and this will really help a lot of people. I'd like to echo this thanks to you all. While looking to add support for SERIALIZE in an explain visualisation tool I work on, I realised there isn't yet an equivalent auto_explain parameter for SERIALIZE. I'm not sure if this is a

Re: Add GiST support for mixed-width integer operators

2024-07-08 Thread Paul Jungwirth
On 7/6/24 05:04, Andrey M. Borodin wrote:>> On 5 Jul 2024, at 23:46, Paul Jungwirth wrote: this commit adds support for all combinations of int2/int4/int8 for all five btree operators (=/>). Looks like a nice feature to have. Would it make sense to do something similar to float8? Or, perhaps

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David G. Johnston
On Mon, Jul 8, 2024 at 9:12 AM David E. Wheeler wrote: > On Jul 8, 2024, at 12:05, David G. Johnston > wrote: > > > Does the standard even have a separate type here or is that our > implementation detail invention? > > Sorry, separate type for what? > > We created a data type named: jsonpath. D

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David E. Wheeler
On Jul 8, 2024, at 12:05, David G. Johnston wrote: > If we go down this path wouldn't the correct framing be: do not allow > accessors after scalars ? The same argument applies to false/"john" and > other scalar types since by definition none of them have subcomponents to be > accessed. Yes

Re: Patch bug: Fix jsonpath .* on Arrays

2024-07-08 Thread David E. Wheeler
On Jun 27, 2024, at 04:17, Michael Paquier wrote: > The tests of jsonb_jsonpath.sql include a lot of patterns for @? and > jsonb_path_query with the lax and strict modes, so shouldn't these > additions be grouped closer to the existing tests rather than added at > the end of the file? I’ve move

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David G. Johnston
On Mon, Jul 8, 2024 at 8:27 AM David E. Wheeler wrote: > Hi, following up on some old threads. > > > On Apr 10, 2024, at 16:44, David E. Wheeler > wrote: > > > > That makes sense, thanks. It’s just a little odd to me that the > resulting path isn’t a query at all. To Erik’s point: what path can

Re: RFC: Additional Directory for Extensions

2024-07-08 Thread David E. Wheeler
On Jun 25, 2024, at 18:31, David E. Wheeler wrote: > For those who prefer a GitHub patch review experience, see this PR: > > https://github.com/theory/postgres/pull/3/files Rebased and restored PGC_SUSET in the attached v5 patch, plus noted the required privileges in the docs. Best, David

Re: Commitfest manager for July 2024

2024-07-08 Thread Joe Conway
On 7/3/24 12:51, Andrey M. Borodin wrote: On 3 Jul 2024, at 01:08, Corey Huinker wrote: I'll give it a shot. Great, thank you! Do you have extended access to CF? Like activity log and mass-mail functions? If no I think someone from PG_INFRA can grant you necessary access. I can do that, al

Re: Parallel CREATE INDEX for GIN indexes

2024-07-08 Thread Matthias van de Meent
On Mon, 8 Jul 2024, 13:38 Tomas Vondra, wrote: > > On 7/8/24 11:45, Matthias van de Meent wrote: > > As to the GIN TS code itself; yes it's more complicated, mainly > > because it uses several optimizations to reduce unnecessary > > allocations and (de)serializations of GinTuples, and I'm aware of

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David E. Wheeler
Hi, following up on some old threads. > On Apr 10, 2024, at 16:44, David E. Wheeler wrote: > > That makes sense, thanks. It’s just a little odd to me that the resulting > path isn’t a query at all. To Erik’s point: what path can `'0x2.p10` even > select? I’m wondering whether the jsonpath par

Re: 回复: An implementation of multi-key sort

2024-07-08 Thread Tomas Vondra
On 7/7/24 08:32, Konstantin Knizhnik wrote: > > On 04/07/2024 3:45 pm, Yao Wang wrote: >> Generally, the benefit of mksort is mainly from duplicated values and >> sort >> keys: the more duplicated values and sort keys are, the bigger benefit it >> gets. > ... >> 1. Use distinct stats info of ta

Re: optimizing pg_upgrade's once-in-each-database steps

2024-07-08 Thread Nathan Bossart
As I mentioned elsewhere [0], here's a first attempt at parallelizing the data type checks. I was worried that I might have to refactor Daniel's work in commit 347758b quite significantly, but I was able to avoid that by using a set of generic callbacks and providing each task step an index to the

Re: 回复: An implementation of multi-key sort

2024-07-08 Thread Tomas Vondra
On 7/4/24 14:45, Yao Wang wrote: > Hi John, > > Thanks for your kind message. I talked to Heikki before getting Tomas's > response, and he said "no promise but I will take a look". That's why I > added his email. I have updated the CF entry and added Tomas as reviewer. > > Hi Tomas, > > Again

Re: array_in sub function ReadArrayDimensions error message

2024-07-08 Thread Tom Lane
jian he writes: > while reviewing the json query doc, > I found out the following error message was not quite right. > select '[1,2]'::int[]; > ERROR: malformed array literal: "[1,2]" > LINE 1: select '[1,2]'::int[]; >^ > DETAIL: Missing "]" after array dimensions. > should it

Re: 回复:Re: 回复:Re: speed up pg_upgrade with large number of tables

2024-07-08 Thread Nathan Bossart
On Mon, Jul 08, 2024 at 03:22:36PM +0800, 杨伯宇(长堂) wrote: > Besides, https://commitfest.postgresql.org/48/4995/ seems insufficient to > this situation. Some time-consuming functions like check_for_data_types_usage > are not yet able to run in parallel. But these patches could be a great > starting

Re: Injection point locking

2024-07-08 Thread Tom Lane
Heikki Linnakangas writes: > Note that until we actually add an injection point to a function that > runs in the postmaster, there's no risk. If we're uneasy about that, we > could add an assertion to InjectionPointRun() to prevent it from running > in the postmaster, so that we don't cross tha

Re: Optimize commit performance with a large number of 'on commit delete rows' temp tables

2024-07-08 Thread feichanghong
Hi wenhui, I carefully analyzed the reason for the performance regression with fewer temporary tables in the previous patch (v1-0002-): the k_hash_funcs determined by the bloom_create function were 10(MAX_HASH_FUNCS), which led to an excessive calculation overhead for the bloom filter. B

Re: Pluggable cumulative statistics

2024-07-08 Thread Bertrand Drouvot
Hi, On Mon, Jul 08, 2024 at 07:22:32AM +, Bertrand Drouvot wrote: > Except the above (which is just a Nit), 0001 LGTM. > Looking at 0002: It looks pretty straightforward, just one comment: + ptr = ((char *) ctl) + kind_info->shared_ctl_off; + kin

Re: pg_wal_summary_contents() and pg_walsummary may return different results on the same WAL summary file

2024-07-08 Thread Robert Haas
On Thu, Jul 4, 2024 at 6:16 AM Fujii Masao wrote: > Yes, so I updated the commit message. I borrowed your description and used it > in the message. Attached is the revised version of the patch. > > If there are no objections, I will commit and backpatch it. +1. Maybe change "Fix bugs in pg_wal_s

Re: Injection point locking

2024-07-08 Thread Heikki Linnakangas
On 25/06/2024 05:25, Noah Misch wrote: On Mon, Jun 24, 2024 at 11:03:09AM -0400, Tom Lane wrote: Heikki Linnakangas writes: ... I can't do that, because InjectionPointRun() requires a PGPROC entry, because it uses an LWLock. That also makes it impossible to use injection points in the postmast

Re: a potential typo in comments of pg_parse_json

2024-07-08 Thread Amit Langote
On Mon, Jul 8, 2024 at 5:25 PM Junwang Zhao wrote: > Not 100% sure, sorry if this doesn't make sense. > > --- a/src/common/jsonapi.c > +++ b/src/common/jsonapi.c > @@ -514,7 +514,7 @@ freeJsonLexContext(JsonLexContext *lex) > * > * If FORCE_JSON_PSTACK is defined then the routine will call the

Re: Doc Rework: Section 9.16.13 SQL/JSON Query Functions

2024-07-08 Thread Amit Langote
Thanks for the readthrough. On Sat, Jul 6, 2024 at 11:56 AM jian he wrote: > json_exists > "Returns true if the SQL/JSON path_expression applied to the > context_item using the PASSING values yields any items." > now you changed to > << > Returns true if the SQL/JSON path_expression applied to th

Re: MergeJoin beats HashJoin in the case of multiple hash clauses

2024-07-08 Thread Andrei Lepikhov
On 3/11/2023 23:43, Tomas Vondra wrote: On 9/11/23 10:04, Lepikhov Andrei wrote: * Determine bucketsize fraction and MCV frequency for the inner * relation. We use the smallest bucketsize or MCV frequency estimated * for any individual hashclause; this is undoubtedly conservative. I'm sure

  1   2   >