Re: Statistics Import and Export

2024-03-27 Thread Corey Huinker
> > > > +\gexec > > Why do we need to construct the command and execute? Can we instead > execute the function directly? That would also avoid ECHO magic. > We don't strictly need it, but I've found the set-difference operation to be incredibly useful in diagnosing problems. Additionally, the

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

2024-03-27 Thread Donghang Lin
On Mon, Mar 25, 2024 at 2:11 PM Melanie Plageman wrote: > As for whether or not per-worker stats should be displayed by default > or only with VERBOSE, it sounds like there are two different > precedents. I don't have a strong feeling one way or the other. > Whichever is most consistent. >

Re: pgsql: Track last_inactive_time in pg_replication_slots.

2024-03-27 Thread Bertrand Drouvot
Hi, On Wed, Mar 27, 2024 at 12:28:06PM +0530, Bharath Rupireddy wrote: > On Wed, Mar 27, 2024 at 10:10 AM Amit Kapila wrote: > > > > On Tue, Mar 26, 2024 at 9:10 PM Alvaro Herrera > > wrote: > > > > > > On 2024-Mar-26, Nathan Bossart wrote: > > > > > > > FWIW I'd really prefer to have

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread shveta malik
On Wed, Mar 27, 2024 at 11:05 AM Bharath Rupireddy wrote: > > Fixed an issue in synchronize_slots where DatumGetLSN is being used in > place of DatumGetTimestampTz. Found this via CF bot member [1], not on > my dev system. > > Please find the attached v6 patch. Thanks for the patch. Few trivial

Re: Propagate pathkeys from CTEs up to the outer query

2024-03-27 Thread Richard Guo
On Wed, Mar 27, 2024 at 1:20 AM Tom Lane wrote: > Richard Guo writes: > > I agree with your points. Previously I was thinking that CTEs were the > > only scenario where we needed to remember the best path and only > > required the best path's pathkeys. However, considering potential > >

Re: pgsql: Track last_inactive_time in pg_replication_slots.

2024-03-27 Thread Bharath Rupireddy
On Wed, Mar 27, 2024 at 10:10 AM Amit Kapila wrote: > > On Tue, Mar 26, 2024 at 9:10 PM Alvaro Herrera > wrote: > > > > On 2024-Mar-26, Nathan Bossart wrote: > > > > > FWIW I'd really prefer to have something like max_slot_xid_age for this. > > > A > > > time-based parameter would likely help

Re: pg_upgrade and logical replication

2024-03-27 Thread vignesh C
On Mon, 19 Feb 2024 at 12:38, Amit Kapila wrote: > > On Mon, Feb 19, 2024 at 6:54 AM Hayato Kuroda (Fujitsu) > wrote: > > > > Thanks for reviewing! PSA new version. > > > > Pushed this after making minor changes in the comments. Recently there was a failure in 004_subscription tap test at [1].

Re: Statistics Import and Export

2024-03-27 Thread Corey Huinker
> > 1) The docs say this: > > >The purpose of this function is to apply statistics values in an >upgrade situation that are "good enough" for system operation until >they are replaced by the next ANALYZE, usually via >autovacuum This function is used by >pg_upgrade and

Re: Change GUC hashtable to use simplehash?

2024-03-27 Thread John Naylor
On Wed, Mar 20, 2024 at 11:01 PM Jeff Davis wrote: > > > I found that adding __attribute__((no_sanitize_address)) to > > fasthash_accum_cstring_aligned() passes CI. While this kind of > > exception is warned against (for good reason), I think it's fine here > > given that glibc and NetBSD, and

RE: pg_upgrade and logical replication

2024-03-27 Thread Hayato Kuroda (Fujitsu)
Dear Vignesh, > > Recently there was a failure in 004_subscription tap test at [1]. > In this failure, the tab_upgraded1 table was expected to have 51 > records but has only 50 records. Before the upgrade both publisher and > subscriber have 50 records. Good catch! > After the upgrade we have

Re: Remove some redundant set_cheapest() calls

2024-03-27 Thread Richard Guo
On Wed, Mar 27, 2024 at 4:06 AM Tom Lane wrote: > Richard Guo writes: > > I happened to notice that the set_cheapest() calls in functions > > set_namedtuplestore_pathlist() and set_result_pathlist() are redundant, > > as we've centralized the set_cheapest() calls in set_rel_pathlist(). > > >

Re: Properly pathify the union planner

2024-03-27 Thread Tom Lane
Richard Guo writes: > On Wed, Mar 27, 2024 at 6:34 PM David Rowley wrote: >> The attached is roughly what I had in mind. I've not taken the time >> to see what comments need to be updated, so the attached aims only to >> assist discussion. > I like this idea. I haven't studied the underlying

Re: Fix parallel vacuum buffer usage reporting

