Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-04-10 Thread Richard Guo
On Fri, Apr 11, 2025 at 4:45 AM Robert Haas wrote: > OK. Maybe I shouldn't be worrying about the table_open() / > table_close() here, because I see that you are right that > has_subclass() is nearby, which admittedly does not involve opening > the relation, but it does involve fetching from the sy

Re: Proposal: Filter irrelevant change before reassemble transactions during logical decoding

2025-04-10 Thread Peter Smith
Hi Ajin, Some review comments for patch v16-0003. == Patch 1. mode change 100644 => 100755 src/test/subscription/t/001_rep_changes.pl What's this mode change for? == Commit message 2. missing commit message == src/backend/replication/logical/reorderbuffer.c 3. -#define CHANGES_T

Re: Silence resource leaks alerts

2025-04-10 Thread Tom Lane
Michael Paquier writes: > On Thu, Apr 10, 2025 at 03:10:02PM -0300, Ranier Vilela wrote: >> While it is arguable that this is a false warning, there is a benefit in >> moving the initialization of the string buffer, silencing the warnings that >> are presented in this case. >> >> 1. pg_overexplai

Fix replica identity checks for MERGE command on published table.

2025-04-10 Thread Zhijie Hou (Fujitsu)
Hi, While testing publication DDLs, I noticed an unexpected behavior where the MERGE command can be executed on tables lacking replica identity keys, regardless of whether they are part of a publication that publishes updates and deletes. Replication and application of the updates and deletes gen

Re: Silence resource leaks alerts

2025-04-10 Thread Michael Paquier
On Thu, Apr 10, 2025 at 03:10:02PM -0300, Ranier Vilela wrote: > While it is arguable that this is a false warning, there is a benefit in > moving the initialization of the string buffer, silencing the warnings that > are presented in this case. > > 1. pg_overexplain.c > 2. ruleutils.c These code

Re: merge file_exists_in_directory and _fileExistsInDirectory functions and move into common file dumputils.c

2025-04-10 Thread Michael Paquier
On Thu, Apr 10, 2025 at 10:41:33PM +0530, Mahendra Singh Thalor wrote: > We have file_exists_in_directory function in pg_restore.c and same > code we are using in _fileExistsInDirectory function in pg_backup_archiver.c > also. > Here, I am attaching a patch to move these duplicate functions into >

Re: stats.sql fails during installcheck on mac

2025-04-10 Thread Michael Paquier
On Thu, Apr 10, 2025 at 04:39:45PM -0500, Sami Imseih wrote: > Also, The documentation for pg_stat_wal already makes this point clear > in [0] that "wal_sync is only > incremented when the wal_sync_method is either fdatasync, fsync or > fsync_writethrough". > > Perhaps, the same clarification will

Re: Proposal: Filter irrelevant change before reassemble transactions during logical decoding

