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

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

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

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

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

<    1   2