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 i

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. > Donghan

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(). > > > Att

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 something

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 top-level

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 li

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

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

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 e

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

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 back-patc

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 (initi

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 *) root->parent_root-

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

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 f

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 on

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

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: > https://buildfarm.postgresql.org

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

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. > - Up

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 two

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 rem

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 chan

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 th

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 g

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 u

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? Sorr

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 MAX_BUFFER_IO_SIZ

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

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 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 "allo

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

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 personal

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 r

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 documen

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

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 seem

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, as

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

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

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 Th

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 i

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

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 be

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 impr

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 w

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 att

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. J

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 t

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

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 pe

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Greg Sabino Mullane
> > 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. Surely, just "to prevent modifications via ALTER SYSTEM in environments where..." is enough? Cheers, Greg

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Isaac Morland
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. Surely, just > "to prevent modifications via ALTER SYSTEM in e

Re: Combine Prune and Freeze records emitted by vacuum

2024-03-27 Thread Peter Geoghegan
On Tue, Mar 19, 2024 at 9:36 PM Melanie Plageman wrote: > * "Freeze" NewRelfrozenXid/NewRelminMxid trackers. > * > * Trackers used when heap_freeze_execute_prepared freezes, or when > there > * are zero freeze plans for a page. It is always valid for > vacuum

Re: Adding application_name to the error and notice message fields

2024-03-27 Thread Mitar
Hi! Oh, I can use PQparameterStatus to obtain application_name of the current connection. It seems then it is not needed to add this information into notice message. Mitar On Wed, Mar 27, 2024 at 4:22 PM Mitar wrote: > > Hi! > > We take care to always set application_name to improve our log li

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 >> > < >> https://g

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 o

Re: Built-in CTYPE provider

2024-03-27 Thread Jeff Davis
On Wed, 2024-03-27 at 16:53 +0100, Daniel Verite wrote: >  provider | isalpha | isdigit > --+-+- >  ICU  | f   | t >  glibc    | t   | f >  builtin  | f   | f The "ICU" above is really the behvior of the Postgres ICU provider as we implemented it, it's not

Re: Add new error_action COPY ON_ERROR "log"

2024-03-27 Thread Bharath Rupireddy
On Wed, Mar 27, 2024 at 7:42 AM Masahiko Sawada wrote: > > I think that there are two options to handle it: > > 1. change COPY grammar to accept DEFAULT as an option value. > 2. change tab-completion to complement 'DEFAULT' instead of DEFAULT, > and update the doc too. > > As for the documentation

Re: Combine Prune and Freeze records emitted by vacuum

2024-03-27 Thread Melanie Plageman
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 accounting such that I > > know which HEAPTUPLE_RECENTLY_DEAD tuples will not be marked LP_DEAD. > > And a way to consider freezing and do l

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