2025-04-10 Thread Peter Smith
Hi Ajin, Some review comments for patch v16-0002. == doc/src/sgml/logicaldecoding.sgml 1. + To indicate that decoding can be skipped for the given change + change_type, return true; + false otherwise. /change change_type/change_type/ (don't need to say "change" twice) =

Re: stats.sql fails during installcheck on mac

2025-04-10 Thread Michael Paquier
On Thu, Apr 10, 2025 at 06:45:36PM -0500, Sami Imseih wrote: > IIUC, this is only an issue for wal syncing Yes, good catch. I have missed this effect of issue_xlog_fsync(), which has two callers. The first one in XLogWrite() never happens if wal_sync_method is open_sync or open_datasync. The se

Re: Feature Recommendations for Logical Subscriptions

2025-04-10 Thread Amit Kapila
On Fri, Apr 11, 2025 at 3:40 AM Peter Smith wrote: > > FYI, the Column List documentation [1] says > -- > However, do not rely on this feature for security: a malicious > subscriber is able to obtain data from columns that are not > specifically published. If security is a consideration, prote

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-04-10 Thread Thomas Munro
On Fri, Apr 11, 2025 at 5:50 AM James Hunter wrote: > I am looking at the pre-streaming code, in PG 17, as I am not familiar > with the PG 18 "streaming" code. Back in PG 17, nodeBitmapHeapscan.c > maintained two shared TBM iterators, for PQ. One of the iterators was > the actual, "fetch" iterator

Re: Proposal: Filter irrelevant change before reassemble transactions during logical decoding

2025-04-10 Thread Peter Smith
Hi Ajin, Here is another general review comment for patch 0001. ~~~ I keep getting confused by the distinction between the 2 member fields that are often found working hand-in-hand: entry->filterable rb->can_filter_change Unfortunately, because the names are very similar I keep blurring the mea

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

2025-04-10 Thread Andres Freund
Hi, On 2025-04-11 00:47:19 +0200, Matthias van de Meent wrote: > On Fri, 11 Apr 2025 at 00:27, Andres Freund wrote: > > > > Hi, > > > > On 2025-03-09 14:13:52 +0200, Alexander Korotkov wrote: > > > I've revised commit message, comments, formatting etc. > > > I'm going to push this if no objection

Re: Add connection active, idle time to pg_stat_activity

2025-04-10 Thread Richard Guo
On Fri, Apr 11, 2025 at 3:47 AM Robert Haas wrote: > I'd probably write the increments as ++ rather than += 1 but I'm not > sure if everyone would agree. I'm a fan of ++ as well, so I agree. Thanks Richard

Re: n_ins_since_vacuum stats for aborted transactions

2025-04-10 Thread David G. Johnston
On Thu, Apr 10, 2025 at 5:38 PM Sami Imseih wrote: > > On Fri, 11 Apr 2025 at 02:01, Sami Imseih wrote: > > > I created an entry for the July CF > > > https://commitfest.postgresql.org/patch/5691/ > > > > > > ... and I realized I forgot to include David's code comment patch > yesterday, > > > Re

Re: Add missing PGDLLIMPORT markings

2025-04-10 Thread Jacob Champion
On Wed, Apr 9, 2025 at 4:48 AM Daniel Gustafsson wrote: > -extern const pg_be_sasl_mech pg_be_oauth_mech; > +extern PGDLLIMPORT const pg_be_sasl_mech pg_be_oauth_mech; > +1 on this. LGTM, too. Thanks! --Jacob

Re: sync_standbys_defined read/write race on startup

2025-04-10 Thread Michael Paquier
On Thu, Apr 10, 2025 at 12:55:54PM +0300, Maksim.Melnikov wrote: > On 10.04.2025 12:15, Michael Paquier wrote: >> Hmm, yeah. Instead of last, it would be better to put it in second >> place perhaps, for clarity? That would be the same at the end, but we >> would be slightly more consistent with t

Re: Streaming relation data out of order

2025-04-10 Thread Thomas Munro
On Thu, Apr 10, 2025 at 7:35 AM Andres Freund wrote: > 1) Increase distance by * 2 + read_size on a miss > >This would help us to increase with distance = 1, where * 2 only increases >distance by 1, just as -1 obviously reduces it by 1. > >It'd also somewhat address the over-weighing o

Re: n_ins_since_vacuum stats for aborted transactions

2025-04-10 Thread Sami Imseih
> On Fri, 11 Apr 2025 at 02:01, Sami Imseih wrote: > > I created an entry for the July CF > > https://commitfest.postgresql.org/patch/5691/ > > > > ... and I realized I forgot to include David's code comment patch yesterday, > > Reattaching both patches. > > I've pushed the code comment patch. > >

Re: pg16 && GSSAPI && Heimdal/Macos

2025-04-10 Thread Todd M. Kover
> "Todd M. Kover" writes: > > 2) some option that makes the code path for gss_store_cred_into optional > > (what would you want to call it?) > > If we do this, I see no need to call it anything. Just make configure > probe for whether the selected GSS library has gss_store_cred_into. patch

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Jacob Champion
On Wed, Apr 9, 2025 at 4:42 PM Jelte Fennema-Nio wrote: > I think your suggestion of not using any .so files would best there (from w > user perspective). I'd be quite surprised if a static build still resulted in > me having to manage shared library files anyway. Done this way in v5. I had pla

Re: Fundamental scheduling bug in parallel restore of partitioned tables

2025-04-10 Thread Tom Lane
I wrote: > I think that the most intellectually rigorous solution is to > generate dummy TABLE DATA objects for partitioned tables, which > don't actually contain data but merely carry dependencies on > each of the child tables' TABLE DATA objects. Here's a draft patch for this. It seems to fix t

Re: n_ins_since_vacuum stats for aborted transactions

2025-04-10 Thread David Rowley
On Fri, 11 Apr 2025 at 02:01, Sami Imseih wrote: > I created an entry for the July CF > https://commitfest.postgresql.org/patch/5691/ > > ... and I realized I forgot to include David's code comment patch yesterday, > Reattaching both patches. I've pushed the code comment patch. For the docs patc

Re: stats.sql fails during installcheck on mac