2024-03-27 Thread Masahiko Sawada
Hi, Thank you for the report. On Fri, Feb 9, 2024 at 6:10 PM Anthonin Bonnefoy wrote: > > Hi, > > With a db setup with pgbench, we add an additional index: > CREATE INDEX ON pgbench_accounts(abalance) > > And trigger several updates and vacuum to reach a stable amount of > dirtied pages: >

Re: Properly pathify the union planner

2024-03-27 Thread David Rowley
On Thu, 28 Mar 2024 at 15:56, Tom Lane wrote: > I haven't studied the underlying problem yet, so I'm not quite > buying into whether we need this struct at all ... The problem is, when planning a UNION child query, we want to try and produce some Paths that would suit the top-level UNION query

Re: Proposal: Introduce row-level security templates

2024-03-27 Thread Aadhav Vignesh
Hi Stojan, > I do think there should be the option to attach it immediately to > tables, something like `CREATE POLICY TEMPLATE ATTACH TO > AS ...` but it’s not a deal-breaker for me. I would say that because templates are not active until they’re > attached, the logic for “validating” the

Re: BUG: deadlock between autovacuum worker and client backend during removal of orphan temp tables with sequences

2024-03-27 Thread Akshat Jaimini
Hii, I am currently trying to review the submitted patch but I am not able to apply it to the master branch. Regards, Akshat Jaimini

Re: Properly pathify the union planner

2024-03-27 Thread Richard Guo
On Wed, Mar 27, 2024 at 6:34 PM David Rowley wrote: > On Wed, 27 Mar 2024 at 22:47, David Rowley wrote: > > I did wonder when first working on this patch if subquery_planner() > > should grow an extra parameter, or maybe consolidate some existing > > ones by passing some struct that provides

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread shveta malik
On Wed, Mar 27, 2024 at 9:00 PM Bharath Rupireddy wrote: > > Thanks. I'm attaching v29 patches. 0001 managing inactive_since on the > standby for sync slots. 0002 implementing inactive timeout GUC based > invalidation mechanism. > > Please have a look. Thanks for the patches. v29-001 looks good

Re: Change GUC hashtable to use simplehash?

2024-03-27 Thread Jeff Davis
On Wed, 2024-03-27 at 13:44 +0700, John Naylor wrote: > Thanks for the pointers! In v20-0001, I've drafted checking thes > spelling first, since pg_attribute_no_sanitize_alignment has a > similar > version check. Then it checks for no_sanitize_address using > __has_attribute, which goes back to

Re: Add pg_basetype() function to obtain a DOMAIN base type