2024-03-27 Thread Alvaro Herrera
On 2024-Mar-22, Jelte Fennema-Nio wrote: > On Thu, 21 Mar 2024 at 03:54, Noah Misch wrote: > > > > On Mon, Mar 18, 2024 at 07:40:10PM +0100, Alvaro Herrera wrote: > > > I enabled the test again and also pushed the changes to dblink, > > > isolationtester and fe_utils (which AFAICS is used by pg_d

Re: Combine Prune and Freeze records emitted by vacuum

2024-03-27 Thread Melanie Plageman
On Wed, Mar 27, 2024 at 2:26 PM 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 accounting such that I > > > know which HEAPTUPLE_RECENTLY_DEAD tuples wi

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. Surely

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 it's

Re: add AVX2 support to simd.h

2024-03-27 Thread Nathan Bossart
On Tue, Mar 26, 2024 at 09:48:57PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> I just did the minimal fix for now, i.e., I moved the new label into the >> SIMD section of the function. I think it would be better stylistically to >> move the one-by-one logic to an inline helper function, bu

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 emph

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 14:35, Nathan Bossart < nathandboss...@gmail.com> escreveu: > 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 -03

Re: Use streaming read API in ANALYZE

2024-03-27 Thread Melanie Plageman
On Tue, Mar 26, 2024 at 02:51:27PM +0300, Nazir Bilal Yavuz wrote: > Hi, > > On Wed, 28 Feb 2024 at 14:42, Nazir Bilal Yavuz wrote: > > > > > > The new version of the streaming read API [1] is posted. I updated the > > streaming read API changes patch (0001), using the streaming read API > > in A

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-03-27 Thread Dmitry Koval
Hi! > I've fixed that by skipping a copy of the identity of another > partition (remove CREATE_TABLE_LIKE_IDENTITY from > TableLikeClause.options). Thanks for correction! Probably I should have looked at the code more closely after commit [1]. I'm also very glad that situation [2] was reproduce

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

2024-03-27 Thread Melanie Plageman
On Wed, Mar 27, 2024 at 10:11 AM Thomas Munro wrote: > > I got rid of "finished" (now represented by distance == 0, I was > removing branches and variables). I got rid of "started", which can > now be deduced (used for suppressing advice when you're calling > _next() because you need a block and

Re: add AVX2 support to simd.h

2024-03-27 Thread Tom Lane
Nathan Bossart writes: > Here's what I had in mind. My usual benchmark seems to indicate that this > shouldn't impact performance. Shouldn't "i" be declared uint32, since nelem is? BTW, I wonder why these functions don't declare their array arguments like "const uint32 *base". LGTM otherwise,

Re: [PATCH] plpython function causes server panic

2024-03-27 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 25, 2024 at 11:36 AM Tom Lane wrote: >> ... I don't see why this case is different, >> especially when the added cost compared to HEAD is not much more than >> one C function call. > Well, I explained why *I* thought it was different, but obviously you > don't

incorrect results and different plan with 2 very similar queries

2024-03-27 Thread Dave Cramer
Greetings, There is a report on the pgjdbc github JDBC Driver shows erratic behavior when filtering on CURRENT_DATE · pgjdbc/pgjdbc · Discussion #3184 (github.com) Here are the plans. JDBC - Nested Loop (incorrect result) Sort (cost=1071.31..

Re: add AVX2 support to simd.h

2024-03-27 Thread Nathan Bossart
On Wed, Mar 27, 2024 at 05:10:13PM -0400, Tom Lane wrote: > Shouldn't "i" be declared uint32, since nelem is? Yes, that's a mistake. > BTW, I wonder why these functions don't declare their array > arguments like "const uint32 *base". They probably should. I don't see any reason not to, and my c

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

2024-03-27 Thread Thomas Munro
On Thu, Mar 28, 2024 at 9:43 AM Melanie Plageman wrote: > For sequential scan, I added a little reset function to the streaming > read API (read_stream_reset()) that just releases all the buffers. > Previously, it set finished to true before releasing the buffers (to > indicate it was done) and th

Re: incorrect results and different plan with 2 very similar queries

2024-03-27 Thread David Rowley
On Thu, 28 Mar 2024 at 10:33, Dave Cramer wrote: > There is a report on the pgjdbc github JDBC Driver shows erratic behavior > when filtering on CURRENT_DATE · pgjdbc/pgjdbc · Discussion #3184 (github.com) > > Here are the plans. > > JDBC - Nested Loop (incorrect result) > > I

Re: Popcount optimization using AVX512

2024-03-27 Thread Nathan Bossart
On Mon, Mar 25, 2024 at 03:05:51PM -0500, Nathan Bossart wrote: > On Mon, Mar 25, 2024 at 06:42:36PM +, Amonson, Paul D wrote: >> Ok, CI turned green after my re-post of the patches. Can this please get >> merged? > > Thanks for the new patches. I intend to take another look soon. Thanks fo

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Bruce Momjian
On Wed, Mar 27, 2024 at 04:50:27PM +0100, Jelte Fennema-Nio wrote: > > This wording was suggested upthread. I think the point here is that if > > the superuser is logging in from the local machine, it's obvious that > > they can do whatever they want. The point is to emphasize that a > > superuser

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

2024-03-27 Thread Thomas Munro
On Thu, Mar 28, 2024 at 10:52 AM Thomas Munro wrote: > I think 1 is good, as a rescan is even more likely to find the pages > in cache, and if that turns out to be wrong it'll very soon adjust. Hmm, no I take that back, it probably won't be due to the strategy/ring... I see your point now... whe

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Bruce Momjian
On Wed, Mar 27, 2024 at 11:05:55AM -0400, Robert Haas wrote: > 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 lik

Re: incorrect results and different plan with 2 very similar queries

2024-03-27 Thread Dave Cramer
Dave Cramer On Wed, 27 Mar 2024 at 17:57, David Rowley wrote: > On Thu, 28 Mar 2024 at 10:33, Dave Cramer wrote: > > There is a report on the pgjdbc github JDBC Driver shows erratic > behavior when filtering on CURRENT_DATE · pgjdbc/pgjdbc · Discussion #3184 ( > github.com) > > > > Here are th

Re: Large block sizes support in Linux

2024-03-27 Thread Stephen Frost
Greetings, * Pankaj Raghav (ker...@pankajraghav.com) wrote: > On 23/03/2024 05:53, Thomas Munro wrote: > > On Fri, Mar 22, 2024 at 10:56 PM Pankaj Raghav (Samsung) > > wrote: > >> My team and I have been working on adding Large block size(LBS) > >> support to XFS in Linux[1]. Once this feature la

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread Bruce Momjian
On Wed, Mar 27, 2024 at 06:09:02PM -0400, Bruce Momjian wrote: > On Wed, Mar 27, 2024 at 11:05:55AM -0400, Robert Haas wrote: > > 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 "vote

Re: Built-in CTYPE provider

2024-03-27 Thread Jeff Davis
On Tue, 2024-03-26 at 08:04 +0100, Peter Eisentraut wrote: > The patch set v27 is ok with me, modulo (a) discussion about initcap > semantics, and (b) what collation to assign to ucs_basic, which can > be > revisited later. I held off on the refactoring patch for lc_{ctype|collate}_is_c(). There

Re: Possibility to disable `ALTER SYSTEM`

2024-03-27 Thread David G. Johnston
On Wed, Mar 27, 2024 at 3:13 PM Bruce Momjian wrote: > On Wed, Mar 27, 2024 at 06:09:02PM -0400, Bruce Momjian wrote: > > On Wed, Mar 27, 2024 at 11:05:55AM -0400, Robert Haas wrote: > > > On Wed, Mar 27, 2024 at 10:43 AM Jelte Fennema-Nio > wrote: > > > > Alright, changed the GUC name to "allow

  1   2   >