2025-04-10 Thread Sami Imseih
> Hmm, that's a little nasty, because it's not showing up in the > buildfarm. It appears from a little testing that the issue only > manifests if you have fsync = on, which we generally don't on > buildfarm animals. right, "make check" does not encounter this because it runs with fsync=off, as I

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Ranier Vilela
Em qui., 10 de abr. de 2025 20:09, Andrew Dunstan escreveu: > > On 2025-04-10 Th 5:45 PM, Ranier Vilela wrote: > > > Em qui., 10 de abr. de 2025 às 15:58, Andrew Dunstan > escreveu: > >> >> On 2025-04-10 Th 2:38 PM, Ranier Vilela wrote: >> >> >>> >>> Thanks. I have pushed these now with a few fu

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Andrew Dunstan
On 2025-04-10 Th 5:45 PM, Ranier Vilela wrote: Em qui., 10 de abr. de 2025 às 15:58, Andrew Dunstan escreveu: On 2025-04-10 Th 2:38 PM, Ranier Vilela wrote: Thanks. I have pushed these now with a few further small tweaks. Sorry if it is not the right place. Coverit

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Hannu Krosing
On Tue, Apr 8, 2025 at 7:07 PM Tom Lane wrote: > > Nathan Bossart writes: > > I do think it's worth considering going back to copying > > pg_largobject_metadata's files for upgrades from v16 and newer. > > (If we do this) I don't see why we'd need to stop at v16. I'm > envisioning that we'd use

Re: pgsql: Convert 'x IN (VALUES ...)' to 'x = ANY ...' then appropriate

2025-04-10 Thread David Rowley
On Mon, 7 Apr 2025 at 19:39, Melanie Plageman wrote: > +++ > C:/cirrus/build/testrun/pg_upgrade/002_pg_upgrade/data/results/subselect.out > 2025-04-04 14:47:20.358393500 + > @@ -2769,15 +2769,16 @@ > EXPLAIN (COSTS OFF) > SELECT c.oid,c.relname FROM pg_class c JOIN pg_am a USING (oid) > WH

Re: libpq maligning postgres stability