2024-03-27 Thread jian he
On Thu, Mar 21, 2024 at 10:34 AM jian he wrote: > > On Mon, Mar 18, 2024 at 11:43 PM Tom Lane wrote: > > > > Alexander Korotkov writes: > > > On Mon, Mar 18, 2024 at 2:01 AM jian he > > > wrote: > > >> ` > > >> Datum > > >> pg_basetype(PG_FUNCTION_ARGS) > > >> { > > >> Oid oid; > > >> >

Re: Can't find not null constraint, but \d+ shows that

2024-03-27 Thread jian he
On Wed, Mar 27, 2024 at 10:26 PM Tender Wang wrote: > > Alvaro Herrera 于2024年3月26日周二 23:25写道: >> >> On 2024-Mar-26, Tender Wang wrote: >> >> > postgres=# CREATE TABLE t1(c0 int, c1 int); >> > postgres=# ALTER TABLE t1 ADD CONSTRAINT Q PRIMARY KEY(c0, c1); >> > postgres=# ALTER TABLE t1 DROP

Re: Streaming I/O, vectored I/O (WIP)

2024-03-27 Thread Thomas Munro
New version with some cosmetic/comment changes, and Melanie's read_stream_reset() function merged, as required by her sequential scan user patch. I tweaked it slightly: it might as well share code with read_stream_end(). I think setting distance = 1 is fine for now, and we might later want to

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

2024-03-27 Thread Masahiko Sawada
On Wed, Mar 27, 2024 at 5:43 PM Masahiko Sawada wrote: > > On Wed, Mar 27, 2024 at 9:25 AM John Naylor wrote: > > > > On Mon, Mar 25, 2024 at 8:07 PM Masahiko Sawada > > wrote: > > > > > > On Mon, Mar 25, 2024 at 3:25 PM John Naylor > > > wrote: > > > > > > > > On Fri, Mar 22, 2024 at 12:20 

Re: Add pg_basetype() function to obtain a DOMAIN base type

2024-03-27 Thread Tom Lane
jian he writes: > I noticed psql \dD didn't return the basetype of a domain. > one of the usage of this feature would be in psql \dD. Your 0002 will cause \dD to fail entirely against an older server. I'm not necessarily against adding this info, but you can't just ignore the expectations for

RE: Synchronizing slots from primary to standby

2024-03-27 Thread Zhijie Hou (Fujitsu)
Hi, When analyzing one BF error[1], we find an issue of slotsync: Since we don't perform logical decoding for the synced slots when syncing the lsn/xmin of slot, no logical snapshots will be serialized to disk. So, when user starts to use these synced slots after promotion, it needs to re-build

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-27 Thread Thomas Munro
With the unexplained but apparently somewhat systematic regression patterns on certain tests and settings, I wonder if they might be due to read_stream.c trying to form larger reads, making it a bit lazier. It tries to see what the next block will be before issuing the fadvise. I think that means

Re: Table AM Interface Enhancements

2024-03-27 Thread Pavel Borisov
Hi, Alexander! The revised rest of the patchset is attached. > 0001 (was 0006) – I prefer the definition of AcquireSampleRowsFunc to > stay in vacuum.h. If we move it to sampling.h then we would have to > add there includes to define Relation, HeapTuple etc. I'd like to > avoid this kind of

RE: Psql meta-command conninfo+

2024-03-27 Thread Maiquel Grassi
> Hi Nathan! > > Sorry for the delay, I was busy with other professional as well as personal > activities. > I made all the changes you suggested. I removed the variables and started > using > views "pg_stat_ssl" and "pg_stat_gssapi". I handled the PostgreSQL versioning > regarding the views

Re: New Table Access Methods for Multi and Single Inserts

2024-03-27 Thread Jeff Davis
On Wed, 2024-03-27 at 01:19 +0530, Bharath Rupireddy wrote: > > Similarly, with this new AM, the onus lies on the table AM > implementers to provide an implementation for these new AMs even if > they just do single inserts. Why not fall back to using the plain tuple_insert? Surely some table AMs

Query Regarding frame options initialization in Window aggregate state

2024-03-27 Thread Vallimaharajan G
Hi Team,      I am currently referring to the Postgres source code (psql (PostgreSQL) 14.3) and came across a particular section related to window aggregate initialization that has left me with a question. Specifically, I noticed a conditional case in the initialization of per aggregate

Re: Functions to return random numbers in a given range

2024-03-27 Thread Dean Rasheed
On Tue, 26 Mar 2024 at 06:57, Dean Rasheed wrote: > > Based on the reviews so far, I think this is ready for commit, so > unless anyone objects, I will do so in a day or so. > Committed. Thanks for the reviews. Regards, Dean

Re: Skip collecting decoded changes of already-aborted transactions

2024-03-27 Thread Masahiko Sawada
On Wed, Mar 27, 2024 at 8:49 PM Ajin Cherian wrote: > > > > On Mon, Mar 18, 2024 at 7:50 PM Masahiko Sawada wrote: >> >> >> In addition to these changes, I've made some changes to the latest >> patch. Here is the summary: >> >> - Use txn_flags field to record the transaction status instead of

Re: Adding OLD/NEW support to RETURNING

2024-03-27 Thread Dean Rasheed
On Wed, 27 Mar 2024 at 07:47, Jeff Davis wrote: > > This isn't a complete review, but I spent a while looking at this, and > it looks like it's in good shape. Thanks for looking. > I like the syntax, and I think the solution for renaming the alias > ("RETURNING WITH (new as n, old as o)") is a

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread Bertrand Drouvot
Hi, On Wed, Mar 27, 2024 at 05:55:05PM +0530, Bharath Rupireddy wrote: > On Wed, Mar 27, 2024 at 3:42 PM Bertrand Drouvot > Please see the attached v28 patch. Thanks! 1 === sorry I missed it in the previous review if (!(RecoveryInProgress() && slot->data.synced)) + {

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

2024-03-27 Thread Daniel Gustafsson
> On 25 Mar 2024, at 19:48, Andres Freund wrote: > I don't think it's that, but that the freebsd task tests the installcheck > equivalent in meson. I haven't checked what your patch is doing, but perhaps > the issue is that it's seeing global objects concurrently created by another > test?

Re: Skip collecting decoded changes of already-aborted transactions

2024-03-27 Thread Ajin Cherian
On Mon, Mar 18, 2024 at 7:50 PM Masahiko Sawada wrote: > > In addition to these changes, I've made some changes to the latest > patch. Here is the summary: > > - Use txn_flags field to record the transaction status instead of two > 'committed' and 'aborted' flags. > - Add regression tests. > -

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread Bharath Rupireddy
On Wed, Mar 27, 2024 at 3:42 PM Bertrand Drouvot wrote: > > 1 === > > My proposal (in text) but feel free to reword it: > > Note that the slots on the standbys that are being synced from a > primary server (whose synced field is true), will get the inactive_since value > from the corresponding

Re: Table AM Interface Enhancements

2024-03-27 Thread Pavel Borisov
> > This seems not needed, it's already inited to InvalidOid before. > +else > +accessMethod = default_table_access_method; > > + accessMethodId = InvalidOid; > > This code came from 374c7a22904. I don't insist on this simplification in > a patch 0002. > A correction of the code quote for

Re: DOCS: add helpful partitioning links

2024-03-27 Thread Ashutosh Bapat
LGTM. The commitfest entry is marked as RFC already. Thanks for taking care of the comments. -- Best Wishes, Ashutosh Bapat On Thu, Mar 28, 2024 at 5:54 AM Robert Treat wrote: > On Mon, Mar 25, 2024 at 6:43 AM Ashutosh Bapat > wrote: > > On Fri, Mar 22, 2024 at 10:58 PM Robert Treat

Re: pg_upgrade failing for 200+ million Large Objects

2024-03-27 Thread Michael Banck
Hi, On Sat, Mar 16, 2024 at 06:46:15PM -0400, Tom Lane wrote: > Laurenz Albe writes: > > On Fri, 2024-03-15 at 19:18 -0400, Tom Lane wrote: > >> This patch seems to have stalled out again. In hopes of getting it > >> over the finish line, I've done a bit more work to address the two > >> loose

Re: Properly pathify the union planner

2024-03-27 Thread David Rowley
On Wed, 27 Mar 2024 at 16:15, Richard Guo wrote: >if (root->parent_root != NULL && >root->parent_root->parse->setOperations != NULL && >IsA(root->parent_root->parse->setOperations, SetOperationStmt)) >qp_extra.setop = >(SetOperationStmt *)

Re: pg_upgrade failing for 200+ million Large Objects

2024-03-27 Thread Laurenz Albe
On Wed, 2024-03-27 at 10:20 +0100, Michael Banck wrote: > Also, is there a chance this is going to be back-patched? I guess it > would be enough if the ugprade target is v17 so it is less of a concern, > but it would be nice if people with millions of large objects are not > stuck until they are

Re: pg_combinebackup --copy-file-range

2024-03-27 Thread Jakub Wartak
On Tue, Mar 26, 2024 at 7:03 PM Tomas Vondra wrote: [..] > > That's really strange. Hi Tomas, but it looks like it's fixed now :) > > --manifest-checksums=NONE --copy-file-range without v20240323-2-0002: > > 27m23.887s > > --manifest-checksums=NONE --copy-file-range with v20240323-2-0002 and >

Re: Parallel Aggregates for string_agg and array_agg

2024-03-27 Thread David Rowley
On Wed, 27 Mar 2024 at 03:00, Alexander Lakhin wrote: > I've discovered that the test query: > -- Ensure parallel aggregation is actually being used. > explain (costs off) select * from v_pagg_test order by y; > > added by 16fd03e95 fails sometimes. For instance: >

Re: Improve eviction algorithm in ReorderBuffer

2024-03-27 Thread Shubham Khanna
On Tue, Mar 5, 2024 at 8:50 AM vignesh C wrote: > > On Wed, 28 Feb 2024 at 11:40, Amit Kapila wrote: > > > > On Mon, Feb 26, 2024 at 7:54 PM Masahiko Sawada > > wrote: > > > > > > > A few comments on 0003: > > === > > 1. > > +/* > > + * Threshold of the total number of

Re: Can't find not null constraint, but \d+ shows that

2024-03-27 Thread Tender Wang
Alvaro Herrera 于2024年3月26日周二 23:25写道: > On 2024-Mar-26, Tender Wang wrote: > > > postgres=# CREATE TABLE t1(c0 int, c1 int); > > postgres=# ALTER TABLE t1 ADD CONSTRAINT Q PRIMARY KEY(c0, c1); > > postgres=# ALTER TABLE t1 DROP c1; > > > > postgres=# ALTER TABLE t1 ALTER c0 DROP NOT NULL; >

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread Bertrand Drouvot
Hi, On Wed, Mar 27, 2024 at 02:55:17PM +0530, Bharath Rupireddy wrote: > Please check the attached v27 patch which also has Bertrand's comment > on deduplicating the TAP function. I've now moved it to Cluster.pm. Thanks! 1 === +Note that the slots on the standbys that are being synced

Re: Flushing large data immediately in pqcomm

2024-03-27 Thread David Rowley
On Fri, 22 Mar 2024 at 12:46, Melih Mutlu wrote: > I did all of the above changes and it seems like those resolved the > regression issue. Thanks for adjusting the patch. The numbers do look better, but on looking at your test.sh script from [1], I see: meson setup --buildtype debug

Re: pg_upgrade and logical replication

2024-03-27 Thread Amit Kapila
On Wed, Mar 27, 2024 at 11:57 AM vignesh C wrote: > > The attached patch has changes to wait for regress_sub4 subscription > to apply the changes from the publisher before verifying the data. > Pushed after changing the order of wait as it looks logical to wait for regress_sub5 after enabling

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread Bharath Rupireddy
On Wed, Mar 27, 2024 at 11:39 AM shveta malik wrote: > > Thanks for the patch. Few trivial things: Thanks for reviewing. > -- > 1) > system-views.sgml: > > a) "Note that the slots" --> "Note that the slots on the standbys," > --it is good to mention "standbys" as synced could be true on

Re: Properly pathify the union planner

2024-03-27 Thread David Rowley
On Wed, 27 Mar 2024 at 22:47, David Rowley wrote: > I did wonder when first working on this patch if subquery_planner() > should grow an extra parameter, or maybe consolidate some existing > ones by passing some struct that provides the planner with a bit more > context about the query. A few of

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread shveta malik
On Wed, Mar 27, 2024 at 2:55 PM Bharath Rupireddy wrote: > > On Wed, Mar 27, 2024 at 11:39 AM shveta malik wrote: > > > > Thanks for the patch. Few trivial things: > > Thanks for reviewing. > > > -- > > 1) > > system-views.sgml: > > > > a) "Note that the slots" --> "Note that the slots

Re: pg_upgrade failing for 200+ million Large Objects

2024-03-27 Thread Michael Banck
Hi, On Wed, Mar 27, 2024 at 10:53:51AM +0100, Laurenz Albe wrote: > On Wed, 2024-03-27 at 10:20 +0100, Michael Banck wrote: > > Also, is there a chance this is going to be back-patched? I guess it > > would be enough if the ugprade target is v17 so it is less of a concern, > > but it would be

Re: Adding OLD/NEW support to RETURNING

2024-03-27 Thread Jeff Davis
On Tue, 2024-03-26 at 18:49 +, Dean Rasheed wrote: > On Mon, 25 Mar 2024 at 14:04, Dean Rasheed > wrote: > > > > v7 patch attached, with those updates. > > > > Rebased version attached, forced by 87985cc925. This isn't a complete review, but I spent a while looking at this, and it looks

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

2024-03-27 Thread Masahiko Sawada
On Wed, Mar 27, 2024 at 9:25 AM John Naylor wrote: > > On Mon, Mar 25, 2024 at 8:07 PM Masahiko Sawada wrote: > > > > On Mon, Mar 25, 2024 at 3:25 PM John Naylor wrote: > > > > > > On Fri, Mar 22, 2024 at 12:20 PM Masahiko Sawada > > > wrote: > > > > - * remaining LP_DEAD line pointers on the

Re: Propagate pathkeys from CTEs up to the outer query

2024-03-27 Thread David Rowley
On Wed, 27 Mar 2024 at 06:20, Tom Lane wrote: > That's not the fault of anything we did here; the IndexOnlyScan path > in the subquery is in fact not marked with any pathkeys, even though > clearly its result is sorted. I believe that's an intentional > decision from way way back, that pathkeys

Re: Why is parula failing?

2024-03-27 Thread David Rowley
On Wed, 27 Mar 2024 at 18:28, Tom Lane wrote: > > David Rowley writes: > > Unfortunately, REL_16_STABLE does not have the additional debugging, > > so don't get to know what reltuples was set to. > > Let's wait a bit to see if it fails in HEAD ... but if not, would > it be reasonable to

Re: Streaming I/O, vectored I/O (WIP)

2024-03-27 Thread Thomas Munro
On Thu, Mar 28, 2024 at 2:02 PM Thomas Munro wrote: > ... In practice on a non-toy system, that's always going to be > io_combine_limit. ... And to be more explicit about that: you're right that we initialise max_pinned_buffers such that it's usually at least io_combine_limit, but then if you

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

2024-03-27 Thread Masahiko Sawada
Hi, On Thu, Jan 18, 2024 at 5:33 PM Masahiko Sawada wrote: > > On Thu, Jan 18, 2024 at 4:59 PM Alexander Korotkov > wrote: > > > > On Thu, Jan 18, 2024 at 4:16 AM torikoshia > > wrote: > > > On 2024-01-18 10:10, jian he wrote: > > > > On Thu, Jan 18, 2024 at 8:57 AM Masahiko Sawada > > > >

Re: add AVX2 support to simd.h

2024-03-27 Thread Nathan Bossart
On Wed, Mar 27, 2024 at 04:37:35PM -0500, Nathan Bossart wrote: > On Wed, Mar 27, 2024 at 05:10:13PM -0400, Tom Lane wrote: >> LGTM otherwise, and I like the fact that the #if structure >> gets a lot less messy. > > Thanks for reviewing. I've attached a v2 that I intend to commit when I > get a

Re: Combine Prune and Freeze records emitted by vacuum

2024-03-27 Thread Melanie Plageman
On Thu, Mar 28, 2024 at 01:04:04AM +0200, Heikki Linnakangas wrote: > On 27/03/2024 20:26, Melanie Plageman wrote: > > On Wed, Mar 27, 2024 at 12:18 PM Heikki Linnakangas wrote: > > > > > > On 27/03/2024 17:18, Melanie Plageman wrote: > > > > I need some way to modify the control flow or

Re: Fix some resources leaks (src/bin/pg_basebackup/pg_createsubscriber.c)

2024-03-27 Thread Euler Taveira
On Wed, Mar 27, 2024, at 8:50 PM, Ranier Vilela wrote: > Coverity has some reports in the new code > pg_createsubscriber.c > I think that Coverity is right. It depends on your "right" definition. If your program execution is ephemeral and the leak is just before exiting, do you think it's worth

Re: Remove some redundant set_cheapest() calls

2024-03-27 Thread Richard Guo
On Wed, Mar 27, 2024 at 10:59 PM Tom Lane wrote: > Richard Guo writes: > > On Wed, Mar 27, 2024 at 4:06 AM Tom Lane wrote: > >> I'm less convinced about changing this. I'd rather keep it consistent > >> with mark_dummy_rel. > > > Hm, I wonder if we should revise the comment there that states

Re: pgsql: Track last_inactive_time in pg_replication_slots.

2024-03-27 Thread Robert Haas
On Wed, Mar 27, 2024 at 3:13 AM Bertrand Drouvot wrote: > Yeah, I think that both makes senses. The reason is that one depends of the > database activity and slot activity (the xid age one) while the other (the > timeout one) depends only of the slot activity. FWIW, I thought the time-based one

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Jelte Fennema-Nio
On Wed, 27 Mar 2024 at 02:24, Andrew Dunstan wrote: > Agree. I don’t think “_command” adds much clarity. Alright, changed the GUC name to "allow_alter_system" since that seems to have the most "votes". One other option would be to call it simply "alter_system", just like "jit" is not called

Re: pgsql: Track last_inactive_time in pg_replication_slots.

2024-03-27 Thread Robert Haas
On Wed, Mar 27, 2024 at 11:06 AM Nathan Bossart wrote: > IMHO the use-case where this doesn't work so well is when you have many, > many servers to administer (e.g., a cloud provider). In those cases, > picking a default timeout to try to prevent wraparound is going to be much > less accurate,

Re: pgsql: Allow using syncfs() in frontend utilities.

2024-03-27 Thread Robert Haas
On Wed, Mar 27, 2024 at 11:25 AM Nathan Bossart wrote: > Committed. Again, I apologize this took so long. No worries from my side; I only noticed recently. I guess Peter's been waiting a while, though. Thanks for committing. -- Robert Haas EDB: http://www.enterprisedb.com

Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs

2024-03-27 Thread Ranier Vilela
Em qua., 27 de mar. de 2024 às 13:41, Nathan Bossart < nathandboss...@gmail.com> escreveu: > On Wed, Mar 27, 2024 at 01:21:23PM -0300, Ranier Vilela wrote: > > Nathan Bossart writes: > >>Committed with that change. Thanks for the guidance on this one. > > > > I think that left an oversight in a

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Bruce Momjian
On Wed, Mar 27, 2024 at 03:43:28PM +0100, Jelte Fennema-Nio wrote: > + > + > + > +When allow_alter_system is set to > +on, an error is returned if the ALTER > +SYSTEM command is used. This parameter can only be set in > +the postgresql.conf file

Re: pgsql: Track last_inactive_time in pg_replication_slots.

2024-03-27 Thread Nathan Bossart
On Wed, Mar 27, 2024 at 10:33:28AM -0400, Robert Haas wrote: > FWIW, I thought the time-based one sounded more useful. I think it > would be poor planning to say "well, if the slot reaches an XID age of > a billion, kill it so we don't wrap around," because while that likely > will prevent me from

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Robert Haas
On Wed, Mar 27, 2024 at 10:43 AM Jelte Fennema-Nio wrote: > Alright, changed the GUC name to "allow_alter_system" since that seems > to have the most "votes". One other option would be to call it simply > "alter_system", just like "jit" is not called "allow_jit" or > "enable_jit". > > But

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

2024-03-27 Thread Tom Lane
Daniel Gustafsson writes: > The only option is to make the check opt-in via a command-line parameter for > use it in the main regress tests, and not use it for the contrib tests. The > attached v7 does that and passes CI, but I wonder if it's worth it all with > that restriction? Yeah, that

Re: Built-in CTYPE provider

2024-03-27 Thread Daniel Verite
Jeff Davis wrote: > The tests include initcap('123abc') which is '123abc' in the PG_C_UTF8 > collation vs '123Abc' in PG_UNICODE_FAST. > > The reason for the latter behavior is that the Unicode Default Case > Conversion algorithm for toTitlecase() advances to the next Cased > character

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

2024-03-27 Thread Daniel Gustafsson
> On 27 Mar 2024, at 16:26, Tom Lane wrote: > > Daniel Gustafsson writes: >> The only option is to make the check opt-in via a command-line parameter for >> use it in the main regress tests, and not use it for the contrib tests. The >> attached v7 does that and passes CI, but I wonder if it's

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread Bertrand Drouvot
Hi, On Wed, Mar 27, 2024 at 09:00:37PM +0530, Bharath Rupireddy wrote: > On Wed, Mar 27, 2024 at 6:54 PM Bertrand Drouvot > wrote: > > > > Hi, > > > > On Wed, Mar 27, 2024 at 05:55:05PM +0530, Bharath Rupireddy wrote: > > > On Wed, Mar 27, 2024 at 3:42 PM Bertrand Drouvot > > > Please see the

Re: Can't find not null constraint, but \d+ shows that

2024-03-27 Thread Tender Wang
Alvaro Herrera 于2024年3月26日周二 23:25写道: > On 2024-Mar-26, Tender Wang wrote: > > > postgres=# CREATE TABLE t1(c0 int, c1 int); > > postgres=# ALTER TABLE t1 ADD CONSTRAINT Q PRIMARY KEY(c0, c1); > > postgres=# ALTER TABLE t1 DROP c1; > > > > postgres=# ALTER TABLE t1 ALTER c0 DROP NOT NULL; >

Re: pg_upgrade failing for 200+ million Large Objects

2024-03-27 Thread Nathan Bossart
On Wed, Mar 27, 2024 at 10:54:05AM -0400, Tom Lane wrote: > Michael Banck writes: >> What is the status of this? In the commitfest, this patch is marked as >> "Needs Review" with Nathan as reviewer - Nathan, were you going to take >> another look at this or was your mail from January 12th a full

Re: Combine Prune and Freeze records emitted by vacuum

2024-03-27 Thread Melanie Plageman
On Tue, Mar 26, 2024 at 5:46 PM Melanie Plageman wrote: > > On Mon, Mar 25, 2024 at 09:33:38PM +0200, Heikki Linnakangas wrote: > > On 24/03/2024 18:32, Melanie Plageman wrote: > > > On Thu, Mar 21, 2024 at 9:28 AM Heikki Linnakangas > > > wrote: > > > > > > > > In heap_page_prune_and_freeze(),

Adding application_name to the error and notice message fields

2024-03-27 Thread Mitar
Hi! We take care to always set application_name to improve our log lines where we use %a in log_line_prefix to log application name, per [1]. But notices which are sent to the client do not have the application name and are thus hard to attribute correctly. Could "a" be added with the application

Re: Adding OLD/NEW support to RETURNING

2024-03-27 Thread Jeff Davis
On Wed, 2024-03-27 at 13:19 +, Dean Rasheed wrote: > What I'm most worried about now is that there are other areas of > functionality like that, that I'm overlooking, and which will > interact > with this feature in non-trivial ways. Agreed. I'm not sure exactly how we'd find those other

Re: Combine Prune and Freeze records emitted by vacuum

2024-03-27 Thread Heikki Linnakangas
On 27/03/2024 17:18, Melanie Plageman wrote: I need some way to modify the control flow or accounting such that I know which HEAPTUPLE_RECENTLY_DEAD tuples will not be marked LP_DEAD. And a way to consider freezing and do live tuple accounting for these and HEAPTUPLE_LIVE tuples exactly once.

Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs

2024-03-27 Thread Nathan Bossart
On Wed, Mar 27, 2024 at 01:21:23PM -0300, Ranier Vilela wrote: > Nathan Bossart writes: >>Committed with that change. Thanks for the guidance on this one. > > I think that left an oversight in a commit d365ae7 >

Re: Streaming I/O, vectored I/O (WIP)

2024-03-27 Thread Thomas Munro
On Wed, Mar 27, 2024 at 1:40 AM Heikki Linnakangas wrote: > Is int16 enough though? It seems so, because: > > max_pinned_buffers = Max(max_ios * 4, buffer_io_size); > > and max_ios is constrained by the GUC's maximum MAX_IO_CONCURRENCY, and > buffer_io_size is constrained by

Re: pgsql: Allow using syncfs() in frontend utilities.

2024-03-27 Thread Robert Haas
On Tue, Mar 26, 2024 at 12:34 PM Nathan Bossart wrote: > Here's a first attempt at a patch based on Robert's suggestion from > upthread. WFM. -- Robert Haas EDB: http://www.enterprisedb.com

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Robert Haas
On Wed, Mar 27, 2024 at 11:01 AM Bruce Momjian wrote: > Uh, the above is clearly wrong. I think you mean "off" on the second line. Woops. When the name changed from externally_managed_configuration to allow_alter_system, the sense of it was reversed, and I guess Jelte missed flipping the

Re: pgsql: Allow using syncfs() in frontend utilities.

2024-03-27 Thread Nathan Bossart
On Wed, Mar 27, 2024 at 10:41:42AM -0400, Robert Haas wrote: > On Tue, Mar 26, 2024 at 12:34 PM Nathan Bossart > wrote: >> Here's a first attempt at a patch based on Robert's suggestion from >> upthread. > > WFM. Committed. Again, I apologize this took so long. -- Nathan Bossart Amazon Web

Crash on UNION with PG 17

2024-03-27 Thread Regina Obe
Our PostGIS bot that follows master branch has been crashing for past couple of days on one of our tests https://trac.osgeo.org/postgis/ticket/5701 I traced the issue down to this commit: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=66c0185a3d14b bbf51d0fc9d267093ffec735231

Re: Flushing large data immediately in pqcomm

2024-03-27 Thread Robert Haas
On Wed, Mar 27, 2024 at 7:39 AM David Rowley wrote: > Robert, I understand you'd like a bit more from this patch. I'm > wondering if you planning on blocking another committer from going > ahead with this? Or if you have a reason why the current state of the > patch is not a meaningful enough

Re: pg_upgrade failing for 200+ million Large Objects

2024-03-27 Thread Tom Lane
Michael Banck writes: > What is the status of this? In the commitfest, this patch is marked as > "Needs Review" with Nathan as reviewer - Nathan, were you going to take > another look at this or was your mail from January 12th a full review? In my mind the ball is in Nathan's court. I feel it's

Re: Remove some redundant set_cheapest() calls

2024-03-27 Thread Tom Lane
Richard Guo writes: > On Wed, Mar 27, 2024 at 4:06 AM Tom Lane wrote: >> I'm less convinced about changing this. I'd rather keep it consistent >> with mark_dummy_rel. > Hm, I wonder if we should revise the comment there that states "but not > when called from elsewhere", as it does not seem to

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-27 Thread Bharath Rupireddy
On Wed, Mar 27, 2024 at 6:54 PM Bertrand Drouvot wrote: > > Hi, > > On Wed, Mar 27, 2024 at 05:55:05PM +0530, Bharath Rupireddy wrote: > > On Wed, Mar 27, 2024 at 3:42 PM Bertrand Drouvot > > Please see the attached v28 patch. > > Thanks! > > 1 === sorry I missed it in the previous review > >

Can't compile PG 17 (master) from git under Msys2 autoconf

2024-03-27 Thread Regina Obe
I've been having trouble compiling PG 17 using msys2 / mingw64 (sorry my meson setup is a bit broken at moment, so couldn't test that.). Both my msys2 envs (Rev2, Built by MSYS2 project) 13.2.0 and my older setup (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0 Have the same issue:

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Jelte Fennema-Nio
On Wed, 27 Mar 2024 at 16:10, Robert Haas wrote: > > On Wed, Mar 27, 2024 at 11:01 AM Bruce Momjian wrote: > > Uh, the above is clearly wrong. I think you mean "off" on the second line. > > Woops. When the name changed from externally_managed_configuration to > allow_alter_system, the sense of

Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs

2024-03-27 Thread Ranier Vilela
Hi, Nathan Bossart writes: >Committed with that change. Thanks for the guidance on this one. I think that left an oversight in a commit d365ae7 If the admin_role is a NULL pointer, so, can be dereferenced in

Re: Query Regarding frame options initialization in Window aggregate state

2024-03-27 Thread Tom Lane
Vallimaharajan G writes: > I am currently referring to the Postgres source code (psql (PostgreSQL) 14.3) > and came across a particular section related to window aggregate > initialization that has left me with a question. Specifically, I noticed a > conditional case in the initialization of

Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs

2024-03-27 Thread Nathan Bossart
On Wed, Mar 27, 2024 at 01:47:38PM -0300, Ranier Vilela wrote: > Em qua., 27 de mar. de 2024 às 13:41, Nathan Bossart < > nathandboss...@gmail.com> escreveu: >> On Wed, Mar 27, 2024 at 01:21:23PM -0300, Ranier Vilela wrote: >> > I think that left an oversight in a commit d365ae7 >> > < >>

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread David G. Johnston
On Wed, Mar 27, 2024 at 10:12 AM Isaac Morland wrote: > On Wed, 27 Mar 2024 at 13:05, Greg Sabino Mullane > wrote: > >> The purpose of the setting is to prevent accidental >>> modifications via ALTER SYSTEM in environments where >> >> >> The emphasis on 'accidental' seems a bit heavy here, and

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Robert Haas
On Wed, Mar 27, 2024 at 1:12 PM Isaac Morland wrote: > On Wed, 27 Mar 2024 at 13:05, Greg Sabino Mullane wrote: >>> The purpose of the setting is to prevent accidental >>> modifications via ALTER SYSTEM in environments where >> The emphasis on 'accidental' seems a bit heavy here, and odd.

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-03-27 Thread Alvaro Herrera
On 2024-Mar-27, Alvaro Herrera wrote: > I changed it so that the error messages are returned as translated > phrases, and was bothered by the fact that if errors happen repeatedly, > the memory for them might be leaked. Maybe this is fine depending on > the caller's memory context, but since

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Maciek Sakrejda
On Wed, Mar 27, 2024, 11:46 Robert Haas wrote: > On Wed, Mar 27, 2024 at 1:12 PM Isaac Morland > wrote: > > On Wed, 27 Mar 2024 at 13:05, Greg Sabino Mullane > wrote: > >>> The purpose of the setting is to prevent > accidental modifications via ALTER > SYSTEM in environments where > >> The

  1   2   >