2025-04-10 Thread Bruce Momjian
On Thu, Mar 27, 2025 at 11:48:26AM -0400, Robert Haas wrote: > On Thu, Mar 27, 2025 at 11:19 AM Andres Freund wrote: > > We have several places in libpq where libpq says that a connection closing > > is > > probably due to a server crash with a message like: > > > > server closed the connection u

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Nathan Bossart
On Tue, Apr 08, 2025 at 01:42:20PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> Unless I'm missing something, we don't seem to have had any dependency >> handling before commit 12a53c7. Was that broken before we moved to SQL >> commands? > > Sounds like it :-( Huh. Sure enough, it seems

Re: track generic and custom plans in pg_stat_statements

2025-04-10 Thread Sami Imseih
> After the introduction of pg_overexplain extension and Robert's comment > [0], I'm starting to have doubts about whether it's still appropriate to > add this information to EXPLAIN itself. If there are compelling reasons > that showing the plan type would be broadly useful to users in EXPLAIN, >

Re: Memoize ANTI and SEMI JOIN inner

2025-04-10 Thread Andrei Lepikhov
On 4/9/25 08:48, Richard Guo wrote: Perhaps we could spend some planner cycles proving inner_unique for anti joins, so that Memoize nodes can be considered for them? Thanks for working on it! It is an example I have eagerly wanted to find. So, no rush this feature now, I add it to the July commi

Re: tab complete for COPY populated materialized view TO

2025-04-10 Thread Fujii Masao
On 2025/04/09 18:25, Kirill Reshke wrote: On Wed, 9 Apr 2025 at 13:23, jian he wrote: hi. we allow the "COPY table TO" command to copy rows from materialized views in [1]. The attached patch is to add a tab complete for it. [1] https://git.postgresql.org/cgit/postgresql.git/commit/?id=53

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

2025-04-10 Thread Matthias van de Meent
On Fri, 11 Apr 2025 at 00:27, Andres Freund wrote: > > Hi, > > On 2025-03-09 14:13:52 +0200, Alexander Korotkov wrote: > > I've revised commit message, comments, formatting etc. > > I'm going to push this if no objections. > > I'm rather confused as to why this is a thing to push at this point? Th

Re: Improve a few appendStringInfo calls new to v18

2025-04-10 Thread David Rowley
On Fri, 11 Apr 2025 at 02:51, Nathan Bossart wrote: > This probably isn't v18 material, but this reminds me of my idea to change > appendStringInfoString() into a macro for appendBinaryStringInfo() so that > the compiler can remove the runtime strlen() calls for string literals [0]. > In most case

Re: Add missing PGDLLIMPORT markings

2025-04-10 Thread Daniel Gustafsson
> On 9 Apr 2025, at 13:48, Daniel Gustafsson wrote: >> On 9 Apr 2025, at 12:02, Peter Eisentraut wrote: >> could probably do with a less generic name? > > Good point, unless objected to I'll apply the attached renaming which then > also > contain the PGDLLIMPORT addition. Done. -- Daniel Gus

Re: stats.sql fails during installcheck on mac

2025-04-10 Thread Tom Lane
Sami Imseih writes: > When running "make installcheck" on my mac, I ran into a failure: > @@ -1459,7 +1459,7 @@ > OR :io_sum_wal_normal_after_fsyncs > :io_sum_wal_normal_before_fsyncs; > ?column? > -- > - t > + f > (1 row) Hmm, that's a little nasty, because it's not showing up in t

Re: track generic and custom plans in pg_stat_statements

2025-04-10 Thread Sami Imseih
rebased in the attached v5. -- Sami Imseih Amazon Web Services (AWS) v5-0001-Add-plan_cache-counters-to-pg_stat_statements.patch Description: Binary data

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-10 Thread Tom Lane
Chapman Flack writes: > This was really bumming me out. I thought "what on earth does that do > to the rest of your surrounding query, say if you have anyelement types > in the args or return value also?". > So the answer to that part is easy: if a routine's types include both > anyarray and anye

Re: [PATCH] clarify palloc comment on quote_literal_cstr

2025-04-10 Thread Michael Paquier
On Tue, Apr 08, 2025 at 08:47:53AM +0530, Ashutosh Bapat wrote: > Thanks for addressing the comment. > > In PG code, we start a multiline comment with just /* on the first > line and end with just */ on the last line. All the lines in-between > start with * . Please check other comments in the fil

Re: [PoC] Reducing planning time when tables have many partitions

2025-04-10 Thread Amit Langote
On Wed, Apr 9, 2025 at 2:21 PM David Rowley wrote: > On Wed, 9 Apr 2025 at 17:09, Amit Langote wrote: > > Should the following paragraph in src/backend/optimizer/README be > > updated to reflect the new reality after recent changes? > > > > An EquivalenceClass can contain "em_is_child" member

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

2025-04-10 Thread Andres Freund
Hi, On 2025-03-09 14:13:52 +0200, Alexander Korotkov wrote: > I've revised commit message, comments, formatting etc. > I'm going to push this if no objections. I'm rather confused as to why this is a thing to push at this point? This doesn't seem to be a bugfix and it's post feature freeze. Andr

Re: Improve a few appendStringInfo calls new to v18

2025-04-10 Thread David Rowley
On Thu, 10 Apr 2025 at 20:24, Heikki Linnakangas wrote: > > On 10/04/2025 06:51, David Rowley wrote: > > Any objections to doing this soonish? Or in a few weeks? > > Sure, let's do it. Why would we wait? Great. Pushed. Was considering waiting as I didn't know if there was a revert-fest looming o

Re: Feature Recommendations for Logical Subscriptions

2025-04-10 Thread Peter Smith
Hi, FYI, the Column List documentation [1] says -- However, do not rely on this feature for security: a malicious subscriber is able to obtain data from columns that are not specifically published. If security is a consideration, protections can be applied at the publisher side. -- IIRC,

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Ranier Vilela
Em qui., 10 de abr. de 2025 às 15:58, Andrew Dunstan escreveu: > > On 2025-04-10 Th 2:38 PM, Ranier Vilela wrote: > > >> >> Thanks. I have pushed these now with a few further small tweaks. >> > Sorry if it is not the right place. > Coverity has another resource leak alert. > > trivial patch attac

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Jacob Champion
On Wed, Apr 9, 2025 at 1:14 AM Christoph Berg wrote: > One design goal could be reproducible builds-alike, that is, have > libpq configured with or without libcurl be completely identical, and > the feature being present is simply the libpq-oauth.so file existing > or not. That might make using pl

Re: Logging which local address was connected to in log_line_prefix

2025-04-10 Thread Robert Haas
On Mon, Apr 7, 2025 at 11:59 AM Tom Lane wrote: > Robert Haas writes: > > The only thing that makes me a little bit sad is that we don't seem to > > have added this to pg_stat_activity. > > Hmm, that seems like it'd be a completely separate discussion. Yes, not something we should try to squeeze

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Jacob Champion
On Tue, Apr 8, 2025 at 9:02 AM Wolfgang Walther wrote: > How does the proposal with a loadable module affect a static libpq.a? The currently proposed patch would have you package and install a separate .so module implementing OAuth, which the staticlib would load once when needed. Similarly to ho

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Jacob Champion
On Tue, Apr 8, 2025 at 2:32 PM Jacob Champion wrote: > I think the module should be using > libpq's libpq_gettext(). (Which we could do, again through the magic > of dependency injection.) To illustrate what I mean, v3 introduces an initialization function that names the three internal dependenci

Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c

2025-04-10 Thread Heikki Linnakangas
On 09/04/2025 17:23, Tom Lane wrote: Heikki Linnakangas writes: Inconsistency is not good either though. I'm not sure it's worth the churn, but I could get on board a patch to actually replace all HeapTupleIsValid(tuple) calls with plain "tuple != NULL" checks. Keep HeapTupleIsValid() just for

stats.sql fails during installcheck on mac

2025-04-10 Thread Sami Imseih
Hi, When running "make installcheck" on my mac, I ran into a failure: """ @@ -1459,7 +1459,7 @@ OR :io_sum_wal_normal_after_fsyncs > :io_sum_wal_normal_before_fsyncs; ?column? -- - t + f (1 row) -- Change the tablespace so that the table is rewritten directly, then SELECT """ whic

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-10 Thread Alvaro Herrera
On 2025-Apr-07, Tom Lane wrote: > Alvaro Herrera writes: > > I have pushed this after some small additional changes. > > Looks like some of the test cases have issues with locale-dependent > ordering. > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=jay&dt=2025-04-07%2017%3A56%3A49

Re: Enhancing Memory Context Statistics Reporting

2025-04-10 Thread Rahila Syed
> > > > That's not an argument against moving it to BaseInit() though, as that's > called before procsignal is even initialized and before signals are > unmasked. > Yes, OK. > I don't really understand why DSA_DEFAULT_INIT_SEGMENT_SIZE is > > > > something that makes sense to use here? > > > > >

tab complete for COPY populated materialized view TO

2025-04-10 Thread jian he
hi. we allow the "COPY table TO" command to copy rows from materialized views in [1]. The attached patch is to add a tab complete for it. [1] https://git.postgresql.org/cgit/postgresql.git/commit/?id=534874fac0b34535c9a5ab9257d6574f78423578 From c016a14b42d4f23bf5ece7ab8374d6e93bc5646f Mon Sep 1

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Jacob Champion
On Mon, Apr 7, 2025 at 10:05 AM Andres Freund wrote: > On 2025-04-07 09:41:25 -0700, Jacob Champion wrote: > > Ah, you mean if the RPATH'd build doesn't have a flow, but the > > globally installed one (with a different ABI) does? Yeah, that would > > be a problem. > > That and more: Even if the RP

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Christoph Berg
Re: Jacob Champion > > Putting the minor version into the filename would make looking at > > package diffs harder when upgrading. Do we really need this as opposed > > to some hardcoded number like libpq.so.5.18 ? > > > > Perhaps reusing the number from libpq.so.5.18 also for this lib would > > be

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Jacob Champion
Hi all, Thanks for all the feedback! I'll combine them all into one email: On Mon, Apr 7, 2025 at 6:59 AM Peter Eisentraut wrote: > Looks mostly ok. I need the following patch to get it to build on macOS: > [...] > (The second change is not strictly required, but it disables the use of > -bundl

RE: Draft for basic NUMA observability

2025-04-10 Thread Shinoda, Noriyoshi (SXD Japan FSI)
Hi, Thanks for developing this great feature. The manual says that the 'size' column of the pg_shmem_allocations_numa view is 'int4', but the implementation is 'int8'. The attached small patch fixes the manual. Regards, Noriyoshi Shinoda -Original Message- From: Tomas Vondra Sent:

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-10 Thread Tom Lane
Alvaro Herrera writes: > I have pushed this after some small additional changes. Looks like some of the test cases have issues with locale-dependent ordering. https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=jay&dt=2025-04-07%2017%3A56%3A49 regards, tom lane

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Tom Lane
Nathan Bossart writes: > On Tue, Apr 08, 2025 at 09:35:24AM +0200, Hannu Krosing wrote: >> Changing the LO export to dumping pg_largeobject_metadata content >> instead of creating the LOs should be a nice small change confined to >> pg_dump --binary-upgrade only so perhaps we could squeeze it in v

wrong comments in rewriteTargetListIU

2025-04-10 Thread jian he
hi. in function, rewriteTargetListIU we have: for (attrno = 1; attrno <= numattrs; attrno++) { /* * Can only insert DEFAULT into generated columns, regardless of * any OVERRIDING clauses. */ if (att_tup->attgenerated && !apply_default

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-10 Thread Andres Freund
Hi, On 2025-04-07 18:38:19 +0200, Peter Eisentraut wrote: > On 07.04.25 16:43, Andres Freund wrote: > > There recently was a breakage of building with PG on macos with meson, due > > to > > the meson folks implementing a feature request to move away from using > > bundles, as > > 1) bundles appar

Re: Fwd: [BUG]: the walsender does not update its IO statistics until it exits

2025-04-10 Thread Michael Paquier
On Mon, Apr 07, 2025 at 07:13:20AM +, Bertrand Drouvot wrote: > As we now have 2 code paths I think we "really" need 2 tests. The attached > (to apply on top of v7) seems to do the job. Confirmed. I am sold on this extra location on HEAD, and it does not impact the run time of the test as the

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-04-10 Thread Tom Lane
Robert Haas writes: > It's not quite the same complaint, because the earlier complaint was > that it was actually being done at parse time, and this complaint is > that it is scribbling on a parse-time data structure. Ah, right. But that's still not the direction we want to be going in [1].

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-10 Thread Shayon Mukherjee
On Mon, Apr 7, 2025 at 5:39 PM Sami Imseih wrote: > > Attached v16 with feedback and rebased. > > Thanks, and I realized the original tab-complete I proposed > was not entirely correct. I fixed it and also shortened the > commit message. I was wondering about if the check needed to be more enco

Re: Partition pruning on parameters grouped into an array does not prune properly

2025-04-10 Thread Amit Langote
On Thu, Mar 27, 2025 at 9:59 AM David Rowley wrote: > On Thu, 27 Mar 2025 at 04:19, Andrei Lepikhov wrote: > > But if we partition on HASH(x,y) it is not working (see > > incorrect-pruning-example.sql): > > > > PREPARE test2 (int,int) AS > > SELECT 1 FROM array_prune > > WHERE id1 = ANY(ARRAY

Re: Modern SHA2- based password hashes for pgcrypto

2025-04-10 Thread Bernd Helmle
Am Sonntag, dem 06.04.2025 um 15:43 -0400 schrieb Tom Lane: > What this is on about is that portable use of isalpha() or isdigit() > requires casting a "char" value to "unsigned char".  I was about to > make that simple change when I started to question if we actually > want to be using here at al

Re: [PoC] Reducing planning time when tables have many partitions

2025-04-10 Thread Yuya Watari
Hello David, On Tue, Apr 8, 2025 at 3:31 PM David Rowley wrote: > > I've pushed the patch now. Thanks for all the reviews of my adjustments. Thank you very much for pushing the patch! I also wish to extend my deepest thanks to everyone who has contributed to reviewing and improving this patch.

Re: Restrict publishing of partitioned table with a foreign table as partition

2025-04-10 Thread Álvaro Herrera
Here's the additional changes I made here before giving up on this. I think it needs some additional rethinking, not going to happen for 18. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "The Gord often wonders why people threaten never to come back after they'v

Re: Feature freeze

2025-04-10 Thread Euler Taveira
On Tue, Apr 8, 2025, at 2:15 PM, Tom Lane wrote: > There is nothing whatsoever that is helpful about referring to AoE, > and if anything, you just made it even clearer that nobody knows > what that means. Agreed. Maybe that is a good idea to put a countdown timer [1] in the website ([2] or a new p

Re: Draft for basic NUMA observability

2025-04-10 Thread Tomas Vondra
On 4/7/25 19:24, Andres Freund wrote: > On 2025-04-04 19:07:12 +0200, Jakub Wartak wrote: >> They actually look good to me. We've discussed earlier dropping >> s/numa_//g for column names (after all views contain it already) so >> they are fine in this regard. >> There's also the question of consis

Re: [PATCH] clarify palloc comment on quote_literal_cstr

2025-04-10 Thread Tom Lane
Michael Paquier writes: > Hmm. I don't think that grouping all these details in the same > comment block is an improvement in this case compared to the first > version, where it is clear which part of the calculation applies to > what. In short, I'm OK with how things are on HEAD. +1. When I s

Re: Draft for basic NUMA observability

2025-04-10 Thread Jakub Wartak
On Mon, Apr 7, 2025 at 9:51 PM Tomas Vondra wrote: > > So it looks like that the new way to iterate on the buffers that has been > > introduced > > in v26/v27 has some issue? > > > > Yeah, the calculations of the end pointers were wrong - we need to round > up (using TYPEALIGN()) when calculatin

Re: BAS_BULKREAD vs read stream

2025-04-10 Thread Thomas Munro
On Tue, Apr 8, 2025 at 2:20 PM Andres Freund wrote: > In the attached I implemented the above idea, with some small additional > refinements: LGTM. How I wish EXPLAIN would show some clues about strategies...

Re: Modern SHA2- based password hashes for pgcrypto

2025-04-10 Thread Tom Lane
Bernd Helmle writes: > Here is a patch that tries to address all these issues (including > Andres' report). I've adjusted the error message and use ereport(), so > it might be more useful if we deal with not just single byte letters. I'd like to get mamba back to green, so I'll take care of this

Re: n_ins_since_vacuum stats for aborted transactions

2025-04-10 Thread Euler Taveira
On Wed, Apr 9, 2025, at 1:57 PM, Sami Imseih wrote: > I came across what appears to be incorrect behavior in the > pg_stat_all_tables.n_ins_since_vacuum > counter after a rollback. This is *not* an oversight. It is by design. See commit b07642dbcd8d. The documentation says Estimated number of r

Re: n_ins_since_vacuum stats for aborted transactions

2025-04-10 Thread David G. Johnston
On Wednesday, April 9, 2025, Sami Imseih wrote: > > In other words, the reason n_ins_since_vacuum was introduced is to freeze > (committed) rows, so it should not need to track dead rows to do what it > intends > to do. > n_ins_since_vacuum was introduced to indicate how many tuples a vacuum wou

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Hannu Krosing
On Tue, Apr 8, 2025 at 8:39 PM Nathan Bossart wrote: > ... > > I've also verified that the dependency information is carried over in > upgrades to later versions (AFAICT all the supported ones). If I remember correctly the change to not copying pg_largeobject_metadata data file but instead moving

Re: Correct documentation for protocol version

2025-04-10 Thread Dave Cramer
On Thu, 10 Apr 2025 at 12:17, Fujii Masao wrote: > > > On 2025/04/11 0:49, Dave Cramer wrote: > > > > > > On Thu, 10 Apr 2025 at 11:17, Fujii Masao > wrote: > > > > > > > > On 2025/04/10 23:40, Dave Cramer wrote: > > > > > > On Thu, 10 Apr 2025 a

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-04-10 Thread Robert Haas
On Thu, Apr 10, 2025 at 3:54 PM Tom Lane wrote: > > A related point that I'm noticing is that you record the not-NULL > > information in the RangeTblEntry. > > Did we not just complain about that w.r.t. the v1 version of this > patch? RangeTblEntry is not where to store this info. We need > a ne

Re: Add pg_buffercache_evict_all() and pg_buffercache_mark_dirty[_all]() functions

2025-04-10 Thread Robert Haas
On Tue, Mar 18, 2025 at 6:03 PM Aidar Imamov wrote: > > for (int buf = 1; buf < NBuffers; buf++) > Mb it would be more correct to use <= NBuffers? I agree that (int buf = 1; buf < NBuffers; buf++) isn't right because that iterates one fewer times than the number of buffers. What was ultimately co

Re: pgsql: Add function to get memory context stats for processes

2025-04-10 Thread Andres Freund
Hi, On 2025-04-10 09:31:00 -0400, Robert Haas wrote: > On Tue, Apr 8, 2025 at 5:10 AM Daniel Gustafsson > wrote: > > Add function to get memory context stats for processes > > Apologies if this has already been discussed, but what is the argument > that it is safe to do everything in ProcessGetM

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-04-10 Thread Tom Lane
Robert Haas writes: > OK. Maybe I shouldn't be worrying about the table_open() / > table_close() here, because I see that you are right that > has_subclass() is nearby, which admittedly does not involve opening > the relation, but it does involve fetching from the syscache a tuple > that we wouldn

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-04-10 Thread Robert Haas
On Sun, Apr 6, 2025 at 10:59 PM Richard Guo wrote: > That's correct. As I mentioned earlier, I believe attnotnull isn't > the only piece of information we need to gather early on. My general > idea is to separate the collection of catalog information into two > phases: > > * Phase 1 occurs at an

Re: tab complete for COPY populated materialized view TO

2025-04-10 Thread Kirill Reshke
On Fri, 11 Apr 2025 at 00:33, David G. Johnston wrote: > > They are supported for the From variant; valid completions need only satisfy > one of to/from, not both. > Thank you. If so, then WFM, and I don't have any more objections. -- Best regards, Kirill Reshke

Re: tab complete for COPY populated materialized view TO

2025-04-10 Thread David G. Johnston
On Thursday, April 10, 2025, Kirill Reshke wrote: > On Thu, 10 Apr 2025 at 20:07, Fujii Masao > wrote: > > > > > > > > On 2025/04/09 19:24, Kirill Reshke wrote: > > > On Wed, 9 Apr 2025 at 14:45, Fujii Masao > wrote: > > >> > > >> > > >> > > >> On 2025/04/09 18:25, Kirill Reshke wrote: > > >>>

Re: tab complete for COPY populated materialized view TO

2025-04-10 Thread Kirill Reshke
On Thu, 10 Apr 2025 at 20:07, Fujii Masao wrote: > > > > On 2025/04/09 19:24, Kirill Reshke wrote: > > On Wed, 9 Apr 2025 at 14:45, Fujii Masao > > wrote: > >> > >> > >> > >> On 2025/04/09 18:25, Kirill Reshke wrote: > >>> On Wed, 9 Apr 2025 at 13:23, jian he wrote: > > hi. > > >

catcache search while BUFFER_LOCK_EXCLUSIVE on catalog

2025-04-10 Thread Noah Misch
Given the severity of the (never released) bug that commit 0bada39 fixed, I felt I owed improvements to our ability to detect the next bug like it. The attached patch adds pertinent assertions. For obstacles to the original bug detection, see Appendix 1. One of the exceptions this patch allows i

Re: Improve documentation regarding custom settings, placeholders, and the administrative functions

2025-04-10 Thread David G. Johnston
On Fri, Apr 4, 2025 at 5:19 AM Heikki Linnakangas wrote: > On 19/10/2024 23:11, David G. Johnston wrote: > > diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml > > index 934ef5e469..4478d0aa91 100644 > > --- a/doc/src/sgml/config.sgml > > +++ b/doc/src/sgml/config.sgml > > @@ -23,7

Re: An incorrect check in get_memoize_path

2025-04-10 Thread Andrei Lepikhov
On 4/7/25 09:50, Richard Guo wrote: Consider the join to t3. It is a unique join, and not all of its restriction clauses are parameterized. Despite this, the check still passes. At least, this code looks more simple to understand, more 'armored' and worth to change. At the same time I think te

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Tom Lane
Hannu Krosing writes: > I think we do preserve role oids Oh ... I'd been looking for mentions of "role" in pg_upgrade_support.c, but what I should have looked for was "pg_authid". So yeah, we do preserve role OIDs, and maybe that's enough to make this workable, at least with source versions that

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Andrew Dunstan
On 2025-04-10 Th 2:38 PM, Ranier Vilela wrote: Thanks. I have pushed these now with a few further small tweaks. Sorry if it is not the right place. Coverity has another resource leak alert. trivial patch attached. Thanks for checking. Pushed. cheers andrew -- Andrew Dunstan ED

Re: Add connection active, idle time to pg_stat_activity

2025-04-10 Thread Robert Haas
Hi, For the most part this patch looks like it's in pretty good shape to me, although I am less sold on the desirability of it than it sounds like most people are. I do think it can be useful, and it seems to mostly piggyback on existing time measurements, so it should be pretty cheap. But I'm jus

Re: Non-text mode for pg_dumpall

2025-04-10 Thread Ranier Vilela
Hi. Em sex., 4 de abr. de 2025 às 17:11, Andrew Dunstan escreveu: > > On 2025-04-04 Fr 5:12 AM, Mahendra Singh Thalor wrote: > > On Fri, 4 Apr 2025 at 13:52, Mahendra Singh Thalor > wrote: > > On Fri, 4 Apr 2025 at 01:17, Andrew Dunstan > wrote: > > On 2025-04-01 Tu 1:59 AM, Mahendra Singh

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-04-10 Thread Mahendra Singh Thalor
On Mon, 7 Apr 2025 at 02:40, Andrew Dunstan wrote: > > > On 2025-04-06 Su 1:51 PM, Tom Lane wrote: > > =?utf-8?Q?=C3=81lvaro?= Herrera writes: > >> On 2025-Apr-06, Tom Lane wrote: > >>> If we can cite the SQL standard then it's an entirely defensible > >>> restriction. > >> We can. It says (in 5

Silence resource leaks alerts

2025-04-10 Thread Ranier Vilela
Hi. Per Coverity. Coverity has some alerts about resource leaks. I think that is good silence. While it is arguable that this is a false warning, there is a benefit in moving the initialization of the string buffer, silencing the warnings that are presented in this case. 1. pg_overexplain.c 2.

Re: pg16 && GSSAPI && Heimdal/Macos

2025-04-10 Thread Nico Williams
On Wed, Dec 06, 2023 at 06:54:22PM -0500, kov...@omniscient.com wrote: > I wanted to follow up on the decision to blow off Apple's built-in > GSSAPI. Years back, for reasons I never found, Apple switched from MIT > to Heimdal and have been maintaining their own version of it. I'm not > clear how

Re: Some problems regarding the self-join elimination code

2025-04-10 Thread Andrei Lepikhov
On 4/9/25 04:05, Richard Guo wrote: On Tue, Apr 8, 2025 at 11:12 PM Dean Rasheed wrote: On Tue, 8 Apr 2025 at 12:31, Andrei Lepikhov wrote: Perhaps the way to do it is to make ChangeVarNodesExtended() take a callback function to be invoked for each node visited. The callback (which would then

Re: Horribly slow pg_upgrade performance with many Large Objects

2025-04-10 Thread Nathan Bossart
On Tue, Apr 08, 2025 at 01:07:09PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> I do think it's worth considering going back to copying >> pg_largobject_metadata's files for upgrades from v16 and newer. > > (If we do this) I don't see why we'd need to stop at v16. I'm > envisioning that we

Re: [PATCH] clarify palloc comment on quote_literal_cstr

2025-04-10 Thread Michael Paquier
On Tue, Apr 08, 2025 at 01:26:59AM -0400, Tom Lane wrote: > +1. When I saw the patch I was mainly afraid that pgindent would > make a hash of it. Yes. I was actually surprised to see that it did not mess up with the code generated. -- Michael signature.asc Description: PGP signature

  1   2   >